 // Vérification mini formulaire Profil client
function checkForm_espaceclient_profil() {
	if (document.form1.client_email.value=="") {
	   alert("Inform your Email");
	   document.form1.client_email.focus();
	   return false;
	 }	 
	 if (document.form1.client_email.value.indexOf('@')==-1) {
	   alert("Inform a valid Email");
	   document.form1.client_email.focus();
	   return false;
	 }
   
	if (document.form1.client_pass.value !="") {
	if (document.form1.client_pass.value != document.form1.client_pass_confirm.value ) {
	   document.form1.client_pass.value = '';
	   document.form1.client_pass_confirm.value = '';
	   alert("The confirmation password does not correspond.  Please reseaze your password.");
	   document.form1.client_pass.focus();
	   return false;
	 }	 
	 }	  
   
	if (document.form1.client_civilite.value=="") {
	   alert("Inform your middle initial");
	   document.form1.client_civilite.focus();
	   return false;
	 }	 
	if (document.form1.client_prenom.value=="") {
	   alert("Inform your first name");
	   document.form1.client_prenom.focus();
	   return false;
	 }	 
	if (document.form1.client_nom.value=="") {
	   alert("Inform your name");
	   document.form1.client_nom.focus();
	   return false;
	 }	 
		
		if (controle_date(document.form1.client_date_naissance)==false){
		alert("Please indicate your date of birth to the format : dd/mm/yyyy");
		document.form1.client_date_naissance.focus();
	  return false;
	 }	 
	if (document.form1.client_adresse.value=="") {
	   alert("Inform your adress");
	   document.form1.client_adresse.focus();
	   return false;
	 }	 	 	  
	if (document.form1.client_cp.value=="") {
	   alert("Inform your ZIP code");
	   document.form1.client_cp.focus();
	   return false;
	 }	 	 	  	 

	if (document.form1.client_ville.value=="") {
	   alert("Inform your city");
	   document.form1.client_ville.focus();
	   return false;
	   
	 }
	if (document.form1.client_pays_id.value=='0') {
	   alert("Inform your country");
	   document.form1.client_pays_id.focus();
	   return false;
	 }	 	 	  	 	 
	if (document.form1.client_tel.value=="") {
	   alert("Inform your phone number");
	   document.form1.client_tel.focus();
	   return false;
	 }	 	 	  

   return true;
 } 
 
 
 
 // Vérification mini formulaire Inscription client
function checkForm_espaceclient_inscription() {
	if (document.form1.client_email.value=="") {
	   alert("Inform your Email");
	   document.form1.client_email.focus();
	   return false;
	 }	 
	 if (document.form1.client_email.value.indexOf('@')==-1) {
	   alert("Invalid mail adress");
	   document.form1.client_email.focus();
	   return false;
	 }
   
   
	if (document.form1.client_pass.value=="") {
	   alert("Inform your password.");
	   document.form1.client_pass.focus();
	   return false;
	 }	 
	 	if (document.form1.client_pass_confirm.value=="") {
	   alert("Please inform the confirm your password field.");
	   document.form1.client_pass_confirm.focus();
	   return false;
	 }	 
	if (document.form1.client_civilite.value=="") {
	   alert("Inform your middle initial");
	   document.form1.client_civilite.focus();
	   return false;
	 }	 
	if (document.form1.client_prenom.value=="") {
	   alert("Inform your first name");
	   document.form1.client_prenom.focus();
	   return false;
	 }	 
	if (document.form1.client_nom.value=="") {
	   alert("Inform your name");
	   document.form1.client_nom.focus();
	   return false;
	 }	 
	if (controle_date(document.form1.client_date_naissance)==false){
		alert("Please indicate your date of birth to the format : dd/mm/yyyy");
		document.form1.client_date_naissance.focus();
	   return false;
	 }	 

	if (document.form1.client_adresse.value=="") {
	   alert("Inform your adress");
	   document.form1.client_adresse.focus();
	   return false;
	 }	 	 	  
	if (document.form1.client_cp.value=="") {
	   alert("Inform your ZIP code");
	   document.form1.client_cp.focus();
	   return false;
	 }	 	 	  	 

	if (document.form1.client_ville.value=="") {
	   alert("Inform your city");
	   document.form1.client_ville.focus();
	   return false;
	 }	 	 	  	 
	if (document.form1.client_pays_id.value=='0') {
	   alert("Inform your country");
	   document.form1.client_pays_id.focus();
	   return false;
	 }	 	 	  	 	 
	if (document.form1.client_tel.value=="") {
	   alert("Inform your phone number");
	   document.form1.client_tel.focus();
	   return false;
	 }	 	 	  

   return true;
 } 
 
 
 
 
  // Vérification mini formulaire login
