function initPage()
{
	var navRoot = document.getElementById("nav");
	var lis = navRoot.getElementsByTagName("li");
	for (var i=0; i<lis.length; i++)
	{
		lis[i].onmouseover = function()
		{
			this.className += " hover";
			var _sub = this.getElementsByTagName("div")[0];
			if (_sub) {
			var _height = _sub.offsetHeight;
			_sub.style.top = - (_height/2)  + 14 + "px";
			}
                }
		lis[i].onmouseout = function()
		{
			this.className = this.className.replace("hover","");
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent)
	window.attachEvent("onload", initPage);

