function Popup(strURL, strName, intWidth, intHeight, strStatus, strScroll, strResize, strToolbar) {
	if (!strURL) {
		alert('A link must be specified when using the Popup function.');
	}
	else
		{
		if (!strName) strName = 'popup';
		if (!intWidth) intWidth = 600;
		if (!intHeight) intHeight = 400;
		if (!strStatus) strStatus = 'yes';
		if (!strScroll) strScroll = 'yes';
		if (!strResize) strResize = 'yes';
		if (!strToolbar) strToolbar = 'no';
		if (typeof(objWindow) != "undefined" && objWindow != null && !objWindow.closed) objWindow.close();
		objWindow = window.open(strURL, strName, 'width=' + intWidth + ',height=' + intHeight + ',status=' + strStatus + ',scrollbars=' + strScroll + ',resizable=' + strResize + ',toolbar=' + strToolbar);
		objWindow.focus();
	}
}
// JavaScript Document
var t;

function fixheight() {
 var maxH = 0;
 var ids = ["leftsection","rightcontent"];
 // find the highest column
 for (var i=0; i<ids.length; i++) {
  var d = document.getElementById(ids[i]);
  d.style.height = ""; // important, set it to empty (mozilla, ie)
  if (d.offsetHeight > maxH) maxH = d.offsetHeight;
 }
 // set them all to be that height
 for (var i=0; i<ids.length; i++) {
  var d=document.getElementById(ids[i]);
  d.style.height = maxH+"px";
 }
}

/* MENU */
var sstrStay = '';
var sstrOn = '';
var sintTimer = 0;
// sarrItem is now set at /assets/menu.asp

//Should really be called: menu off if not highlighted...
//only do MenuOff if the current page is different from the strID page (i.e. user's not currently viewing it)

function setClassName(strClassID, strClassName) {
	
	var objN = document.getElementById(strClassID);
	if (objN != null) {
		objN.className = strClassName;
	}	
}


function getTrueOffSet(obj, strPos)
{
	var offsetStr="offset" + (strPos.toLowerCase()=="top" ? "Top" : strPos.toLowerCase()=="top" ? "Top" : "Left");
	var offsetVal=eval("obj." + offsetStr);
	while (obj.offsetParent != null)
	{
		offsetVal += eval("obj.offsetParent." + offsetStr);
		obj=obj.offsetParent;
	}
	return(offsetVal);
}

function MenuOn(strID, blnRight) {
	sstrStay = strID;
	if (strID != sstrOn) {
		sstrOn = strID;
		var objN = document.getElementById('nav_' + strID);
		var objM = document.getElementById('menu_' + strID);

		if (objN != null && objM != null) {
			if (blnRight) {
				objM.style.left = (getTrueOffSet(objN, "left") - (objM.offsetWidth - objN.offsetWidth)) + 'px';
			}
			else {
				objM.style.left = (getTrueOffSet(objN, "left") - 1) + 'px';
			}
			objM.style.top = (getTrueOffSet(objN, "top")+64) + 'px';
			objM.style.visibility = 'visible';
		}
		MenuAllHide(strID);
	}
}

function MenuStay(strID, strClass) {
	sstrStay = strID;

		var objN = document.getElementById('nav_' + strID);	
		if (objN != null) {
			setClassName('cell_' + strID, strClass);
		}
}

function MenuOff(strID, strClass) {
	sstrStay = '';
	clearTimeout(sintTimer);
	sintTimer = setTimeout('MenuHide(\'' + strID + '\')', 500);

		var objN = document.getElementById('nav_' + strID);	
		if (objN != null) {
			setClassName('cell_' + strID, strClass);
		}
	
}

function MenuOffIf(strID, gstrScript, keyword) {

	sstrStay = '';
	clearTimeout(sintTimer);
	sintTimer = setTimeout('MenuHide(\'' + strID + '\')', 500);
	
	//If the menu should not be highlighted, turn it off
	if (gstrScript.indexOf(keyword) < 0) {
		var objN = document.getElementById('nav_' + strID);	
		if (objN != null) {
			setClassName('cell_' + strID, strID);
		}
	}
}

function MenuAllOff() {
	sstrStay = '';
	sstrOn = '';
	clearTimeout(sintTimer);
	MenuAllHide();
}

function MenuHide(strID) {
	if (strID != sstrStay) {
		if (strID == sstrOn) sstrOn = '';
		var objM = document.getElementById('menu_' + strID);
		if (objM != null)
		{
			objM.style.visibility = 'hidden';
		}	
	}
}

function MenuAllHide(strID) {
	var intCount, strItem;
	for (intCount = 0; intCount < sarrItems.length; intCount++) {
		strItem = sarrItems[intCount];
		if (strID != strItem) MenuHide(strItem);
	}
}