function checkForm_login () {
	if (document.form1.client_email.value=="") {
	   alert("Inform your Email");
	   document.form1.client_email.focus();
	   return false;
	 }	 
	 if (document.form1.client_email.value.indexOf('@')==-1) {
	   alert("Inform a valid Email");
	   document.form1.client_email.focus();
	   return false;
	 }
   
   	 
	if (document.form1.client_pass.value=="") {
	   alert("Inform your password.");
	   document.form1.client_pass.focus();
	   return false;
	 }	 
}

  // Vérification mini formulaire Mot de passe oubli
function checkForm_oublipass() {
if (document.form1.client_email.value=="") {
	   alert("Inform your Email");
	   document.form1.client_email.focus();
	   return false;
	 }	 
	 if (document.form1.client_email.value.indexOf('@')==-1) {
	   alert("Inform a valid Email");
	   document.form1.client_email.focus();
	   return false;
	 }
   
   
}





// Vérification formulaire commandes coordonnées
 function checkForm_commande_coordonnees() {
 
  
 	//if (document.form2.facturation_civilite.selectedIndex == 0) {
	//   alert("Veuillez renseigner votre civilité");
	//   document.form2.facturation_civilite.focus();
	//   return false;
	// }
	 
  	if (document.form2.facturation_email.value=="") {
	   alert("Inform your Email");
	   document.form2.facturation_email.focus();
	   return false;
	 }	 
	 
	 if (document.form2.facturation_email.value.indexOf('@')==-1) {
	   alert("Inform a valid Email");
	   document.form2.facturation_email.focus();
	   return false;
	 }


//	if (document.form2.facturation_prenom.value=="") {
//	   alert("Veuillez renseigner votre prénom");
//	   document.form2.facturation_prenom.focus();
//	   return false;
//	 }

	if (document.form2.facturation_nom.value=="") {
	   alert("Inform your name");
	   document.form2.facturation_nom.focus();
	   return false;
	 }

	if (document.form2.facturation_societe.value=="") {
	   alert("Inform your society name");
	   document.form2.facturation_societe.focus();
	   return false;
	 }

	//if (document.form2.facturation_cp.value=="") {
	//   alert("Veuillez renseigner votre code postal");
	//   document.form2.facturation_cp.focus();
	//   return false;
	// }
	 
	//if (document.form2.facturation_cp.value.length != 5) {
	//   alert("Le champ code postal doit comporter 5 chiffres");
	//   document.form2.facturation_cp.focus();
    //   return false;
    //}
	
	// if (isNaN(document.form2.facturation_cp.value)) {
	//   alert("Le champ code postal est incorrect");
	//   document.form2.facturation_cp.focus();
    //   return false;
   // }
	
//	 if (document.form2.facturation_cp.value <1000 || document.form2.facturation_cp.value > 95999) {
//	   alert("Le champ code postal est incorrect");
//	   document.form2.facturation_cp.focus();
//       return false;
//    }

//	if (document.form2.facturation_ville.value=="") {
//	   alert("Veuillez renseigner votre ville");
//	   document.form2.facturation_ville.focus();
//	   return false;
//	 }

	if (document.form2.facturation_pays_id.value=="") {
	   alert("Inform your country");
	   document.form2.facturation_pays_id.focus();
	   return false;
	 }

	if (document.form2.facturation_tel.value=="") {
	   alert("Inform your phone number");
	   document.form2.facturation_tel.focus();
	   return false;
	 }

	if (document.form2.livraison_prenom.value!="") {
	
	
					//if (document.form2.livraison_civilite.selectedIndex == 0) {
					//   alert("Veuillez renseigner votre civilité");
					//   document.form2.livraison_civilite.focus();
					//   return false;
					// }	
						
					if (document.form2.livraison_email.value=="") {
					   alert("Inform your Email");
					   document.form2.livraison_email.focus();
					   return false;
					 }	 
					 
					 if (document.form2.livraison_email.value.indexOf('@')==-1) {
					   alert("Inform a valid Email");
					   document.form2.livraison_email.focus();
					   return false;
					 }

	
					if (document.form2.livraison_nom.value=="") {
					   alert("Inform your name");
					   document.form2.livraison_nom.focus();
					   return false;
					 }
				
				
					if (document.form2.livraison_cp.value=="") {
					   alert("Inform your ZIP code");
					   document.form2.livraison_cp.focus();
					   return false;
					 }
					
					if (document.form2.livraison_cp.value.length != 5) {
					   alert("Incorrect ZIP code");
					   document.form2.livraison_cp.focus();
					   return false;
					}
		
					if (isNaN(document.form2.livraison_cp.value)) {
					   alert("Incorrect ZIP code");
					   document.form2.livraison_cp.focus();
					   return false;
					}
					
					if (document.form2.livraison_cp.value <1000 || document.form2.livraison_cp.value > 95999) {
	   					alert("Incorrect ZIP code");
	   					document.form2.livraison_cp.focus();
       					return false;
			   		}		
						
					if (document.form2.livraison_ville.value=="") {
					   alert("Inform your city");
					   document.form2.livraison_ville.focus();
					   return false;
					 }
					 
					 if (document.form2.livraison_pays_id.value=="") {
					   alert("Inform your country");
					   document.form2.livraison_pays_id.focus();
					   return false;
					 }
					 
					 if (document.form2.livraison_tel.value=="") {
					   alert("Inform your phone number");
					   document.form2.livraison_tel.focus();
					   return false;
					 }
	
	}

   return true;
 }





