// JavaScript Document
var nbottom=0,speed=5,objDiv,menuon=0;
function menuControl(show,nav){
	window.event.cancelBubble=true;
	var menuDiv=nav.getElementsByTagName("div");
	menuObj=menuDiv[0];
	if(show==1&&menuon==0)	{
		menuObj.style.display="block";
		nbottom=0;
		objDiv=menuObj;
		MenuOut();
	}
	else{
		if(menuon==0)
			menuObj.style.display="none";
	}
}

function MenuOut(){
	obj=objDiv;
	obj.style.clip="rect(0 100% "+nbottom+"% 0)";
	nbottom+=speed;
	if(nbottom<=100)
		timerID=setTimeout("MenuOut()","10");
	else{
		clearTimeout(timerID);
		obj.onmouseover=function(){
			menuon=1;
			this.style.display="block";
		}
		obj.onmouseout=function(){
			menuon=0;
			this.style.display="none";
		}

	}
}
window.onload=function(){
	var menuObj = document.getElementById("tMenu").getElementsByTagName("li");
	for (var i=0; i<menuObj.length; i++) {
 		menuObj[i].onmouseover=function(){
  			this.className+=(this.className.length>0? " ": "") + "hover";
			menuControl(1,this);
		}
 		menuObj[i].onmouseout=function(){
 			this.className=this.className.replace(new RegExp("( ?|^)hover\\b"),"");
  			 menuControl(0,this);
		}
 	}	
}
