включился мозг и появилось такое решение
var mouse ={
pos: function ()
{
var x, y,e;
e = event;
if (e.pageX == "null" && e.clientX != "null")
{
var scrollX, scrollY, body, html;
body = document.body;
html = document.documentElement;
scrollX = html.scrollLeft || body && body.scrollLeft || 0;
scrollY = html.scrollTop || body && body.scrollTop || 0;
x = e.clientX + scrollX - (html.clientLeft || body.clientLeft || 0);
y = e.clientY + scrollY - (html.clientTop || body.clientTop || 0);
}
else {
x = e.pageX;
y = e.pageY;
}
return {x : x , y: y}
},
x: function ()
{
return mouse.pos().x;
},
y: function ()
{
return mouse.pos().y;
}
};