// Vérification formulaire commandes coordonnées

function checkForm_commande_resume() {

 	if (!document.form1.cgv.checked) {
	   alert("To be able to order, you must accept our general conditions of sale");
	   document.form1.cgv.focus();
	   return false;
	 }	 
	 
	 return true;
}


// Vérification formulaire contact

function checkForm_contact() {
	 
 	if (document.form_contact.contact_prenom.value=="") {
	   alert("Inform your first name");
	   document.form_contact.contact_prenom.focus();
	   return false;
	 }	 
	  	if (document.form_contact.contact_nom.value=="") {
	   alert("Inform your name");
	   document.form_contact.contact_nom.focus();
	   return false;
	 }	 

	 // 	if (document.form_contact.contact_adresse.value=="") {
	 //  alert("Veuillez indiquez votre adresse.");
	 //  document.form_contact.contact_adresse.focus();
	 //  return false;
	// }	 
	//  	if (document.form_contact.contact_cp.value=="") {
	//   alert("Veuillez indiquez votre Code postal.");
	//   document.form_contact.contact_cp.focus();
	//   return false;
	// }	 
	//  	if (document.form_contact.contact_ville.value=="") {
	//   alert("Veuillez indiquez votre ville.");
	//   document.form_contact.contact_ville.focus();
	//   return false;
	// }	 	 

	if (document.form_contact.contact_tel.value=="") {
	   alert("Inform your phone number");
	   document.form_contact.contact_tel.focus();
	   return false;
	 }	 	 
	if (document.form_contact.contact_email.value=="") {
	   alert("Inform your Email");
	   document.form_contact.contact_email.focus();
	   return false;
	}else{
		if (checkMail(document.form_contact.contact_email.value)==false){
			document.form_contact.contact_email.select();
			return false;
		}
	}
	 
	// if (document.form_contact.contact_email.value.indexOf('@')==-1) {
	//   alert("Veuillez renseigner une adresse e-mail valide !");
	//   document.form_contact.contact_email.focus();
	//   return false;
	// }
	 	  	if (document.form_contact.contact_message.value=="") {
	   alert("fill in your message");
	   document.form_contact.contact_message.focus();
	   return false;
	 }	 	 
	 return true;
}





