// JavaScript Document
function test() 
{ 
  if (document.layers) getMouseLoc;     //NS 
  else if (document.all) getMouseLoc(); //IE 
  alert(mouseLocation.x+","+mouseLocation.y); 
} 

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; 
  } 
  else               //IE 
  { 
    mouseLocation.x = event.x + document.body.scrollLeft; 
    mouseLocation.y = event.y + document.body.scrollTop; 
  } 
  return true; 
} 
