// JavaScript Document
var valeur_origine =4;
var valeur = valeur_origine;
var x;
function Init(){
	document.getElementById('compteur').value=valeur;
	x = window.setInterval('Decompte()', 1000);
}
function Decompte(){
	if((valeur > 0)&&( ! window.document.getElementById('MaCheck').checked)) { 
		(document.getElementById('compteur').value = --valeur)
	}else{ 
		(window.clearInterval(x));
	}
	if (valeur==0){
		calque('rien');
	}
}
function Relance(){
	//valeur = valeur_origine;
	if( ! elem.checked ){
		x= window.setInterval('Decompte()', 1000);
	}
}
function ResetCompteur(){
	valeur = valeur_origine;
	//document.getElementById("menu2").style.display="inline";;
	window.clearInterval(x)
	Init();
}
function calque(name,calque){
	//alert("name:"+name+" --- calque:"+calque);
	if (calque!=""){
		ResetCompteur();
	}	
	if(name!="rien"){
		document.getElementById(name).style.display="inline";
	}else{
		document.getElementById("compo").style.display="none";
		//calque("rien","reset");
	}
}
/* Popup image centré + lien fermer */
function PopupImage(img) {
	titre="Agrandissement";
	w=open("popup-agrandissement.php?img="+img,"image","width=400,height=400,toolbar=no,scrollbars=no,resizable=no,top=0,left=0");
	w.document.close();
}
