function popWindow(sURL, sName, nWidth, nHeight) {
	if (!sName) sName = "popWindow";
	if (!nWidth) nWidth = "300";
	if (!nHeight) nHeight = "300";
	var n = window.open(sURL,sName,'status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1,resizable=1,width='+nWidth+',height='+nHeight);
	n.focus();
	void(0);
}

function MM_findObj(n,d) { //v4.01
	var p,i,x;
	if (!d) d=document;
	if ((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); }
	if (!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for (i=0;!x&&d.layers&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if (!x && d.getElementById) x=d.getElementById(n);
	return x;
}

function ShowIt(itemName) {
	MM_findObj(itemName).style.display = '';
}

function HideIt(itemName) {
	MM_findObj(itemName).style.display = 'none';
}

function ToggleIt(itemName) {
	if (MM_findObj(itemName).style.display == 'none') {
		MM_findObj(itemName).style.display = '';
	} else {
		MM_findObj(itemName).style.display = 'none';
	}
}





//Following used for toggling the menu items.
//uses moo.tools to write JS code into DOM elements, referenced via CSS selectors.
function hideAllSubmenus() {
	//hide all submenus
	$$('#menu ul li.submenu').setStyle('display','none');
	//show those with class = "openOnLoad"
	$$('#menu ul li.openOnLoad').setStyle('display','');
}

function toggleSubmenu(obj) {

	//this function gets attached to all relevant elements by using "addevent"
	if (obj.getNext().getStyle('display') == 'none') {
		obj.getNext().setStyle('display', '');
	} else {
		obj.getNext().setStyle('display', 'none');
	}
}


function HighLightMenuOn(li)
{
  li.style.backgroundColor='#408D19';
}


function HighLightMenuOff(li)
{
  li.style.backgroundColor='#1F5C00';
}