initNav = function() {
		var navRoot = document.getElementById("main-nav");
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
				var cul = this.getElementsByTagName("ul");
				if (cul) {
					for (var j=0; j<cul.length; j++){
						cul[j].style.width = this.offsetWidth + "px";
					}
				}
				if (window.attachEvent && !window.opera) hideSelectBoxes(this.getElementsByTagName("ul").item(0));

			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace("hover", "");
				if (window.attachEvent && !window.opera) showSelectBoxes(this.getElementsByTagName("ul").item(0));
			}
		}

}
if (window.addEventListener){
	window.addEventListener("load", initNav, false);
}
else if (window.attachEvent && !window.opera){
	attachEvent("onload", initNav);
}

