﻿function onAllClick (sCheckBoxElementID, sListElementID) 
{
	oCheckBox = document.getElementById(sCheckBoxElementID);
	oListBox = document.getElementById(sListElementID);

	for (i=oListBox.length-1; i >= 0; i--) 
	{
		oListBox.options[i].selected = oCheckBox.checked;
	}
	
	return true;

}



function onListClick (sCheckBoxElementID, sListElementID) {
	oCheckBox = document.getElementById(sCheckBoxElementID);
	oListBox = document.getElementById(sListElementID);
	bAllSelected = true;

	for (i=oListBox.length-1; i >= 0; i--) 
	{
		if (oListBox.options[i].selected == false)
		{
			bAllSelected = false	
		}
	}

	if (bAllSelected == true)
	{
		oCheckBox.checked = true;
	} 
	else 
	{
		oCheckBox.checked = false;
	}

}

function ShowHideSearchOptions(sTableCell, sCheckBox)
{
    var tdCell = document.getElementById(sTableCell);
    var chkCheck = document.getElementById(sCheckBox);
    if (chkCheck.checked == true)
    {
        tdCell.style.visibility='visible';
    }
    else
    {
        tdCell.style.visibility='hidden';
    }	
    return true;
}