function RenouvellementInscriptionV2(){
	
 	
	
	for (var i=0; i<document.forms['formInscription'].offre.length;i++) {
		if (document.forms['formInscription'].offre[i].checked) {
			
			if(document.forms['formInscription'].offre[i].value == "0"){
				// Ogratuite
				document.forms['formInscription'].action = "valider-inscription-gratuite-renew.php";
			}else{
				// OPayant
				
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					if (document.forms['formInscription'].mode_paiement[i].checked) {
						if(document.forms['formInscription'].mode_paiement[i].value == "0"){
							//cheque
							document.forms['formInscription'].action = "valider-inscription-cheque-renew.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "1"){
							//CB // ok
							document.forms['formInscription'].action = "valider-inscription-cb-renew.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "2"){
							//Virement
							document.forms['formInscription'].action = "valider-inscription-virement-renew.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "3"){
							//Gratuit
							document.forms['formInscription'].action = "valider-inscription-gratuite-renew.php";
						}
					}
				}
			}
			
		}
	}
 	
 	
	if( AllTrim(document.forms['formInscription'].captcha_code.value) == "") {
		alert ("Merci de vérifier le code sécurité saisi");
		//alert("val saisi : "+document.forms['FormInternaute'].resultCheck.value +"\r\n"+document.forms['FormInternaute'].pingpong.value );
		document.forms['formInscription'].captcha_code.focus();
		return false;
	}
	
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
															  
 
	
	// recap user
	var LibOffre = "";
	var LibPaie = "";
	
	for (var i=0; i<document.forms['formInscription'].offre.length;i++) {
		if (document.forms['formInscription'].offre[i].checked) {
			
			if(document.forms['formInscription'].offre[i].value == "0"){
				// Ogratuite
				LibOffre = "offre gratuite";
				LibPaie = "offre gratuite, vous pourrez a tout moment passer en offre payante depuis votre espace professionnel";
			}else{
				// OPayant
				LibOffre = "offre EXCELLENCE";
				
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					if (document.forms['formInscription'].mode_paiement[i].checked) {
						if(document.forms['formInscription'].mode_paiement[i].value == "0"){
							LibPaie = "paiement par cheque";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "1"){
							LibPaie = "paiement par carte bancaire";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "2"){
							LibPaie = "paiement par virement bancaire";
						}
					
					}
				}
			}
			
		}
	}
	
	
	
	if(confirm("Vous etes sur le point de renouveller votre inscription et souscrire a l'"+LibOffre+".\r\n\r\nVous avez opté pour le mode de paiement : "+LibPaie+"\r\n\r\nContinuer et valider votre renouvellement  ?")){
		// on valide
		//alert("act : "+document.forms['formInscription'].action);
		return true;
		
	}else{
		alert("Opération annulée");
		return false;
	}

}






















function CheckedOffrePaiement(){
	///start control
	for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
		if (document.forms['formInscription'].mode_paiement[i].checked) {
			
			if(document.forms['formInscription'].mode_paiement[i].value == "3"){
				 document.forms['formInscription'].offre[1].checked = false;
				document.forms['formInscription'].offre[0].checked = true;
				 
			 
			}else{
				// OPayant
				document.forms['formInscription'].offre[1].checked = true;
				 document.forms['formInscription'].offre[0].checked = false;
			}
			
		}
	}
}



function CheckedOffreMode(){
	///start control
	for (var i=0; i<document.forms['formInscription'].offre.length;i++) {
		if (document.forms['formInscription'].offre[i].checked) {
			
			if(document.forms['formInscription'].offre[i].value == "0"){
				// Ogratuite
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					
					if(document.forms['formInscription'].mode_paiement[i].value == "3"){
						//Gratuit
						document.forms['formInscription'].mode_paiement[i].checked = true;
					}else{
						document.forms['formInscription'].mode_paiement[i].checked = false;
					}
				}
			}else{
				// OPayant
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					
					if(document.forms['formInscription'].mode_paiement[i].value != "1"){
						//Gratuit
						document.forms['formInscription'].mode_paiement[i].checked = false;
					}else{
						document.forms['formInscription'].mode_paiement[i].checked = true;
					}
				}
			}
			
		}
	}
}










