// current position of mouse on the PAGE
var pageX = -1;
var pageY = -1;

// current postion of mouse on the SCREEN
var screenX = -1;
var screenY = -1;

// once the glossary is selected the origonal click position is saved.
// current position of mouse on the PAGE
var clickedPageX = -1;
var clickedPageY = -1;

// current postion of mouse on the SCREEN
var clickedScreenX = -1;
var clickedScreenY = -1;

// offset from click point of the glossary div
var offsetX = 20;
var offsetY = 20;

// browser check
var ie = (document.all) ? 1:0;
var ns6 = (document.getElementById && !document.all) ? 1:0;

// register onMouseMove event handler
document.onmousemove = update;// update(event) implied on NS, update(null) implied on IE
function update(e)
{
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

  if (e)
  { 
      screenX = e.clientX;
      screenY = e.clientY;
      
      pageX = getBody().scrollLeft + screenX;
      pageY = getBody().scrollTop + screenY;
  }
}

// ensures that we get the correct document object to work with
function getBody(){
    
    if(document.compatMode && document.compatMode!="BackCompat")
        return document.documentElement;
    else
        return document.body;
}
