var menuidsup=new Array("verticalmenuupdem","verticalmenuuprep"); //Enter id(s) of UL menus, separated by commas
var menuidsdown = new Array("verticalmenudown");
function createcssmenuup() {
	for(var i=0; i<menuidsup.length; i++) {
		
		var tabledivs=document.getElementById(menuidsup[i]).getElementsByTagName("div");
		for(var t=0; t<tabledivs.length; t++) {
			tabledivs[t].parentNode.onmouseover=function() {
				this.getElementsByTagName("div")[0].style.right=this.getElementsByTagName("div")[0].parentNode.offsetWidth+"px";
				rows=(this.getElementsByTagName("div")[0].getElementsByTagName("tr")).length;
				
				this.getElementsByTagName("div")[0].style.top= rows * 95 * -1 -2 + this.getElementsByTagName("div")[0].parentNode.offsetHeight +"px"
				
				this.getElementsByTagName("div")[0].style.display="block";
				return false;
			}
			tabledivs[t].parentNode.onmouseout=function() {
				div=this.getElementsByTagName("div");
				div[0].style.display='none';
			//	timeout=setTimeout("div[0].style.display='none'",500);
				return false;
			}
		}
	}
}
function createcssmenudown() {
	for(var i=0; i<menuidsdown.length; i++) {
		var tabledivs=document.getElementById(menuidsdown[i]).getElementsByTagName("div");
		for(var t=0; t<tabledivs.length; t++) {
			tabledivs[t].parentNode.onmouseover=function() {
				this.getElementsByTagName("div")[0].style.right=this.getElementsByTagName("div")[0].parentNode.offsetWidth+"px";
				this.getElementsByTagName("div")[0].style.display="block";
				return false;
			}
			tabledivs[t].parentNode.onmouseout=function() {
				div=this.getElementsByTagName('div');
				timeout=setTimeout("div[0].style.display='none'",500);
				return false;
			}
		}
	}
}

if (window.addEventListener) 
	window.addEventListener("load", createcssmenuup, true);
else if (window.attachEvent)
	window.attachEvent("onload", createcssmenuup);
if (window.addEventListener) 
	window.addEventListener("load", createcssmenudown, true);
else if (window.attachEvent)
	window.attachEvent("onload", createcssmenudown);

