/**
 *
 *
 * 
 * 
 **/

var mouseX, mouseY;
function getMousePos(p){
	// choppage des dimensions d'affichage
	/*var docWidth, docHeight;
	if (navigator.appName.indexOf('Microsoft') != -1) {
		if (document.documentElement && document.documentElement.clientHeight) { // ie6+
			docWidth = document.documentElement.clientWidth;
			docHeight = document.documentElement.clientHeight;
		}
		else { // ie4+
			docWidth = document.body.clientWidth;
			docHeight = document.body.clientHeight;
		}
	} else if (navigator.appName.indexOf('Netscape') != -1) {
		docWidth = window.innerWidth;
		docHeight = window.innerHeight;
	} else {
		docWidth = document.body.clientWidth;
		docHeight = document.body.clientHeight;
	}*/
	
	/*if (x+70+150 > docWidth) decal_x = docWidth-(x+70+150);
	if (y+20+150 > docHeight) decal_y = docHeight-(y+20+150);*/
	

	mouseX = (navigator.appName.substring(0,3) == "Net") ? p.pageX : event.x+document.body.scrollLeft;
	mouseY = (navigator.appName.substring(0,3) == "Net") ? p.pageY : event.y+document.body.scrollTop;
	decal_x = 15;
	decal_y = 20;
	if (document.getElementById("thumbBalloon").style.visibility == 'visible') {
		document.getElementById("thumbBalloon").style.left = (mouseX+decal_x)+'px';
		document.getElementById("thumbBalloon").style.top = (mouseY+decal_y)+'px';
	}
	if (window.isLoading) {
		document.getElementById("loadingDiv").style.left = (mouseX+decal_x)+'px';
		document.getElementById("loadingDiv").style.top = (mouseY+decal_y)+'px';
	}
}

// IE, cdpd
if(navigator.appName.substring(0,3) == "Net") document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePos;