
function GetId(id)
{
	return document.getElementById(id);
}
 
function move(e) {
  if(afficher) {
  
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}

	GetId("infoPeriodes").style.position="absolute";
	GetId("infoPeriodes").style.zIndex=1;
	GetId("infoPeriodes").style.left=posx - 145+"px";
	GetId("infoPeriodes").style.top=posy + 10+"px";
  }
}
 
function afficherBulle(dates) {
	if(couleurUn){
		GetId("infoPeriodes").style.backgroundColor='#efd7b5';
		couleurUn=false;
	} else {
		GetId("infoPeriodes").style.backgroundColor='#FFFFCC';
		couleurUn=true;
	}
	if(afficher==false) {
		GetId("infoPeriodes").style.visibility="visible";
		var texte="";
		if(dates.length % 2 == 0){
			var index;
			for(index = 0 ; index < dates.length ; index=index+2){
				texte+="Du "+ dates[index] + " au " + dates[index+1] + "<br/>";
			}
		}
		GetId("infoPeriodes").innerHTML = texte;
		afficher=true;
	}
}

function cacherBulle() {
	if(afficher==true) {
		GetId("infoPeriodes").style.visibility="hidden";
		afficher=false;
	}
}

/* Main */

var afficher=false;
var couleurUn = true;

document.onmousemove=move;

