if (window.event==null) { document.onmousemove = function (myEvent) { mousePosX = myEvent.pageX; mousePosY = myEvent.pageY; return true; } }