function InscriptionV2(){
	
 	
	
	for (var i=0; i<document.forms['formInscription'].offre.length;i++) {
		if (document.forms['formInscription'].offre[i].checked) {
			
			if(document.forms['formInscription'].offre[i].value == "0"){
				// Ogratuite
				document.forms['formInscription'].action = "valider-inscription-gratuite.php";
			}else{
				// OPayant
				
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					if (document.forms['formInscription'].mode_paiement[i].checked) {
						if(document.forms['formInscription'].mode_paiement[i].value == "0"){
							//cheque
							document.forms['formInscription'].action = "valider-inscription-cheque.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "1"){
							//CB // ok
							document.forms['formInscription'].action = "valider-inscription-cb.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "2"){
							//Virement
							document.forms['formInscription'].action = "valider-inscription-virement.php";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "3"){
							//Gratuit
							document.forms['formInscription'].action = "valider-inscription-gratuite.php";
						}
					}
				}
			}
			
		}
	}
 	
	if(AllTrim(document.forms['formInscription'].nom.value) == ""){
		alert("Le champ NOM est obligatoire, merci");
		document.forms['formInscription'].nom.focus();
		return false;
	}
	
	
	
	if(AllTrim(document.forms['formInscription'].prenom.value) == ""){
		alert("Le champ PRENOM est obligatoire, merci");
		document.forms['formInscription'].prenom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) == ""){
		alert("Le champ EMAIL est obligatoire, merci");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['formInscription'].email.value)){
		alert("Le champ EMAIL n'a pas un format valide");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) != AllTrim(document.forms['formInscription'].email2.value)){
		alert("Les champs EMAIL ne sont pas identiques");
		document.forms['formInscription'].email2.value = "";
		document.forms['formInscription'].email2.focus();
		return false;
	}
	
	
	if(AllTrim(document.forms['formInscription'].libelle_etab.value) == ""){
		alert("Le champ NOM DE L'ETABLISSEMENT est obligatoire, merci");
		document.forms['formInscription'].libelle_etab.focus();
		return false;
	}
	
	if( AllTrim(document.forms['formInscription'].captcha_code.value) == "") {
		alert ("Merci de vérifier le code sécurité saisi");
		//alert("val saisi : "+document.forms['FormInternaute'].resultCheck.value +"\r\n"+document.forms['FormInternaute'].pingpong.value );
		document.forms['formInscription'].captcha_code.focus();
		return false;
	}
	
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
															  
 
	
	// recap user
	var LibOffre = "";
	var LibPaie = "";
	
	for (var i=0; i<document.forms['formInscription'].offre.length;i++) {
		if (document.forms['formInscription'].offre[i].checked) {
			
			if(document.forms['formInscription'].offre[i].value == "0"){
				// Ogratuite
				LibOffre = "offre gratuite";
				LibPaie = "offre gratuite, vous pourrez a tout moment passer en offre payante depuis votre espace professionnel";
			}else{
				// OPayant
				LibOffre = "offre EXCELLENCE";
				
				for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
					if (document.forms['formInscription'].mode_paiement[i].checked) {
						if(document.forms['formInscription'].mode_paiement[i].value == "0"){
							LibPaie = "paiement par cheque";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "1"){
							LibPaie = "paiement par carte bancaire";
						}
						if(document.forms['formInscription'].mode_paiement[i].value == "2"){
							LibPaie = "paiement par virement bancaire";
						}
					
					}
				}
			}
			
		}
	}
	
	
	
	if(confirm("Vous etes sur le point de vous inscire a l'"+LibOffre+".\r\n\r\nVous avez opté pour le mode de paiement : "+LibPaie+"\r\n\r\nContinuer et valider votre inscription ?")){
		// on valide
		//alert("act : "+document.forms['formInscription'].action);
		return true;
		
	}else{
		alert("Opération annulée");
		return false;
	}

}


















