/*
	SPDN
	12 February 2008 (amended)
	
	mouse functions for services map
*/

// associate the mousemove event with a function
document.onmousemove = mouseMove;

// get and return the mouse coords
function mouseCoords(ev){
	if (ev.pageX || ev.pageY) 	{
		posx = ev.pageX;
		posy = ev.pageY;
	}
	else if (ev.clientX || ev.clientY) 	{
		posx = ev.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		posy = ev.clientY + document.body.scrollTop	+ document.documentElement.scrollTop;
	}
	return {x:posx, y:posy}
}

// update the coords when the mouse moves (and move the preview DIV with it)
function mouseMove(ev){
	ev           = ev || window.event;
	var mousePos = mouseCoords(ev);

	var the_ghost = document.getElementById('drag_ghost');
	//the_ghost.style.display = 'block';
	the_ghost.style.position = 'absolute';
	the_ghost.style.top      = (mousePos.y + 10) + 'px';
	the_ghost.style.left     = (mousePos.x + 10) + 'px';
}

