activateMenu = function(nav) {

/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */

        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
				   this.style.margin="0 -6em 0 0";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
				   this.style.margin="0";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level UL */

    /* remove one, when only using one menu */
    activateMenu('nav'); 
}

















function JSInit() {
{
	if(typeof(SYS_SearchResultsGetWords) + "" != "undefined") {
		var obj = SFGetRef("SF1_input");
		if(typeof(obj) + "" != "undefined") {
			obj.value = SYS_SearchResultsGetWords();
		}
	}

}
{
	document.MHD1TimeOutID = "";
	var obj = MHDGetRef("MHD1");
	if(MHDIsDomNull(obj)) return;

	document.MHD1StartX = MHDGetOffsetLeft(obj);
	document.MHD1StartY = MHDGetOffsetTop(obj);

	MHDPositionChildren("MHD1", true, obj.offsetLeft, obj.offsetTop);

	document.MHD1_onmousemoveorg = document.onmousemove;
	document.onmousemove = function(evt) { 
		MHD1OnMouseMove(evt);
		if(document.MHD1_onmousemoveorg != null) document.MHD1_onmousemoveorg(evt);
	}

}
}

	function SFGetRef(str)
	{
		if(document.all)
			return document.all[str];
		else
			return document.getElementById(str);
	}

	function SFSwitchImage(strID, strFileName)
	{
		var obj = SFGetRef(strID);
		if(typeof(obj) + "" == "undefined") return;
		obj.src = strFileName;
	}

	function SFSendForm(strID)
	{
		var obj = SFGetRef(strID);
		if(typeof(obj) + "" == "undefined") return;
		var str = obj.value;
		if(str.length > 0) {
			location.href = "SearchResult.htm?r=" + parseInt(Math.random() * 10000) + "&words=" + escape(str) + "#" + escape(str);
		}
	}

	function MSBGetRef(str)
	{
		if(document.all)
			return document.all[str];
		else
			return document.getElementById(str);
	}

	function MSBCommitAction(strSelect) {
		var obj = MSBGetRef(strSelect);
		if(obj == null) return;
		var nSel = obj.selectedIndex;
		var objAction = obj[nSel];
		if(objAction == null) return;
		if(objAction.value == "") return;
		location.href = objAction.value;
	}

		
	function MHD1OnMouseMove(evt)
	{
		var x = document.all ? (event.x - 2) : document.layers ? evt.x : evt.clientX;
		var y = document.all ? (event.y - 2) : document.layers ? evt.y : evt.clientY;
	
		var strSel = MHDCheckHit("MHD1", true, document.MHD1StartX, document.MHD1StartY, x, y);
		if(strSel != "") {
			if(document.MHD1TimeOutID != "") clearTimeout(document.MHD1TimeOutID);
			document.MHD1TimeOutID = "";
			MHDOpenSelected("MHD1", strSel);
		} else {
			if(500 == 0) {
				MHDOpenSelected("MHD1", "");
			} else {
				if(document.MHD1TimeOutID == "") document.MHD1TimeOutID = setTimeout("MHDOpenSelected('MHD1', '')", 500);
			}
		}
	}

	function MHDOpenSelected(strID, strSelID)
	{
		for(var i = 0; i < 1000; ++i) {
			var strIDNew = strID + "_" + i;
			var obj = MHDGetRef(strIDNew);
			if(MHDIsDomNull(obj)) break;

			var objContainer = MHDGetRef(strIDNew + "_c");
			if(!MHDIsDomNull(objContainer)) {
				objContainer.style.visibility	= ((strSelID.search(strIDNew) == 0) ? "visible" : "hidden");
				objContainer.style.display		= ((strSelID.search(strIDNew) == 0) ? "block" : "none");
				MHDOpenSelected(strIDNew, strSelID);
			} 
		}
	}
	function MHDIsDomNull(obj)
	{
		return (obj == null || typeof(obj) + "" == "undefined");
	}

	function MHDIsVisible(obj)
	{
		if(MHDIsDomNull(obj)) return true;
		if(MHDIsDomNull(obj.style)) return true;

		var bParentOK = true;
		var s = obj.id;
		var nPos = s.lastIndexOf("_");
		if(nPos != -1 && s.indexOf("_c") == -1 ) { 
			var objParent = MHDGetRef(s.substring(0, nPos) + "_c");
			if(!MHDIsDomNull(objParent)) bParentOK = MHDIsVisible(objParent);
		}
		return obj.style.visibility != "hidden" && bParentOK;
	}

	function MHDGetRef(str)
	{
		if(document.all)
			return document.all[str];
		else
			return document.getElementById(str);
	}

	function MHDSwitchImage(strID, strFileName)
	{
		var obj = MHDGetRef(strID);
		if(obj + "" == "undefined") return;
		obj.src = strFileName;
	}

	function MHDSetClass(strID, strClass)
	{
		var obj = MHDGetRef(strID);
		if(!MHDIsDomNull(obj)) obj.className = strClass;
	}	

	function MHDGetOffsetTop(obj)
	{
		if(MHDIsDomNull(obj)) return 0;
		return parseInt(obj.offsetTop) + (isNaN(parseInt(obj.clientTop) ? 0 : parseInt(obj.clientTop))) + MHDGetOffsetTop(obj.offsetParent);		
	}
		
	function MHDGetOffsetLeft(obj)
	{
		if(MHDIsDomNull(obj)) return 0;
		return parseInt(obj.offsetLeft) + (isNaN(parseInt(obj.clientLeft) ? 0 : parseInt(obj.clientLeft))) + MHDGetOffsetLeft(obj.offsetParent);		
	}
	
	function MHDPositionChildren(strID, bRoot, nX, nY)
	{
		var n = 0;
		for(var i = 0; i < 1000; ++i) {
			var strIDNew = strID + "_" + i;
			var obj = MHDGetRef(strIDNew);
			if(MHDIsDomNull(obj)) break;

			var objContainer = MHDGetRef(strIDNew + "_c");
			if(!MHDIsDomNull(objContainer)) {
				if(bRoot) {
					objContainer.style.left	= (nX + n) + "px";
					objContainer.style.top	= (nY + obj.offsetHeight) + "px";
				} else {
					objContainer.style.left	= (nX + obj.offsetWidth + 2) + "px";
					objContainer.style.top	= (nY + n + 1) + "px";
				}
				MHDPositionChildren(strIDNew, false, parseInt(objContainer.style.left), parseInt(objContainer.style.top));
			} 
			n += (bRoot ? obj.offsetWidth + 0 + 10 : obj.offsetHeight);
		}
	}

	function MHDCheckHit(strID, bRoot, nX, nY, nMouseX, nMouseY)
	{
		var x = nX + (bRoot ? 0 : 1);
		var y = nY + (bRoot ? 0 : 1);
	
		for(var i = 0; i < 1000; ++i) {
			var strIDNew = strID + "_" + i;
			var obj = MHDGetRef(strIDNew);
			if(MHDIsDomNull(obj)) break;
			
			var nX2 = x + obj.offsetWidth;
			var nY2 = y + obj.offsetHeight;
			
			if(MHDIsVisible(obj) && (nMouseX >= x) && (nMouseX < x + obj.offsetWidth) && (nMouseY >= y) && (nMouseY < y + obj.offsetHeight))
				return strIDNew;
			
			if(bRoot) {
				var s = MHDCheckHit(strIDNew, false, x, y + obj.offsetHeight, nMouseX, nMouseY);
				if(s != "") return s;
				x += obj.offsetWidth + 0 + 10;
			} else {
				var s = MHDCheckHit(strIDNew, false, x + obj.offsetWidth + 1, y, nMouseX, nMouseY);
				if(s != "") return s;
				y += obj.offsetHeight;
			}
		}
		return "";
	}