function ValidFormDemandeAlerte(){
	
 
	
	if(AllTrim(document.forms['FormInternaute'].nom.value) == ""){
		alert("Merci de préciser votre nom");
		document.forms['FormInternaute'].nom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].email.value) == ""){
		alert("Merci de préciser votre adresse e-mail");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['FormInternaute'].email.value)  ){
		alert("Merci de vérifier votre adresse e-mail, celle-ci n'a pas un format valide");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].email.value) != AllTrim(document.forms['FormInternaute'].email2.value)){
		alert("Attention les deux adresses e-mail ne sont pas identique ");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].dpt1.value) == "0"){
		alert("Merci de préciser au moins un département de recherche");
		document.forms['FormInternaute'].dpt1.focus();
		return false;
	}
	
	 
	
	if(AllTrim(document.forms['FormInternaute'].client_nom.value) == ""){
		alert("Merci de préciser le nom de la personne concernée par la recherche");
		document.forms['FormInternaute'].client_nom.focus();
		return false;
	}
	if(AllTrim(document.forms['FormInternaute'].client_age.value) == ""){
		alert("Merci de préciser l'age de la personne concernée par la recherche");
		document.forms['FormInternaute'].client_age.focus();
		return false;
	}
	
	if(document.forms['FormInternaute'].budget_mensuel.value == 0){
		alert("Merci de préciser le budget mensuel de la recherche");
		document.forms['FormInternaute'].budget_mensuel.focus();
		return false;
	}
	
	if( AllTrim(document.forms['FormInternaute'].captcha_code.value) == "") {
		alert ("merci de vérifier le code sécurité saisi");
		//alert("val saisi : "+document.forms['FormInternaute'].resultCheck.value +"\r\n"+document.forms['FormInternaute'].pingpong.value );
		document.forms['FormInternaute'].captcha_code.focus();
		return false;
	}

	alert("Merci.\r\nUn e-mail récapitulatif de votre demande va vous être envoyé dans quelques instants");
     
	return true;
}


function ValidForm(){
	if(AllTrim(document.forms['FormInternaute'].nom.value) == ""){
		alert("Merci de préciser votre nom");
		document.forms['FormInternaute'].nom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].email.value) == ""){
		alert("Merci de préciser votre adresse e-mail");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['FormInternaute'].email.value)  ){
		alert("Merci de vérifier votre adresse e-mail, celle-ci n'a pas un format valide");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].email.value) != AllTrim(document.forms['FormInternaute'].email2.value)){
		alert("Attention les deux adresses e-mail ne sont pas identique ");
		document.forms['FormInternaute'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormInternaute'].dpt1.value) == "0"){
		alert("Merci de préciser au moins un département de recherche");
		document.forms['FormInternaute'].dpt1.focus();
		return false;
	}
	
	 
	
	if(AllTrim(document.forms['FormInternaute'].client_nom.value) == ""){
		alert("Merci de préciser le nom de la personne concernée par la recherche");
		document.forms['FormInternaute'].client_nom.focus();
		return false;
	}
	if(AllTrim(document.forms['FormInternaute'].client_age.value) == ""){
		alert("Merci de préciser l'age de la personne concernée par la recherche");
		document.forms['FormInternaute'].client_age.focus();
		return false;
	}
	
	if(document.forms['FormInternaute'].budget_mensuel.value == 0){
		alert("Merci de préciser le budget mensuel de la recherche");
		document.forms['FormInternaute'].budget_mensuel.focus();
		return false;
	}

	alert("Merci.\r\nUn e-mail récapitulatif de votre demande va vous être envoyé dans quelques instants");
	return true;
}


function SearchCpCkeck(){
	
	if(AllTrim(document.forms['FormCpSearch'].cpSearch.value) == "" || !IsCp(document.forms['FormCpSearch'].cpSearch.value)){
		alert("merci de saisir un code postal valide");
		document.forms['FormCpSearch'].cpSearch.focus();
		return;
	}
	document.forms['FormCpSearch'].submit();
}


function SearchCp(){

	if(AllTrim(document.forms['FormCpSearch'].cpSearch.value) == "" || !IsCp(document.forms['FormCpSearch'].cpSearch.value)){
		alert("merci de saisir un code postal valide");
		document.forms['FormCpSearch'].cpSearch.focus();
		return false;
	}
	return true;
	
}

function IsCp(sText)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;
	
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			 IsNumber = false;
		}
	}
		  
	  
	return IsNumber;
}



function SendPage(lapage){
	alert(lapage+" va être envoyée");
}


function BookmarkThis() {
	if ( navigator.appName != 'Microsoft Internet Explorer' ){ 
		window.sidebar.addPanel("Seniorys : Disponibilité en maison de retraite","http://www.seniorys.com","");
	}else { 
		window.external.AddFavorite("http://www.seniorys.com","Seniorys : Disponibilité en maison de retraite"); 
	} 
} 


