var tempX = 0;
var tempY = 0;

function updateMousePos(event) {
	var e = event;
	
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		tempX = e.pageX;
		tempY = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		tempX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		tempY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
}

window.addEventListener("mousemove", updateMousePos, true);