	// Fonction qui verifie si un champ est vide
	function champVide(champ,libelle){
		 var mesg1 = "";
		 if(document.getElementById(champ).value==''){
			document.getElementById(champ).style.background="#FF9999";
			mesg1+= libelle+" est obligatoire \n\r";
		}else{
			document.getElementById(champ).style.background="#FFFFFF";
		}
		return mesg1;
	 }
	// Fonction qui verifie si un champ est vide
	function champDeuxCompare(champ1,champ2,libelle){
		var mesg2 = "";
		var v1 = document.getElementById(champ1).value;
		var v2 = document.getElementById(champ2).value;
		if(v1==v2){
				document.getElementById(champ1).style.background="#FFFFFF";
				document.getElementById(champ2).style.background="#FFFFFF";
		}else{
				document.getElementById(champ1).style.background="#FF9999";
				document.getElementById(champ2).style.background="#FF9999";
				mesg2+= libelle+" \n\r";
		}
		return mesg2;
	 }
	// Fonction qui verifie si un champ est vide
	function compareChampvaleur(champ, valeur, libelle){
		 var mesg3 = "";
		 var v1 = document.getElementById(champ).value;
		 if(v1==valeur){
			document.getElementById(champ).style.background="#FFFFFF";
		}else{
			document.getElementById(champ).style.background="#FF9999";
			mesg3+= libelle;
		}
		return mesg3;
	 }
	 // Fonction qui verifie si un champ est un numéro
	 function champNumber(champ,libelle){
		 var mesg4 = "";
		 if(isNaN(document.getElementById(champ).value)){
			document.getElementById(champ).style.background="#FF9999";
			mesg4+= libelle+" doit être un entier \n\r";
		}else{
			document.getElementById(champ).style.background="#FFFFFF";
		}
		return mesg4;
	 }
	 // Fonction qui verifie si un champ est un numéro
	 function champMaxCharacter(champ, libelle, nbmax){
		 var mesg5 = "";
		 if((document.getElementById(champ).value).length>nbmax){
			document.getElementById(champ).style.background="#FF9999";
			mesg5+= libelle+" ne doit pas dépasser "+nbmax+" caractère \n\r";
		}else{
			document.getElementById(champ).style.background="#FFFFFF";
		}
		return mesg5;
	 }
	// Fonction qui verifie l'extention d'un champ
	function verifExtention(){
		  var mesg6 = "";
		  var path = document.frm_inscription.photo.value;
		  var extnum = path.length - 3;
		  var check = path.substr(extnum,3);
		  if(path!=""){
			  if(!(check=="jpg") && !(check=="jpeg") && !(check=="JPEG") && !(check=="JPG") ){
				document.getElementById("photo").style.background='#FF9999';
				mesg6+= " - Ce n'est pas une image jpg \n\r";
				
			  }else{
				document.getElementById("photo").style.background='#FFFFFF';
			  }
		  }
		  return mesg6;
	 }
	 // Fonction qui verifie l@ e-mail.
	 function mailValide(champ){
		var mesg7 = "";
		if (document.getElementById(champ).value!=""){
			adresse = document.getElementById(champ).value;
			var place = adresse.indexOf("@",1);
			var point = adresse.indexOf(".",place+1);
			if ((place <= -1)||(adresse.length <=2)||(point <= 1)){
				document.getElementById(champ).style.background='#FF9999';
				mesg7+= ' - Adresse mail non valide\n';
			}else{
				document.getElementById(champ).style.background='#FFFFFF';
			}
		}	
		 return mesg7;
	}
	// Fonction utlisé pour des requette Ajax.
	function sendData(param, page,zone){	
		if(document.all){
			var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}else{
			var XhrObj = new XMLHttpRequest();
		}//fin else
		var content = document.getElementById(zone);
		XhrObj.open("POST", page);
		XhrObj.onreadystatechange = function(){
			if (XhrObj.readyState == 4 && XhrObj.status == 200){
				content.innerHTML = XhrObj.responseText ;
			}else{
				content.innerHTML = "<div align='center'><img src='image/gif/chargement.gif' align='absmiddle'> </div>"; 
			}
		}
		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(param);
	}
	//
	function sendDataMetier(param, page,zone){
		if(document.all){
			var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}else{
			var XhrObj = new XMLHttpRequest();
		}//fin else
		var content = document.getElementById(zone);
		XhrObj.open("POST", page);
		XhrObj.onreadystatechange = function(){
			if (XhrObj.readyState == 4 && XhrObj.status == 200){
				content.innerHTML = XhrObj.responseText ;
			}else{
				content.innerHTML = "<div align='center' style='padding-top:80px;height:200px;'><img src='image/gif/chargement.gif' align='absmiddle'></div>"; 
			}
		}
		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(param);
	}
	function switchMenu(obj,icone){
		var el = document.getElementById(obj);
		var icone = document.getElementById(icone);
		if(el.style.display != "block"){
			el.style.display = "block";	
			icone.src 		 = "image/gif/collapse.gif";	
		}else{
			el.style.display = "none";
			icone.src 		 = "image/gif/expand.gif";	
		}
	}
	//
	function switchMenuSansIcone(obj){
		var el = document.getElementById(obj);
		if(el.style.display != "block"){
			el.style.display = "block";	
	
		}else{
			el.style.display = "none";
		}
	}
	/**
	*
	*
	*
	*/
	function verifNewsletter(){
		var mesg = '';	
		mesg +=mailValide("email");
		if(mesg==''){
			return true;	
		}else{
			alert(mesg);
			return false;
		}
	}
	/**
	*
	*
	*
	*/
	function checkMetier2(formulaire, champ, indice, nb_max){
		if(!nb_max){
			nb_max = 500;
		}
		eval("var actif"+champ+"="+document.getElementById('nbr_'+champ).value);
		
			if(eval("document."+formulaire+"."+champ+"_"+indice+".checked")== true)
			{
				
				if(document.getElementById('nbr_'+champ).value < parseInt(nb_max)){ // Si nombre maximale non atteind
					document.getElementById('td_'+champ+indice).style.background='#C9DEEA';
					eval("actif"+champ+"++");
				}else{
					alert(" Vous pouvez choisir "+nb_max+" metier au maximum !");
					eval("document."+formulaire+"."+champ+"_"+indice+".checked = ''")
					return false;
				}
			}
			else{
				document.getElementById('td_'+champ+indice).style.background='#FFFFFF';
				if(eval("actif"+champ+">0")){
					eval("actif"+champ+"--");
				}
			}
			document.getElementById('nbr_'+champ).value = eval("actif"+champ);

			
			if(document.getElementById('nbr_'+champ).value<=0){
				document.getElementById('text_'+champ).innerHTML='&nbsp;Tous les métiers';
			}else if(document.getElementById('nbr_'+champ).value==1){
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+eval("actif"+champ)+' métier sélectionné';
			}else{
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+eval("actif"+champ)+' métiers sélectionnés';
			}
		
	}
	
	
	function checkMetier(formulaire, champ, indice, nb_max){
		
		if(!nb_max){
			nb_max = 500;
		}
		eval("var actif"+champ+"="+document.getElementById('nbr_'+champ).value);
			if(eval("document."+formulaire+"."+champ+"["+indice+"].checked")== true)
			{
				if(document.getElementById('nbr_'+champ).value < parseInt(nb_max)){ // Si nombre maximale non atteind
					document.getElementById('td_'+champ+indice).style.background='#C9DEEA';
					eval("actif"+champ+"++");
				}else{
					alert(" Vous pouvez choisir "+nb_max+" metier au maximum !");
					eval("document."+formulaire+"."+champ+"["+indice+"].checked = ''")
					return false;
				}
			}
			else{
				document.getElementById('td_'+champ+indice).style.background='#FFFFFF';
				if(eval("actif"+champ+">0")){
					eval("actif"+champ+"--");
				}
			}
			document.getElementById('nbr_'+champ).value = eval("actif"+champ);
			if(document.getElementById('nbr_'+champ).value<=0){
				document.getElementById('text_'+champ).innerHTML='&nbsp;Tous les métiers';
			}else if(document.getElementById('nbr_'+champ).value==1){
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+eval("actif"+champ)+' métier sélectionné';
			}else{
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+eval("actif"+champ)+' métiers sélectionnés';
			}
		
	}
	function checkSousMetier(formulaire, champ, indice, nb_max){
		
		if(!nb_max){
			nb_max = 500;
		}
		
		
	}
	/**
	*
	*
	*
	*/
	function checkNbChecked(champ, nb_max, indice){
		if(document.getElementById('nbr_'+champ).value >=5){
			
			
		}
	}
	/**
	*
	*
	*
	*/
	function verifChekced(champ, libelle){
		if(document.getElementById(champ).checked==false){
			return	libelle;
		}
		else
			return '';
	}
	/**
	*
	*
	*
	*/
	function validCheck(formulaire, champ){
		var j=0;
		for (i=0; i < eval("document."+formulaire+"."+champ+".length"); i++) {
			if(eval("document."+formulaire+"."+champ+"["+i+"].checked")== true){
				j++;	
			}
		}	
		if(j==0){
			return false;
		}
		else{
			return true;
		}
	}
	/**
	* Cette fonction permet de cocher et décochez une liste de case à cocher a partir d'une case.
	*
	*
	*/
	function cochez(formulaire, check_pere, check_fils, debut, fin){
		eval("var actif"+check_fils+"="+document.getElementById('nbr_'+check_fils).value);
		if(eval("document."+formulaire+"."+check_pere+".checked") == true){
			for (i= parseInt(debut); i < parseInt(fin); i++) {
				if(eval("document."+formulaire+"."+check_fils+"["+i+"].checked == false")){
					eval("actif"+check_fils+"++");
					document.getElementById('text_'+check_fils).innerHTML="&nbsp;"+eval("actif"+check_fils)+' métiers sélectionnés';
					eval("document."+formulaire+"."+check_fils+"["+i+"].checked = true");
					document.getElementById('td_'+check_fils+i).style.background='#C9DEEA';
				}
			}
		}
		if(eval("document."+formulaire+"."+check_pere+".checked") == false){
			for (i= parseInt(debut); i < parseInt(fin); i++) {
				if(eval("document."+formulaire+"."+check_fils+"["+i+"].checked == true")){
					eval("document."+formulaire+"."+check_fils+"["+i+"].checked = false");
					eval("actif"+check_fils+"--");
					document.getElementById('text_'+check_fils).innerHTML="&nbsp;"+eval("actif"+check_fils)+' métiers sélectionnés';
					document.getElementById('td_'+check_fils+i).style.background='#FFFFFF';
				}
			}
		}
		document.getElementById('nbr_'+check_fils).value = eval("actif"+check_fils);
	}
