function position(e) {
	xmouse = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
	ymouse = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
}

var monY = 0;

document.onmousemove = position;

var CacheDiv = 0;
	var t;

	function cacheAll(){
		for(i=0;i<32;i++) {
			if(document.getElementById("d"+i)) {
				document.getElementById("d"+i).style.display="none";
			}
		}
	}

	function afficher_info_cal(nomDiv){
		cacheAll();
		clearTimeout(t);
		y=ymouse-140 ;
		x=xmouse ;



		if(navigator.appName.substring(0,3) == "Net") {
			y=ymouse-140;
		} else {
			y=ymouse-120;
		}
		y = Math.round(y/10) * 10;

		if(monY ==0) {
			monY=y;
		}
		y=monY;

		document.getElementById(nomDiv).style.display="block";
		document.getElementById(nomDiv).style.left=x+"px";
		document.getElementById(nomDiv).style.top=y+"px";

	}
	function cacher_info_cal_timeout(nomDiv){
		CacheDiv = nomDiv;
		t=window.setTimeout(cacher_info_cal_f,1000);
	}

	function cacher_info_cal_f(){
		document.getElementById(CacheDiv).style.display="none";
	}
	
	function noCache(){
		clearTimeout(t);
	}
	
	
	function lancerCal(annee,mois) {
		lancer("calendrier.php?annee="+annee+"&mois="+mois,"calendrier")
	}
	function lancer(pageHTML,div){
		var xhr_object = null;


		if(window.XMLHttpRequest){ // Firefox
		   xhr_object = new XMLHttpRequest();
		} else if(window.ActiveXObject){ // Internet Explorer
		   xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		} else { // XMLHttpRequest non supporté par le navigateur
		   alert("Merci de télécharger un navigateur de dernière génération!");
		   return;
		}

		xhr_object.open("GET", pageHTML, true);
	 
		xhr_object.onreadystatechange = function() {
			if(xhr_object.readyState == 4) {
				document.getElementById(div).innerHTML = xhr_object.responseText;
			}
		}


		xhr_object.send(null);

	}
	
	function newsletter() {
		window.open("newsletter.php",'newsletter','top=10,left=10, location=no, width=400, height=200, menubar=no, status=no, scrollbar=no');
	}