// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false
var MouseX;
var MouseY;
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
 if (IE) { // grab the x-y pos.s if browser is IE
  tempX = event.clientX + document.body.scrollLeft
  tempY = event.clientY + document.body.scrollTop
 } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
   }  
     // catch possible negative values in NS4
     if (tempX < 0) {tempX = 0;}
     if (tempY < 0) {tempY = 0;}  
     // show the position values in the form named Show
      // in the text fields named MouseX and MouseY
       MouseX = tempX;
       MouseY = tempY;     
       ///alert(tempX);
       //window.status = "X:"+tempX+" - Y:"+tempY;
       return true
}

var menu_interval = 0;
function WndOpen(path,width,height,left,top)
 {
  trWindow=window.open(path,"TrailerWindow","toolbar=no,scrollbars=yes,width="+width+",height="+height+",left="+left+"top="+top);
  trWindow.focus();
  //alert(path);
 }
 


function ShowMenu(MenuId) {
 if (MenuId) {
  Item = document.getElementById(MenuId);
  if (Item) {
  //if (menu_interval) clearInterval(menu_interval);
  //if (SlideInterval) clearInterval(SlideInterval);
  //menu_interval=setInterval("HideMenu('helpmenu')",2000);
  Item.style.display = '';
  Item.style.left = (MouseX-50) + 'px';
//coord = mouseXY(document);
  //getMouseXY(document);
  //alert("1");
  //alert(document.Show.MouseX.value);
  
  }
 }
}

function HideMenu(MenuId) 
{
 //alert(document.getElementById);
 clearInterval(menu_interval);
 Item = document.getElementById(MenuId);
 //alert("ASDASD");
 //alert("ADSDASD: "+Item);
  if (Item) {
    Item.style.display='none';
    //alert(MenuId);
   }
}       	

function mouseXY(e)
{
 var x = 0, y = 0;
 if (!e) e = window.event;
 if (e.pageX || e.pageY)
  {
   x = e.pageX;
   y = e.pageY;
  }
 else if (e.clientX || e.clientY)
   {
    x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
    y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
   }
  return {"x":x, "y":y};
}		  					     
