		var hideDelay=300;
		var runable=(!document.getElementById)? (!document.all)? (!document.layers)? -1:1:2:3;
		var ie=(document.all)? true:false;
		var nowShowing="$";
		var showedMenu="";
		var onLayer=onLink=flgShow=0;
		var timerID=st=en=0;
		var mx=my=0;
		
		window.onload=function () { if (runable>1) document.onmousemove=function (event) {delayHideMenu(event) } }
		function getElm(name,style)
		{
			var doc=self.document;
			if (runable==2) var gobj=doc.all(name); 
			else var gobj=doc.getElementById(name); 
			if (style && runable>1) gobj=gobj.style;
			return gobj;
		}
		function showMenu(n,X,Y)
		{
			if (runable<2) return;
			var obj=getElm("menu"+n,1);
			var lnk=getElm("menuButton"+n);
			var lnks=getElm("menuButton"+n,1);
			nowShowing=n;
			
			
			if (showedMenu!="" && showedMenu!=nowShowing) hideMenu(showedMenu);
			if (obj.visibility=="visible" && onLink==1) return;
			lnk.onmouseout=leaveLink;
			onLayer=onLink=1;
			obj.left=X +"px"|| parseInt(lnks.left);
			obj.top=Y +"px"|| parseInt(lnks.top)+((runable==1)? lnk.clip.height:lnk.offsetHeight);
			obj.visibility="visible";
			showedMenu=nowShowing;
			flgShow=1;
			clearTimeout(timerID);
			st=t();
		}
		function leaveLink()
		{
			onLink=0;
			en=t();
		}
		function delayHideMenu(e)
		{
			mx=gmx(e);
			my=gmy(e);
			if (nowShowing=="$" || flgShow==0 || st==0) return;
			if (onLink==0 && checkPosition())
			{
				en=t();
				onLayer=0;
				hideMenu();
			}
			else
			{
				st=t();
				onLayer=1;
				clearTimeout(timerID);
			}
		}
		function hideMenu(n)
		{
			clearTimeout(timerID);
			if (!n)
			{
				
				if (nowShowing=="$" || onLayer!=0) return;
				if (onLink==1) 
				{
					timerID=setTimeout("hideMenu()",hideDelay);
					st=t();
					return;
				}
				else if (((en-st)%hideDelay)<hideDelay && st!=0) 
				{
					clearTimeout(timerID);
					timerID=setTimeout("hideMenu()",hideDelay);
					st=0;
					return;
				}
				else if (!checkPosition())
				{
					st=t();
					return;
				}
			}
			
			getElm("menu"+((n)? n:nowShowing),1).visibility="hidden";
			showedMenu="";
			onLayer=flgShow=0;
		}
		function checkPosition()
		{
			if (nowShowing=="$") return;
			var obj=getElm("menu"+nowShowing);
			var x=mx-((runable==1)? parseInt(obj.left):obj.offsetLeft);
			var y=my-((runable==1)? parseInt(obj.top):obj.offsetTop);
			var w=(runable==1)? parseInt(obj.clip.width):obj.offsetWidth;
			var h=(runable==1)? parseInt(obj.clip.height):obj.offsetHeight;
			if (onLink==0 && (x<=0 || y<=0 || x>=w || y>=h)) return true;
			return false;
		}
		function t()
		{
			return (new Date()).getTime();
		}
		function gmx(e)
		{
			if (ie) return document.body.scrollLeft+event.clientX;
			else return e.pageX;
		}
		function gmy(e)
		{
			if (ie) return document.body.scrollTop+event.clientY;
			else return e.pageY;
		}