function ValidPaie(){
	
	var montant = document.forms['FormPaiement'].montant.value;
	var reference = document.forms['FormPaiement'].reference.value;
	var email = document.forms['FormPaiement'].email.value;
	var langue = document.forms['FormPaiement'].langue.value;
	var moyen = document.forms['FormPaiement'].moyen.value;
	var modalite = document.forms['FormPaiement'].modalite.value;
	var urlretour = document.forms['FormPaiement'].urlretour.value;
	
	document.location.href="http://kits.spplus.net/cgi-2008/hmac_ibk.exe?montant="+montant+"&reference="+reference+"&email="+email+"&langue="+langue+"&moyen="+moyen+"&modalite="+modalite+"&urlretour="+urlretour;
}











function InscriptionGratuite(){
	
	
	 
	document.forms['formInscription'].action = "valider-inscription-gratuite.php?etat=1";
 	
	if(AllTrim(document.forms['formInscription'].nom.value) == ""){
		alert("Le champ NOM est obligatoire, merci");
		document.forms['formInscription'].nom.focus();
		return false;
	}
	
	
	
	if(AllTrim(document.forms['formInscription'].prenom.value) == ""){
		alert("Le champ PRENOM est obligatoire, merci");
		document.forms['formInscription'].prenom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) == ""){
		alert("Le champ EMAIL est obligatoire, merci");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['formInscription'].email.value)){
		alert("Le champ EMAIL n'a pas un format valide");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) != AllTrim(document.forms['formInscription'].email2.value)){
		alert("Les champs EMAIL ne sont pas identiques");
		document.forms['formInscription'].email2.value = "";
		document.forms['formInscription'].email2.focus();
		return false;
	}
	
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
															  
 
	
	
	
	return true;
	
}



function InscriptionOffreSalon(){
	
	
 
 	
	if(AllTrim(document.forms['formInscription'].nom.value) == ""){
		alert("Le champ NOM est obligatoire, merci");
		document.forms['formInscription'].nom.focus();
		return false;
	}
	
	
	
	if(AllTrim(document.forms['formInscription'].prenom.value) == ""){
		alert("Le champ PRENOM est obligatoire, merci");
		document.forms['formInscription'].prenom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) == ""){
		alert("Le champ EMAIL est obligatoire, merci");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['formInscription'].email.value)){
		alert("Le champ EMAIL n'a pas un format valide");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) != AllTrim(document.forms['formInscription'].email2.value)){
		alert("Les champs EMAIL ne sont pas identiques");
		document.forms['formInscription'].email2.value = "";
		document.forms['formInscription'].email2.focus();
		return false;
	}
	
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
															  
 
	
	
	
	return true;
	
}















function Renouvellement(){
 	 
  for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
	 if (document.forms['formInscription'].mode_paiement[i].checked) {
		
		if(document.forms['formInscription'].mode_paiement[i].value == "0"){
			document.forms['formInscription'].action = "paiement-cheque-renouvellement.php?etat=1";
		}else{
			document.forms['formInscription'].action = "valider-inscription-renouvellement.php";
		}
	 
	 }
  }
 	
	if(AllTrim(document.forms['formInscription'].nom.value) == ""){
		alert("Le champ NOM est obligatoire, merci");
		document.forms['formInscription'].nom.focus();
		return false;
	}
	
	
	
	if(AllTrim(document.forms['formInscription'].prenom.value) == ""){
		alert("Le champ PRENOM est obligatoire, merci");
		document.forms['formInscription'].prenom.focus();
		return false;
	}
	/*
	if(AllTrim(document.forms['formInscription'].email.value) == ""){
		alert("Le champ EMAIL est obligatoire, merci");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['formInscription'].email.value)){
		alert("Le champ EMAIL n'a pas un format valide");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) != AllTrim(document.forms['formInscription'].email2.value)){
		alert("Les champs EMAIL ne sont pas identiques");
		document.forms['formInscription'].email2.value = "";
		document.forms['formInscription'].email2.focus();
		return false;
	}
	*/
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
 	
	
	return true;
	
}
























