function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById("child"+whichLayer).style;
		style2.display = style2.display? "":"block";
		
		var img = document.getElementById ("expandicon" + whichLayer);
	
		img.src = (style2.display == "block") ? templatePath + "images/menu/collapse.gif" : templatePath +  "images/menu/expand.gif";
		
		document.cookie = "layer"+whichLayer + "=" +  ((style2.display == "block") ? "o" : "c");
	
		
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all["child"+whichLayer].style;
		style2.display = style2.display? "":"block";
		
		var img = document.all["expandicon" + whichLayer];
		img.src = style2.display ? templatePath + "images/menu/collapse.gif" : templatePath +  "images/menu/expand.gif";
		
			document.cookie = "layer"+whichLayer + "=" +  ((style2.display == "block") ? "o" : "c");
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers["child"+whichLayer].style;
		style2.display = style2.display? "":"block";
		
		var img = document.layers["expandicon" + whichLayer];
		img.src = style2.display ? templatePath + "images/menu/collapse.gif" : templatePath +  "images/menu/expand.gif";
		
			document.cookie = "layer"+whichLayer + "=" +  ((style2.display == "block") ? "o" : "c");
	}
}


function showHelp (helpID) {
	
	
	window.open ("helpPopup.php?helpID=" + helpID,"help","height=450,width=400,status=1");
	
}

function makeActionFromDropDown (prefix, dropdown, allowNegative) {
	
	if (document.getElementById)
	{
		var dd = document.getElementById (dropdown);
		
		var value = (dd.options[dd.options.selectedIndex].value);
		
		if (value == "-1") {
			
			if (!allowNegative) {
				alert ("Please make a selection.");
				// do nothing
				return;
			}
			
		}
		
		else
		
		{
			
			// perform the redirect
			window.location.href = prefix + value;
			
		}
		
//		alert (dd);
		
	}
	
}

