﻿// JScript File

// Mouse move

var IE = document.all?true:false

if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

var mouseX = 0
var mouseY = 0


function getMouseXY(e) 
{

 var currentScrollX = 0;
 var currentScrollY = 0;

if (window.pageYOffset)
{
     currentScrollX = window.pageXOffset
     currentScrollY = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop)
{
     currentScrollX = document.documentElement.scrollLeft
     currentScrollY = document.documentElement.scrollTop
}
else if (document.body)
{
     currentScrollX = document.body.scrollLeft
     currentScrollY = document.body.scrollTop
}


  if (IE) { // grab the x-y pos.s if browser is IE
    mouseX = window.event.x + currentScrollX 
    mouseY = window.event.y + currentScrollY
  } else {  // grab the x-y pos.s if browser is NS
    mouseX = e.pageX
    mouseY = e.pageY
  }



  
  // catch possible negative values in NS4
  if (mouseX < 0){mouseX = 0}
  if (mouseY < 0){mouseY = 0}  

//window.status = window.event.x + " " + window.event.y + " "  + document.body.scrollLeft + " "  + document.body.scrollTop + " " + window.event.offsetX + " " + window.event.offsetY;

  return true
}


