﻿// JScript File
var mousex = 0;
var mousey = 0;

function falsefunc() { return false; } // used to block cascading events

function init()
{
  document.onmousemove = update ; // update(event) implied on NS, update(null) implied on IE
  update();
  if (isdefined('positiontip')) { positiontip() }; 
  if (isdefined('captureKeyPress')) { captureKeyPress() }; 
}
function isdefined( variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}
function getMouseXY(e) // works on IE6,FF,Moz,Opera7
{ 
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

  if (e)
  { 
    if (e.pageX || e.pageY)
    { // this doesn't work on IE6!! (works on FF,Moz,Opera7)
      mousex = e.pageX;
      mousey = e.pageY;
    }
    else if (e.clientX || e.clientY)
    { // works on IE6,FF,Moz,Opera7
      mousex = e.clientX + document.documentElement.scrollLeft;
      mousey = e.clientY + document.documentElement.scrollTop;
    }  
  }
}

function update(e)
{
  getMouseXY(e); // NS is passing (event), while IE is passing (null)
  if (isdefined('positiontip')) { positiontip(e) }; 
}