// Vérification formulaire commandes coordonnées
 function checkForm_envoiami() {

	if (document.form_ami.ami_nom.value=="") {
	   alert("Inform your friends name.");
	   document.form_ami.ami_nom.focus();
	   return false;
	 }
	 
	if (document.form_ami.ami_email.value=="") {
	   alert("Inform your friends email.");
	   document.form_ami.ami_email.focus();
	   return false;
	}else{
		if (checkMail(document.form_ami.ami_email.value)==false){
			document.form_ami.ami_email.select();
			return false;
		}
	}
	
	if (document.form_ami.nom.value=="") {
	   alert("Inform your name");
	   document.form_ami.nom.focus();
	   return false;
	 }
	 
	 if (document.form_ami.email.value=="") {
	   alert("Inform your Email");
	   document.form_ami.email.focus();
	   return false;
	}else{
		if (checkMail(document.form_ami.email.value)==false){
			document.form_ami.email.select();
			return false;
		}
	}


	if (document.form_ami.message.value=="") {
	   alert("fill in your message");
	   document.form_ami.message.focus();
	   return false;
	 }

	return true;
 }
 
 
 // fonction de vérification d'email
 function checkMail(mail){
         if(mail!=""){
                  adresse = mail;
				  // place de l'arobas
                  var place = adresse.indexOf("@",1); 
				  //place du point
                  var point = adresse.indexOf(".",place+2);
				  //s'il y a un arobase et un point (o mois un caractère après)
                  if ((place > -1)&&(adresse.length >2)&&(point > 1))
                  {
                  }
                  else 
                  { 
                       alert('Inform a valid Email');
                       return false;
                  }
         }
		 return true;
}

 
 // fonction qui verifie le formulaire de recommandation
 
 function VerifRecommander(){
	 
	 var temp =0;
	 
	 	if (document.form1.email_exp.value==""){
				alert(EMAIL);
				document.form1.email_exp.focus();
				return false;
		}else{
			if (checkMail(document.form1.email_exp.value)==false){
				document.form1.email_exp.select();
				return false;
				}
		}

	 	if (document.form1.nom_exp.value==""){
				alert(NOM);
				document.form1.nom_exp.focus();
				return false;
		}
			
	 	if (document.form1.prenom_exp.value==""){
				alert('Inform your first name');
				document.form1.prenom_exp.focus();
				return false;
		}
		
		
	 	if (document.form1.email_dest1.value!=""){
			temp = temp+1;
			if (checkMail(document.form1.email_dest1.value)==false){
				document.form1.email_dest1.select();
				return false;
			}
		}
		
		if (document.form1.email_dest2.value!=""){
			temp = temp+1;
			if (checkMail(document.form1.email_dest2.value)==false){
				document.form1.email_dest2.select();
				return false;
			}
		}
		
		if (document.form1.email_dest3.value!=""){
			temp = temp+1;
			if (checkMail(document.form1.email_dest3.value)==false){
				document.form1.email_dest3.select();
				return false;
			}
		}
		
		if (document.form1.email_dest4.value!=""){
			temp = temp+1;
			if (checkMail(document.form1.email_dest4.value)==false){
				document.form1.email_dest4.select();
				return false;
			}
		}
		
		if (document.form1.email_dest5.value!=""){
			temp = temp+1;
			if (checkMail(document.form1.email_dest5.value)==false){
				document.form1.email_dest5.select();
				return false;
			}
		}
			
		if (temp==0){
				alert('Inform the email adress of at least one friend');
				return false;
		}
		
		if (document.form1.message.value==""){
			alert('fill in your message');
			document.form1.message.focus();
			return false
		}

		return true;
}

// Verifie le formulaire de newsletter
function VerifNewsletter(){

	if (document.form_newsletter.nw_email.value==""){
			alert('Inform your Email');
			document.form_newsletter.nw_email.focus();
			return false
		}else{
			if (checkMail(document.form_newsletter.nw_email.value)==false){
				document.form_newsletter.nw_email.select();
				return false;
			}
		}
		return true;
}

// verif moteur
function VerifSearch(){
	
	if (document.form_search.recherche_texte.value=="" || document.form_search.recherche_texte.value=="mot-clé"){
			alert('Inform the required object');
			document.form_search.recherche_texte.focus();
			return false
	}
	if (document.form_search.recherche_texte.value.length < 3){
			alert('Your research must contain a minimum of 3 characters.');
			document.form_search.recherche_texte.focus();
			return false
	}
	return true;
	
}


function VerifLivraison(){
			
	if (document.form2.livraison_email.value!="") {
		if (checkMail(document.form2.livraison_email.value)==false){
				document.form2.livraison_email.select();
				return false;
		}
	 }
	return true;
	
}