function Inscription(){
	
	
	 
  for (var i=0; i<document.forms['formInscription'].mode_paiement.length;i++) {
	 if (document.forms['formInscription'].mode_paiement[i].checked) {
		
		if(document.forms['formInscription'].mode_paiement[i].value == "0"){
			document.forms['formInscription'].action = "paiement-cheque.php?etat=1";
		}else{
			document.forms['formInscription'].action = "valider-inscription.php";
		}
	 
	 }
  }
 	
	if(AllTrim(document.forms['formInscription'].nom.value) == ""){
		alert("Le champ NOM est obligatoire, merci");
		document.forms['formInscription'].nom.focus();
		return false;
	}
	
	
	
	if(AllTrim(document.forms['formInscription'].prenom.value) == ""){
		alert("Le champ PRENOM est obligatoire, merci");
		document.forms['formInscription'].prenom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) == ""){
		alert("Le champ EMAIL est obligatoire, merci");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(!goodmail(document.forms['formInscription'].email.value)){
		alert("Le champ EMAIL n'a pas un format valide");
		document.forms['formInscription'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formInscription'].email.value) != AllTrim(document.forms['formInscription'].email2.value)){
		alert("Les champs EMAIL ne sont pas identiques");
		document.forms['formInscription'].email2.value = "";
		document.forms['formInscription'].email2.focus();
		return false;
	}
	
	if(document.forms['formInscription'].cgv.checked == false){
		alert("Vous devez accepter les C.G.V pour pouvoir procéder à votre inscription sur le site");
		return false;
	}
															  
	
	/*
	if(AllTrim(document.forms['formInscription'].passwd.value) == ""){
		alert("Le champ MOT DE PASSE est obligatoire, merci");
		document.forms['formInscription'].passwd.focus();
		return false;
	}
	if(AllTrim(document.forms['formInscription'].passwd.value) != AllTrim(document.forms['formInscription'].passwd2.value)){
		alert("Les champs MOT DE PASSE ne sont pas identiques");
		document.forms['formInscription'].passwd2.value = "";
		document.forms['formInscription'].passwd2.focus();
		return false;
	}
	*/
	
	
	
	return true;
	
}


function getDpt(dpt){
	for(i=0;i<document.forms['formSearchEtab'].dpt1.length;++i){
	  if(document.forms['formSearchEtab'].dpt1.options[i].value == dpt)
		document.forms['formSearchEtab'].dpt1.options[i].selected = true;
	  }
	  
	 ResultSearch();
}



function toutCocher(){
	for (i=0; i<document.forms['formSearchJob'].elements['id_type_poste[]'].length; i++) {
		   document.forms['formSearchJob'].elements['id_type_poste[]'][i].checked = true;
			 
		  
	   }
}




function noaccent(chaine) {
		
		var temp;
		temp ="";

      temp = chaine.replace(/[àâä]/gi,"a")

      temp = temp.replace(/[éèêë]/gi,"e")

      temp = temp.replace(/[îï]/gi,"i")

      temp = temp.replace(/[ôö]/gi,"o")

      temp = temp.replace(/[ùûü]/gi,"u")

	  temp = temp.replace(/[,.;!?]/gi,"")
	  

	  temp = temp.replace(/([0-9])/gi,"");
	  temp = temp.replace(/([ '])/gi,",");
	  temp = temp.replace(/([-])/gi,"|");
	//  temp = temp.replace(/([^a-z])/gi,"");
		
      temp = AllTrim(temp);

 

	  return temp;

}






function ResultSearch(){
	
	
	
	var StrUrl = "";
	
	
	var SIndex = document.forms['formSearchEtab'].dpt1.selectedIndex;
	var LibIndex = document.forms['formSearchEtab'].dpt1.options[SIndex].text;
	
	var libDpt = "";
	libDpt = LibIndex.substring(4, LibIndex.length);
	
	 libDpt = AllTrim(libDpt);
	
	libDpt = libDpt.replace(/[aâä]/gi,"a")
 	libDpt = libDpt.replace(/[éeêë]/gi,"e")
	libDpt = libDpt.replace(/[îi]/gi,"i")
	libDpt = libDpt.replace(/[ôö]/gi,"o")
	libDpt = libDpt.replace(/[ùûü]/gi,"u")
	libDpt = libDpt.replace(/([^a-z])/gi,"-");
	libDpt = libDpt.replace(/([ ])/gi,"-");
	
	StrUrl += "maison-de-retraite-";
	StrUrl +=  (AllTrim(libDpt.toLowerCase()))+"-";
	StrUrl += noaccent(document.forms['formSearchEtab'].libelle.value)+"-";
	StrUrl += noaccent(document.forms['formSearchEtab'].ville.value)+"-";
	StrUrl += AllTrim(document.forms['formSearchEtab'].dpt1.value)+"-";
	StrUrl += "0.html";
	
	document.location.href = StrUrl;
//	return false;
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}

function IdentPro(){
	if(AllTrim(document.forms['formPro'].login.value) ==""){
		alert("Merci de saisir votre identifiant de connexion");
		document.forms['formPro'].login.focus();
		return false;
	}else if (!goodmail(document.forms['formPro'].login.value)){
		alert("Votre identifiant de connexion est votre adresse e-mail.\r\nMerci de vérifier l'information saisie");
		document.forms['formPro'].login.focus();
		return false;
	}
	
	if(AllTrim(document.forms['formPro'].passwd.value) ==""){
		alert("Merci de saisir votre mot de passe de connexion");
		document.forms['formPro'].passwd.focus();
		return false;
	}
	
	return true;
}

function ValidCandidature(){
	//FormCand
 
 	if(AllTrim(document.forms['FormCand'].nom.value) == ""){
		alert("Merci de préciser votre nom");
		document.forms['FormCand'].nom.focus();
		return false;
	}	
 
 	if(AllTrim(document.forms['FormCand'].prenom.value) == ""){
		alert("Merci de préciser votre prénom");
		document.forms['FormCand'].prenom.focus();
		return false;
	}	
	if(AllTrim(document.forms['FormCand'].rue.value) == ""){
		alert("Merci de préciser votre rue");
		document.forms['FormCand'].rue.focus();
		return false;
	}
	if(AllTrim(document.forms['FormCand'].cp.value) == ""){
		alert("Merci de préciser votre code postal");
		document.forms['FormCand'].cp.focus();
		return false;
	}
	if(AllTrim(document.forms['FormCand'].ville.value) == ""){
		alert("Merci de préciser votre ville");
		document.forms['FormCand'].ville.focus();
		return false;
	}
	/*
	if(AllTrim(document.forms['FormCand'].date_naiss.value) == ""){
		alert("Merci de préciser votre date de naissance");
		document.forms['FormCand'].date_naiss.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormCand'].situation_fami.value) == ""){
		alert("Merci de préciser votre situation de famille");
		document.forms['FormCand'].situation_fami.focus();
		return false;
	}*/
	if(AllTrim(document.forms['FormCand'].tel.value) == ""){
		alert("Merci de préciser votre numéro de téléphone");
		document.forms['FormCand'].tel.focus();
		return false;
	}
	
	
	
 
	if(AllTrim(document.forms['FormCand'].email.value) == ""){
		alert("Merci de spécifier votre adresse email");
		document.forms['FormCand'].email.focus();
		return false;
	}else{
		if(!goodmail(document.forms['FormCand'].email.value)){
			alert("Votre adresse email n'a pas un format valide");
			document.forms['FormCand'].email.focus();
			return false;
		}
	}
	
	
	if(AllTrim(document.forms['FormCand'].form1_deb.value) == "" || AllTrim(document.forms['FormCand'].form1_fin.value) == "" || AllTrim(document.forms['FormCand'].form1_ecole.value) == "" || AllTrim(document.forms['FormCand'].form1_dipl.value) == ""   ){
		alert("Merci de préciser au moins une de vos formations");
		document.forms['FormCand'].form1_deb.focus();
		return false;
	}

	 return true;
	
}

function AffOffre(id){
	PopupCentrer('candidature.php?ida='+id,695,660,'resizable=yes, location=no, menubar=yes, status=no, scrollbars=yes');
}

function PopupCentrer(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 CheckOffreEmploi(){
	for (i=0; i<document.forms['formSearchJob'].elements['id_type_poste[]'].length; i++) {
      if(document.forms['formSearchJob'].elements['id_type_poste[]'][i].checked) {
         return true;
      }
   }
   alert ("Vous devez sélectionner au moins un métier pour effectuer une recherche");
   return false;

}





function IsDPT(sText)
{
	var ValidChars = "0123456789AB";
	var IsNumber=true;
	var Char;
	
	
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			 IsNumber = false;
		}
	}
	
	var numPoint = 0;
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		
		if(Char =="."){
			numPoint = numPoint +1;
		}
		
		if (numPoint  == 2) 
		{
			 IsNumber = false;
		}
	}
	
	if (numPoint  == 2) 
	{
		 IsNumber = false;
	}
	  
	  
	  
	return IsNumber;
}







function IsFloat(sText)
{
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;
	
	
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			 IsNumber = false;
		}
	}
	
	var numPoint = 0;
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		
		if(Char =="."){
			numPoint = numPoint +1;
		}
		
		if (numPoint  == 2) 
		{
			 IsNumber = false;
		}
	}
	
	if (numPoint  == 2) 
	{
		 IsNumber = false;
	}
	  
	  
	  
	return IsNumber;
}


