var curSub;
var outV;
var outMv;

function kSub(x) {
	x.className = x.className.replace(new RegExp("sfhover \\b"), "");
}

function navHover() {
	if (!document.getElementById("nav")) {
		return;
	}

	var mAs = document.getElementById("nav").getElementsByTagName("a");
	for (var i = 0; i<mAs.length; i++) {
		mAs[i].onmouseover = function() {
			
			if (this.className == "tnavlink") {
				if ((curSub != "") && (curSub != null)) {
					kSub(curSub);
					mouserOut();
				}
				clearTimeout(outV);
				clearTimeout(outMv);
				curSub = this.parentNode;
				this.parentNode.className = "sfhover "+this.parentNode.className;
				//alert(this.parentNode.className);
			}
		};

		mAs[i].onmouseout = function() {
			if (this.className == "tnavlink") {
				outV = setTimeout("kSub(curSub)", 3000);
				outMv = setTimeout("mouserOut()",3000);
			}
		};
	}

	if (!document.getElementById("navul")) {
		return;
	}

	var mULs = document.getElementById("navul").getElementsByTagName("ul");

	for (var i = 0; i<mULs.length; i++) {
		mULs[i].onmouseover = function() {
			clearTimeout(outV);
			clearTimeout(outMv);
		};
		mULs[i].onmouseout = function() {
			outV = setTimeout("kSub(curSub)", 3000);
			outMv = setTimeout("mouserOut()",3000);
		};
	}
};


function mouserOver(){
	var menuNav=document.getElementById("menuNav");
	var ulStore=document.getElementById("ulStore");
	
	var ulStoreLength = ulStore.getElementsByTagName("li").length;
	var m=0
	for (var i = 0; i<ulStoreLength; i=i+14) {
		m++;
	}
	
	//menuNav.style.height=(parseInt(menuNav.style.height)+parseInt(14*m))+"px";
	menuNav.style.height=180+"px";
}

function mouserOut(){
	document.getElementById("menuNav").style.height="155px";
}
window.onload = navHover;

