hover = function() {
	var popup = document.getElementById("lnk");
	if(popup){
		popup.onmouseover=function() {
			this.className+=" hover1";
		}
		popup.onmouseout=function() {
			this.className=this.className.replace("hover1", "");
		}
	}
}
var nav = null;
var nodes = null;
var _time = [];
initNav = function()
{
	nav = document.getElementById("nav");
	if(nav)
	{
		nodes = nav.getElementsByTagName("li")
		for (var i=0; i<nodes.length; i++) {
			if(nodes[i].getElementsByTagName("ul").length > 0)
			{
				nodes[i].ind = i;
				nodes[i].onmouseover=function() {
					if (_time[this.ind]) clearTimeout(_time[this.ind]);
					if(this.className.indexOf("hover") == -1)
						this.className+=" hover";
				}
				nodes[i].onmouseout=function() {
						var _index = this.ind;
						_time[_index] = setTimeout(function(){hideHover(_index)},10);				
				}
			}
		}
	}
}
function hideHover(_index2) {
	nodes[_index2].className = nodes[_index2].className.replace("hover", "");
}


if (window.addEventListener){
	window.addEventListener("load", initNav, false);
}
else if (window.attachEvent && !window.opera){
	window.attachEvent("onload", initNav);
	window.attachEvent("onload", hover);
}