function VerifSearchTarif(){
	if(!IsFloat(document.forms['formSearchEtab'].tarif_journalier.value)){
		alert("Attention le champ Tarif journalier d'hébergement doit être un numérique");
		document.forms['formSearchEtab'].tarif_journalier.value="";
		document.forms['formSearchEtab'].tarif_journalier.focus();
		return false;
	}
}


function ValidContactEtab(){
	
	if(AllTrim(document.forms['FormContact'].nom.value) == ""){
		alert("Merci de renseigner le champ nom");
		document.forms['FormContact'].nom.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormContact'].email.value) == ""){
		alert("Merci de renseigner le champ e-mail");
		document.forms['FormContact'].email.focus();
		return false;
	}else if (!goodmail(AllTrim(document.forms['FormContact'].email.value))){
		alert("Le champ e-mail n'est pas valide");
		document.forms['FormContact'].email.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormContact'].sujet.value) == ""){
		alert("Merci de renseigner le champ sujet du message");
		document.forms['FormContact'].sujet.focus();
		return false;
	}
	
	if(AllTrim(document.forms['FormContact'].message.value) == ""){
		alert("Merci de renseigner le champ   message");
		document.forms['FormContact'].message.focus();
		return false;
	}

	return true;
}



function goodmail(chaine)

