// show or hide a submenu of the current menu
function SwitchMenu( strMenuName )
{
	var bHasElements = document.getElementById? 1:0 ;
	var bNetscape = document.layers? 1:0 ;
	var bInternetExplorer = document.all? 1:0 ;

	if( bHasElements && !bInternetExplorer )
	{
		strDisplay = document.getElementById(strMenuName).style.display;
		if( strDisplay=='table-row' | strDisplay=='block' )
		{
			strDisplay = 'none';
		}
		else
		{
			strDisplay = 'table-row';
		}
		document.getElementById(strMenuName).style.display = strDisplay;
	}

	else if( bNetscape )
	{
		strDisplay = document.layers[strMenuName].display;
		if( strDisplay=='table-row' | strDisplay=='block' )
		{
			strDisplay = 'none';
		}
		else
		{
			strDisplay = 'block';
		}
		document.layers[strMenuName].display = strDisplay;
	}

	else if( bInternetExplorer )
	{
		strDisplay = document.all[strMenuName].style.display;
		if( strDisplay=='table-row' | strDisplay=='block' )
		{
			strDisplay = 'none';
		}
		else
		{
			strDisplay = 'block';
		}
		document.all[strMenuName].style.display = strDisplay;
	}
}


// show or hide a submenu of the current menu
function ShowMenu( strMenuName )
{
	var bHasElements = document.getElementById? 1:0 ;
	var bNetscape = document.layers? 1:0 ;
	var bInternetExplorer = document.all? 1:0 ;

	if( bHasElements && !bInternetExplorer )
	{
		strDisplay = 'table-row';
		document.getElementById(strMenuName).style.display = strDisplay;
	}

	else if( bNetscape )
	{
		strDisplay = 'block';
		document.layers[strMenuName].display = strDisplay;
	}

	else if( bInternetExplorer )
	{
		strDisplay = 'block';
		document.all[strMenuName].style.display = strDisplay;
	}
}

// show or hide a submenu of the current menu
function HideMenu( strMenuName )
{
	var bHasElements = document.getElementById? 1:0 ;
	var bNetscape = document.layers? 1:0 ;
	var bInternetExplorer = document.all? 1:0 ;

	if( bHasElements && !bInternetExplorer )
	{
		strDisplay = 'none';
		document.getElementById(strMenuName).style.display = strDisplay;
	}

	else if( bNetscape )
	{
		strDisplay = 'none';
		document.layers[strMenuName].display = strDisplay;
	}

	else if( bInternetExplorer )
	{
		strDisplay = 'none';
		document.all[strMenuName].style.display = strDisplay;
	}
}


function SelectAllCheckBoxes(currentCheckBox, changingCheckBoxList) 
{
     var currentForm = currentCheckBox.form;
     var i = 0;
	 for(i=0; i<currentForm.length; i++)
	 {
     	if(currentForm[i].type == 'checkbox')
     	{
     		if(currentForm[i]!=currentCheckBox)
     		{
     			//alert(currentForm[i].name);
     			if(currentForm[i].name==changingCheckBoxList)
     			{
	  				currentForm[i].checked = currentCheckBox.checked;
     			}
	  		}	
	  	}
	 }
}
