	// 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 numero
	 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 numero
	 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 depasser "+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 utlise 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/expand.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 checkMetier(formulaire, champ, indice, nb_max){
		
		if(!nb_max){
			nb_max = 800;
		}
		
		eval("var actif"+champ+"="+document.getElementById('nbr_'+champ).value);
			if(eval("document."+formulaire+"."+champ+"["+indice+"].checked")== true)
			{
				
				if(document.getElementById('nbr_'+champ).value < nb_max+1){ // 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<=1){
				document.getElementById('text_'+champ).innerHTML='&nbsp;Selectionner 8 metiers max';
			}else if(document.getElementById('nbr_'+champ).value==2){
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+'1 metier selectionne';
			}else{
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+((document.getElementById('nbr_'+champ).value)-1)+' metiers selectionnes';
			}
		
	}


       function checkMetier2(formulaire, champ, indice, nb_max){
		
		if(!nb_max){
			nb_max = 800;
		}
		
		eval("var actif"+champ+"="+document.getElementById('nbr_'+champ).value);
			if(eval("document."+formulaire+"."+champ+"["+indice+"].checked")== true)
			{
				
				if(document.getElementById('nbr_'+champ).value < nb_max+1){ // Si nombre maximale non atteind
					document.getElementById('td_'+champ+indice).style.background='#C9DEEA';
					eval("actif"+champ+"++");
				}else{
					alert(" Vous pouvez choisir "+nb_max+" regions 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<=1){
				document.getElementById('text_'+champ).innerHTML='&nbsp;S&#233;l&#233;ctionner 5 r&#233;gions max';
			}else if(document.getElementById('nbr_'+champ).value==2){
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+'1 r&#233;gion s&#233;lectionn&#233;';
			}else{
				document.getElementById('text_'+champ).innerHTML="&nbsp;"+((document.getElementById('nbr_'+champ).value)-1)+' r&#233;gions s&#233;lectionn&#233;s';
			}
		
	}
	/**
	*
	*
	*
	*/
	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;
		}
	}
