﻿function GetMousePosition()
{
    if (document.layers) getMouseLoc;     //NS
    else if (document.all) getMouseLoc(); //IE
    
    document.getElementById("wait").style.zIndex = 99;
    document.getElementById("wait").style.top = mouseLocation.y - 10 +'px';
    //document.getElementById("wait").style.left = mouseLocation.x - 10 +'px';
}

function Point(x,y) 
{  
    this.x = x; this.y = y; 
}

mouseLocation = new Point(-500,-500);

function getMouseLoc(e)
{
  if(!document.all)  //NS
  {
    mouseLocation.x = e.pageX;
    mouseLocation.y = e.pageY - 164;
  }
  else               //IE
  {
    mouseLocation.x = event.x + document.body.scrollLeft;
    mouseLocation.y = event.y + document.body.scrollTop;
  }
  return true;
}

function registerEvents()
{
    //NS init:
    if(!window.captureEvents)
    {
        document.onmousemove=getMouseLoc
        document.onmousedown=GetMousePosition
    }
    if (window.captureEvents) 
    {
        window.captureEvents(Event.MOUSEMOVE)
        window.onmousemove=getMouseLoc //e should not be defined
        window.captureEvents(Event.MOUSEDOWN)
        window.onmousedown=GetMousePosition //e should not be defined
    }
}
