// JavaScript Document

activateMenu = function(nav) {
	var MSIEOffset = 0;
	document.async = false;
	if(document.getElementById(nav))
	{
		//MSIE
		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++)
		{
			while(lis[i].lastChild.tagName==undefined) {
				lis[i].removeChild(lis[i].lastChild);
			}
			
			/* If the LI has another menu level */
			if(lis[i].lastChild.tagName=="UL")
			{
				if(lis[i].parentNode.id == nav) 
				{
					lis[i].lastChild.style.marginLeft = "-"+MSIEOffset+"px";
				}
				else
				{
					lis[i].lastChild.style.marginLeft = MSIEOffset+"px";
				}
				/* assign the function to the LI */
				lis[i].onmouseover=function()
				{
					this.lastChild.style.display="block";
					//this.lastChild.lastChild.scrollIntoView();
					//alert(window.scrollTop);
					//location.href = "#bottom";
					//window.status = document.body.scrollTop;
					//document.body.scrollTop = 65535;
					//window.scrollTop = 65535;
					//alert(document.body.scrollHeight+","+document.body.scrollTop);
				}
				lis[i].onmouseout=function()
				{
					this.lastChild.style.display="none";
				}
			}
		}
	}
	else
	{
		//no menu
	}
};

