/*-------------------------------- SCRIPT POUR L'INTERACTIION DES PALMARÈS --------------------------------*/
var sourisX = 0;
var sourisY = 0;
function palmares_ouvre(id){
	gr = id.substr(6,1);
	palm = id.substr(8);
	document.getElementById("palm_"+gr+"_"+palm).style.top = sourisY + "px";
	document.getElementById("palm_"+gr+"_"+palm).style.left = (sourisX+8) + "px";
	document.getElementById("palm_"+gr+"_"+palm).style.visibility = 'visible';
}

function palmares_ferme(id){
	gr = id.substr(6,1);
	palm = id.substr(8);
	document.getElementById("palm_"+gr+"_"+palm).style.top = 0;
	document.getElementById("palm_"+gr+"_"+palm).style.left = 0;
	document.getElementById("palm_"+gr+"_"+palm).style.visibility = 'hidden';
}

document.onmousemove = mouseMove;

function mouseMove(ev){
	ev           = ev || window.event;
	var mousePos = mouseCoords(ev);
	sourisX = mousePos.x;
	sourisY = mousePos.y;
}

function mouseCoords(ev){
	if(ev.pageX || ev.pageY){
		return {x:ev.pageX, y:ev.pageY};
	}
	return {
		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		y:ev.clientY + document.body.scrollTop  - document.body.clientTop
	};
}