{
	var userid;
	if ((chaine.length>8) && (chaine.length<130)) {
		userid = chaine.substring(0,chaine.indexOf("@"));
		if (userid.length>=2 && userid.length<64) {
			FQDN = chaine.substr(chaine.indexOf("@")+1);
			if (FQDN.length>2 && FQDN.length<64) {
				domainname = FQDN.substring(0,FQDN.indexOf("."));
				if (domainname.length>=2) {
					TLD = FQDN.substr(FQDN.indexOf(".")+1);
					if (TLD.length>=2)
						return true;
				}
			}

		}

	}

	return false;

}




 
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////



 

function AllTrim(chaine) {

	  temp = chaine.replace(/(^\s*)|(\s*$)/g, "");

      return temp; 

}





/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

function VerifInscriptionNewsletter(){

	if(AllTrim(document.forms['FormNews'].email.value) == "" || !goodmail(document.forms['FormNews'].email.value)){
		alert("Merci de vérfier votre adresse e-mail");
		document.forms['FormNews'].email.focus();
		return false;
	}
	
}



function ValidMail(){
	//FormContact
 
	if(AllTrim(document.forms['FormContact'].email.value) == ""){
	 
		alert("Merci de spécifier votre adresse email");
		document.forms['FormContact'].email.focus();
		return false;
	}else{
		if(!goodmail(document.forms['FormContact'].email.value)){
		 
			alert("Votre adresse email n'a pas un format valide");
			document.forms['FormContact'].email.focus();
			return false;
		}
	}
	/*
	if(AllTrim(document.forms['FormContact'].societe.value) == ""){
		 
		alert("Merci de préciser le nom de votre société");
		document.forms['FormContact'].societe.focus();
		return false;
	}
	*/
	if(AllTrim(document.forms['FormContact'].msg.value) == ""){
		 
		alert("Merci de préciser votre demande");
		document.forms['FormContact'].msg.focus();
		return false;
	}	

	 return true;
	
}


//////////////////////////////////////////////////////////////////////////////////////

function DynDiv(){
	var msg = "";
	msg = document.getElementById("mydiv").innerHTML;
	document.getElementById("mydiv").innerHTML = ""
	document.getElementById("cont_div").innerHTML = "";
	document.getElementById("cont_div").innerHTML   = msg ;

}