var xvalue;
var yvalue; 

var menuobj=getObjByID("menuDiv");

 var l;
 var t;
 var divwidth;
 var divheight=200;
 
 var wmar=10;
 var hmar=10;
 
 var isvisible;

function HideMenu() 
{
 	var mX=xvalue;
 	var mY=yvalue;
	if (isvisible == true)
	{
	  if ((mX <= parseInt(menuobj.style.left)-wmar) || (mX > parseInt(menuobj.style.left)+divwidth+wmar) || (mY < parseInt(menuobj.style.top)-hmar) || (mY > parseInt(menuobj.style.top)+divheight+hmar)){
  	  menuobj.style.display="none";
  	  isvisible = false;
  	}
	}
}

function ShowMenu(vMnuCode,tWidth) 
{
  divwidth=tWidth;
	vMnuCode = "<table cellspacing=0 cellpadding=0 style='width:"+tWidth+"' class=viewtable><tr height=23><td nowrap align=left class=viewtr valign=top >" + vMnuCode + "</td></tr></table>";

	l = xvalue ;
	t = yvalue ;
	
	menuobj.innerHTML = vMnuCode;
	menuobj.style.top = t;
	menuobj.style.left = l;	
	menuobj.style.display="block";
	
	isvisible = true;
}

function MouseMove(e){
	if(sbrowsename=="NETSCAPE"){
		xvalue=e.pageX;
    yvalue=e.pageY;
	}
	else{
	  xvalue = window.event.x + document.body.scrollLeft;
		yvalue = window.event.y + document.body.scrollTop;
	}
  HideMenu();
}

if(sbrowsename=="NETSCAPE"){
  document.captureEvents(Event.MOUSEMOVE);
}

document.onmousemove = MouseMove;
