// JavaScript Document

function popupcentree(page,largeur,hauteur,options)
{
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function CheckSondage() { 
  coche = false;
  LI = document.getElementById('sondage').getElementsByTagName('input');
  nLI = LI.length;
  for(i=0; i < nLI; i++){
    coche = coche || document.sondage.elements[i].checked;
    }
   if (!coche) {
      alert("Faites un choix avant de voter!"); 
      return false; 
   } else{
	   document.getElementById('sondage').vote1.disabled=true; 
	   return true; 
   }
} 

function CheckRecherche() { 
  coche = false;
  LI = document.getElementById('recherche').getElementsByTagName('input');
  nLI = LI.length;
  for(i=0; i < nLI; i++){
    coche = coche || document.recherche.elements[i].checked;
    }
   if (!coche) {
      alert("Faites un choix avant de lancer la recherche!"); 
      return false; 
   } else{
	   document.getElementById('recherche').rech1.disabled=true; 
	   return true; 
   }
} 

function CheckNewsletter(){
	if(document.newsletter.email.value == "") {
	   alert("Entrer un email valide!");
	   document.newsletter.email.focus();
	   return false;
   } else{
	   document.newsletter.news1.disabled=true; 
	   return true; 
   }
}

	function OnOff(type, id, int_on, int_off, act_on, act_off){
		switch(type){
			case "img":
				if(FindID(id).name==int_on){
					var tab_act_on = act_on.split('-');
					for(var i=0;i<tab_act_on.length;i++){
						setTimeout(tab_act_on[i], 0);
					}
					FindID(id).name = int_off;
					FindID(id).onClick = 'javascript:'+act_off;
					FindID(id).src = folder_img+int_off+'.gif';
				}else if(FindID(id).name==int_off){
					var tab_act_off = act_off.split('-');
					for(var i=0;i<tab_act_off.length;i++){
						setTimeout(tab_act_off[i], 0);
					}
					FindID(id).name = int_on;
					FindID(id).onClick = 'javascript:'+act_on;
					FindID(id).src = folder_img+int_on+'.gif';
				}
			break;
			case "txt":
				var reg3=new RegExp("(_)", "g");
				int_on=int_on.replace(reg3," ");
				int_off=int_off.replace(reg3," ");
				if(FindID(id).innerHTML==int_on){
					setTimeout(act_on, 0);
					FindID(id).innerHTML = int_off;
					FindID(id).onClick = 'javascript:'+act_off;
				}else if(FindID(id).innerHTML==int_off){
					setTimeout(act_off, 0);
					FindID(id).innerHTML = int_on;
					FindID(id).onClick = 'javascript:'+act_on;
				}
			break;
			
		}
	}
	
	function show(id){
		FindID(id).style.display = "block";
	}
	
	function hide(id){
		FindID(id).style.display = "none";
	}

	function FindID(id){
		if(document.layers) return document.layers[id];
		if(document.all && !document.getElementById) return document.all[id];
		if(document.all && document.getElementById) return document.getElementById(id);
		if(!document.all && document.getElementById) return document.getElementById(id);
	}

