/**
	MP SCRIPT
**/

// SCRIPT GOOGLE POUR Analytics 
// UA-5549678-2= code du compte créer par Lilian
/*
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-5549678-2");
pageTracker._trackPageview();
} catch(err) {}
*/


/*****************************************************************************
* FORMULAIRE
*///**************************************************************************

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}

}

function appear(){
document.d1.visibility='show';
}

function disappear(){
//document.d1.visibility='hidden'
}

appear()

window.onload=regenerate2

function MonIdentification(){
	//alert("hello");
	document.form1.submit();
}

function ValiderForm(iLangue){
var i = 0;
var msg = "";
var nom = document.form24.elements['nom_client'].value;
var prenom = document.form24.elements['prenom_client'].value;
var adresse = document.form24.elements['adresse_client'].value;
var cp = document.form24.elements['cp_client'].value;
var ville = document.form24.elements['ville_client'].value;
/*
var telephone = document.form24.elements['telephone_client'].value; */
var email = document.form24.elements['email_client'].value;
var fichier_client = document.form24.elements['fichier_client'].value;

// Contrôle extension CV
var urlcv = document.form24.elements['fichier_client'].value;
var cvlongueur=urlcv.length-3;
var cvextension=urlcv.substr(cvlongueur,3);

// Contrôle extension Lettre
var urllettre = document.form24.elements['fichier2_client'].value;
var lettrelongueur=urllettre.length-3;
var lettreextension=urllettre.substr(lettrelongueur,3);


//alert("cool");	

// Langue FR
if(iLangue=="fr"){
	if (nom.length<2 && i<1)
	  {msg += "Il manque votre Nom\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Il manque votre Prénom\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Il manque votre Adresse\n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Il manque votre Code Postal\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Il manque votre Ville\n";i++;}
/*   	 if (telephone.length<10 && i<1)
	  {msg += "Il manque votre Téléphone\n";i++;} */	  
	  
	if (email.length<4 && i<1)
	  {msg += "Il manque votre adresse EMail\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
   	if (fichier_client.length<2 && i<1)
	  {msg += "Il manque votre pièce-jointe\n";i++;}
	if(urlcv!=""){
		if (cvextension!="doc" &&  cvextension!="pdf")
		  {msg += " Veuillez entrer un fichier de type doc ou pdf \n";i++;}
	}
	if(urllettre!=""){
		if (lettreextension!="doc" &&  lettreextension!="pdf")
		  {msg += " Veuillez entrer un fichier de type doc ou pdf \n";i++;}
	}
	  
	if (i>=1)
	  {alert(msg);return false;}
		document.form24.submit();
		return true;
}

// Langue UK
if(iLangue=="uk"){
	if (nom.length<2 && i<1)
	  {msg += "Please enter your lastname\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Please enter your firstname\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Please enter your address \n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Please enter your zip code\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Please enter your country\n";i++;}
/*   	if (telephone.length<10 && i<1)
	  {msg += "Please enter your telephone\n";i++;} */
	if (email.length<4 && i<1)
	  {msg += "Please enter your email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "This is not a valide email\n";i++;}
   	if (fichier_client.length<2 && i<1)
	  {msg += "Please enter your file\n";i++;}
	  
	if(urlcv!=""){
		if (cvextension!="doc" &&  cvextension!="pdf")
		  {msg += " Wrong document file extension : doc or pdf \n";i++;}
	}
	if(urllettre!=""){
		if (lettreextension!="doc" &&  lettreextension!="pdf")
		  {msg += " Wrong document file extension : doc or pdf \n";i++;}
	}
	if (i>=1)
	  {alert(msg);return false;}
		document.form24.submit();
		return true;
}

// Langue IT
if(iLangue=="it"){
	if (nom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro cognome\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro nome\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Entrare prego nel vostro indirizzo \n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Entrare prego nel vostro codice postale\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Entrare prego nel vostro città\n";i++;}
/*   	if (telephone.length<10 && i<1)
	  {msg += "Entrare prego nel vostro telefono\n";i++;} */
	if (email.length<4 && i<1)
	  {msg += "Entrare prego nel vostro email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Entrare prego nel vostro email\n";i++;}
   	if (fichier_client.length<2 && i<1)
	  {msg += "Entrare prego nel vostro lima\n";i++;}

	if(urlcv!=""){
		if (cvextension!="doc" &&  cvextension!="pdf")
		  {msg += " Wrong document file extension : doc or pdf \n";i++;}
	}
	if(urllettre!=""){
		if (lettreextension!="doc" &&  lettreextension!="pdf")
		  {msg += " Wrong document file extension : doc or pdf \n";i++;}
	}  
	  
	if (i>=1)
	  {alert(msg);return false;}
		document.form24.submit();
		return true;
}


}

function ValiderFormComplement(iLangue){
var i = 0;
var msg = "";
var nom = document.form6.elements['nom_client'].value;
var prenom = document.form6.elements['prenom_client'].value;
var adresse = document.form6.elements['adresse_client'].value;
var cp = document.form6.elements['cp_client'].value;
var ville = document.form6.elements['ville_client'].value;
/* var telephone = document.form6.elements['telephone_client'].value; */
var email = document.form6.elements['email_client'].value;
// Langue FR
if(iLangue=="fr"){
	if (nom.length<2 && i<1)
	  {msg += "Il manque votre Nom\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Il manque votre Prénom\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Il manque votre Adresse\n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Il manque votre Code Postal\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Il manque votre Ville\n";i++;}
/*   	if (telephone.length<10 && i<1)
	  {msg += "Il manque votre Téléphone\n";i++;} */
	if (email.length<4 && i<1)
	  {msg += "Il manque votre adresse EMail\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form6.submit();
		return true;
}
// Langue UK
if(iLangue=="uk"){
	if (nom.length<2 && i<1)
	  {msg += "Please enter your lastname\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Please enter your firstname\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Please enter your address\n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Please enter your zip code\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Please enter your city\n";i++;}
/*   	if (telephone.length<10 && i<1)
	  {msg += "Please enter your telephone\n";i++;} */
	if (email.length<4 && i<1)
	  {msg += "Please enter your email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "This is not a valid email\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form6.submit();
		return true;
}

// Langue IT
if(iLangue=="it"){
	if (nom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro cognome\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro nome\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Entrare prego nel vostro indirizzo\n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Entrare prego nel vostro codice postale\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Entrare prego nel vostro città\n";i++;}
/*   	if (telephone.length<10 && i<1)
	  {msg += "Entrare prego nel vostro telefono\n";i++;} */
	if (email.length<4 && i<1)
	  {msg += "Entrare prego nel vostro email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Ciò non è un valido email\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form6.submit();
		return true;
}

}

// Controle du champ du message
function ValiderFormIdentification(iLangue){
var i = 0;
var msg = "";
var email = document.form1.elements['email_user'].value;
//alert ("cool");
	if(iLangue=='fr'){
		if (email.length<4 && i<1)
		  {msg += "Il manque votre adresse EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form1.submit();
			return true;
	}
	
	if(iLangue=='uk'){
		if (email.length<4 && i<1)
		  {msg += "Please enter your email\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "This is not a valide email\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form1.submit();
			return true;
	}
	
	if(iLangue=='it'){
		if (email.length<4 && i<1)
		  {msg += "Entrare prego nel vostro email\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "Ciò non è un valido email\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form1.submit();
			return true;
	}
}


// Formulaire Donnee perso
function ValiderFormDonneePerso(iLangue){	
	if(iLangue!=0){
		var i = 0;
		var msg = "";
		var email = document.form1.elements['email_client'].value;
		//alert ("cool");
			if(iLangue=='fr'){
				if (email.length<4 && i<1)
				  {msg += "Il manque votre adresse EMail\n";i++;}
				if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
				  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
				if (i>=1)
				  {alert(msg);return false;}
					document.form1.submit();
					return true;
			}
			
			if(iLangue=='uk'){
				if (email.length<4 && i<1)
				  {msg += "Please enter your email\n";i++;}
				if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
				  {msg += "This is not a valide email\n";i++;}
				if (i>=1)
				  {alert(msg);return false;}
					document.form1.submit();
					return true;
			}
	}else{
		document.form1.submit();
		}
}

// Contrôle champs Inscription Formation 1 : agent de constraste radiologique et insufficance rénale
function ValiderFormFormation1(iLangue){

var i = 0;
var msg = "";
var nom = document.form84.elements['nom_client'].value;
var prenom = document.form84.elements['prenom_client'].value;
var adresse = document.form84.elements['adresse_client'].value;
var cp = document.form84.elements['cp_client'].value;
var ville = document.form84.elements['ville_client'].value;
var telephone = document.form84.elements['telephone_client'].value;
var email = document.form84.elements['email_client'].value;


// Langue FR
if(iLangue=="fr"){
	//alert("ok 84");
	if (nom.length<2 && i<1)
	  {msg += "Il manque votre Nom\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Il manque votre Prénom\n";i++;}
 	/*if (cp.length<5 && i<1)
	  {msg += "Il manque votre Code Postal\n";i++;}*/
 	if (ville.length<2 && i<1)
	  {msg += "Il manque votre Ville\n";i++;}
   	if (telephone.length<10 && i<1)
	  {msg += "Il manque votre Téléphone\n";i++;}
	if (email.length<4 && i<1)
	  {msg += "Il manque votre adresse EMail\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form84.submit();
		return true;
}



/*
// Langue UK
if(iLangue=="uk"){
	if (nom.length<2 && i<1)
	  {msg += "Please enter your lastname\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Please enter your firstname\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Please enter your address \n";i++;}
 	if (cp.length<5 && i<1)
	  {msg += "Please enter your zip code\n";i++;}
 	if (ville.length<2 && i<1)
	  {msg += "Please enter your country\n";i++;}
   	if (telephone.length<10 && i<1)
	  {msg += "Please enter your telephone\n";i++;}
	if (email.length<4 && i<1)
	  {msg += "Please enter your email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "This is not a valide email\n";i++;}
   	if (fichier_client.length<2 && i<1)
	  {msg += "Please enter your file\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form24.submit();
		return true;
}

// Langue IT
if(iLangue=="it"){
	if (nom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro cognome\n";i++;}
	if (prenom.length<2 && i<1)
	  {msg += "Entrare prego nel vostro nome\n";i++;}
 	if (adresse.length<2 && i<1)
	  {msg += "Entrare prego nel vostro indirizzo \n";i++;}
 	if (cp.length<5 && i<1)
	  {msg += "Entrare prego nel vostro codice postale\n";i++;}
 	if (ville.length<2 && i<1)
	  {msg += "Entrare prego nel vostro città\n";i++;}
   	if (telephone.length<10 && i<1)
	  {msg += "Entrare prego nel vostro telefono\n";i++;}
	if (email.length<4 && i<1)
	  {msg += "Entrare prego nel vostro email\n";i++;}
	if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
	  {msg += "Entrare prego nel vostro email\n";i++;}
   	if (fichier_client.length<2 && i<1)
	  {msg += "Entrare prego nel vostro lima\n";i++;}
	if (i>=1)
	  {alert(msg);return false;}
		document.form24.submit();
		return true;
}
*/

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SITE MARCHAND
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ValiderFormPanier(iLangue,iCategorie){
var i = 0;
var msg = "";
var civilite = document.form_compte.elements['civilite_client'].value;
var nom = document.form_compte.elements['nom_client'].value;
var prenom = document.form_compte.elements['prenom_client'].value;
var adresse = document.form_compte.elements['adresse_client'].value;
var fonction = document.form_compte.elements['fonction_client'].value;
var cp = document.form_compte.elements['cp_client'].value;
var ville = document.form_compte.elements['ville_client'].value;
var telephone = document.form_compte.elements['telephone_client'].value; 
var email = document.form_compte.elements['email_client'].value;
//var mention_legale = document.form_compte.elements['mention_legale'].value;

var adresse_facturation = document.form_compte.elements.adresse_facturation.checked;
/*
if(mention_legale==true){
	alert("Vous avez choisi: "+mention_legale);
}else{
	alert("Vous avez choisi nul: "+mention_legale);
}*/


//alert("mention_legale="+mention_legale);
//var adresse_facturation = document.form_compte.elements['adresse_facturation'].value;
var nom_complement = document.form_compte.elements['nom_complement'].value;
var adresse_complement = document.form_compte.elements['adresse_complement'].value;
var cp_complement = document.form_compte.elements['cp_complement'].value;
var ville_complement = document.form_compte.elements['ville_complement'].value;
var pays_complement = document.form_compte.elements['pays_complement'].value; 

	// Langue FR
	if(iLangue=="fr"){
		if (civilite==0)
		  {msg += "Remplissez votre Civilité\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Remplissez votre Nom\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Remplissez votre Prénom\n";i++;}
		if (adresse.length<2 && i<1)
		  {msg += "Remplissez votre Adresse\n";i++;}
	    if (fonction==0)
		  {msg += "Remplissez votre Fonction\n";i++;}
		/*if (cp.length<5 && i<1)
		  {msg += "Remplissez votre Code Postal\n";i++;}*/
		if (ville.length<2 && i<1)
		  {msg += "Remplissez votre Ville\n";i++;}
	 	if (telephone.length<10 && i<1)
		  {msg += "Remplissez votre Téléphone\n";i++;} 
		if (email.length<4 && i<1)
		  {msg += "Remplissez votre adresse EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
		if(adresse_facturation==true){
			if (nom_complement.length<2 && i<1)
			  {msg += "Remplissez le nom de la société\n";i++;}
			if (adresse_complement.length<2 && i<1)
			  {msg += "Remplissez votre adresse de facturation\n";i++;}
			if (cp_complement.length<2 && i<1)
			  {msg += "Remplissez votre code postal de facturation\n";i++;}
			if (ville_complement.length<2 && i<1)
			  {msg += "Remplissez votre ville de facturation\n";i++;}
			if (pays_complement.length<2 && i<1)
			  {msg += "Remplissez votre pays de facturation\n";i++;}
		}  		  
		if (i>=1)
		  {alert(msg);return false;}
			document.form_compte.submit();
			//alert('SAVE FORM')
			return true;
	}
	
	// Langue UK
	if(iLangue=="uk"){
		if (civilite==0)
		  {msg += "Please Fill your Civility\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Please Fill your Lastname\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Please Fill your Surname\n";i++;}
		if (adresse.length<2 && i<1)
		  {msg += "Please Fill your address\n";i++;}
	    if (fonction==0)
		  {msg += "Please Fill your Function\n";i++;}
		/*if (cp.length<5 && i<1)
		  {msg += "Please Fill your Zipcode\n";i++;}*/
		if (ville.length<2 && i<1)
		  {msg += "Please Fill your City\n";i++;}
	 	if (telephone.length<10 && i<1)
		  {msg += "Please Fill your Telephone\n";i++;} 
		if (email.length<4 && i<1)
		  {msg += "Please Fill your EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "That's a wrong Email\n";i++;}
		if(adresse_facturation==true){
			if (nom_complement.length<2 && i<1)
			  {msg += "Please Fill your Compagny's name\n";i++;}
			if (adresse_complement.length<2 && i<1)
			  {msg += "Please Fill your Delivery address\n";i++;}
			if (cp_complement.length<2 && i<1)
			  {msg += "Please Fill your Delivery Zip Code\n";i++;}
			if (ville_complement.length<2 && i<1)
			  {msg += "Please Fill your Delivery City\n";i++;}
			if (pays_complement.length<2 && i<1)
			  {msg += "Please Fill your Delivery Country\n";i++;}
		}  		  
		if (i>=1)
		  {alert(msg);return false;}
			document.form_compte.submit();
			//alert('SAVE FORM')
			return true;
	}
}

// Vérification du formulaire de MODIFICATION
function EnregistrerUtilisateurForm(iLangue,iCategorie){
var i = 0;
var msg = "";
var civilite = document.form_compte.elements['civilite_client'].value;
var nom = document.form_compte.elements['nom_client'].value;
var prenom = document.form_compte.elements['prenom_client'].value;
var adresse = document.form_compte.elements['adresse_client'].value;
var fonction = document.form_compte.elements['fonction_client'].value;
var cp = document.form_compte.elements['cp_client'].value;
var ville = document.form_compte.elements['ville_client'].value;
var telephone = document.form_compte.elements['telephone_client'].value; 
var email = document.form_compte.elements['email_client'].value;
if(iCategorie==1){
	var nom_complement = document.form_compte.elements['nom_complement'].value;
	var site_complement = document.form_compte.elements['site_complement'].value;
	var adresse_complement = document.form_compte.elements['adresse_complement'].value;
	var cp_complement = document.form_compte.elements['cp_complement'].value;
	var ville_complement = document.form_compte.elements['ville_complement'].value;
	var pays_complement = document.form_compte.elements['pays_complement'].value; 
}
//alert("cool");	
	// Langue FR
	if(iLangue=="fr"){
		if (civilite==0)
		  {msg += "Remplissez votre Civilité\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Remplissez votre Nom\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Remplissez votre Prénom\n";i++;}
		if (adresse.length<2 && i<1)
		  {msg += "Remplissez votre Adresse\n";i++;}
	    if (fonction==0)
		  {msg += "Remplissez votre Fonction\n";i++;}
		/*if (cp.length<5 && i<1)
		  {msg += "Remplissez votre Code Postal\n";i++;}*/
		if (ville.length<2 && i<1)
		  {msg += "Remplissez votre Ville\n";i++;}
	 	if (telephone.length<10 && i<1)
		  {msg += "Remplissez votre Téléphone\n";i++;} 
		if (email.length<4 && i<1)
		  {msg += "Remplissez votre adresse EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
		if(iCategorie!=1){
			if (nom_complement.length<2 && i<1)
			  {msg += "Remplissez le nom de la société\n";i++;}
			if (site_complement.length<2 && i<1)
			  {msg += "Remplissez votre site\n";i++;}
			if (adresse_complement.length<2 && i<1)
			  {msg += "Remplissez votre adresse\n";i++;}
			if (cp_complement.length<2 && i<1)
			  {msg += "Remplissez votre code postal\n";i++;}
			if (ville_complement.length<2 && i<1)
			  {msg += "Remplissez votre ville\n";i++;}
			if (pays_complement.length<2 && i<1)
			  {msg += "Remplissez votre pays\n";i++;}
		}  		  
		if (i>=1)
		  {alert(msg);return false;}
			document.form_compte.submit();
			return true;
	}
	
	// Anglais
	if(iLangue=="uk"){
		if (civilite==0)
		  {msg += "Please Fill your Civility\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Please Fill your Lastname\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Please Fill your Surname\n";i++;}
		if (adresse.length<2 && i<1)
		  {msg += "Please Fill your Address\n";i++;}
	    if (fonction==0)
		  {msg += "Please Fill your Function\n";i++;}
		/*if (cp.length<5 && i<1)
		  {msg += "Please Fill your Zip Code\n";i++;}*/
		if (ville.length<2 && i<1)
		  {msg += "Please Fill your City\n";i++;}
	 	if (telephone.length<10 && i<1)
		  {msg += "Please Fill your Telephone\n";i++;} 
		if (email.length<4 && i<1)
		  {msg += "Please Fill your EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "It's a wrong EMail\n";i++;}
		if(iCategorie!=1){
			if (nom_complement.length<2 && i<1)
			  {msg += "Please Fill your Compagny's name\n";i++;}
			if (site_complement.length<2 && i<1)
			  {msg += "Please Fill your Area\n";i++;}
			if (adresse_complement.length<2 && i<1)
			  {msg += "Please Fill your Address\n";i++;}
			if (cp_complement.length<2 && i<1)
			  {msg += "Please Fill your Zip Code\n";i++;}
			if (ville_complement.length<2 && i<1)
			  {msg += "Please Fill your City\n";i++;}
			if (pays_complement.length<2 && i<1)
			  {msg += "Please Fill your Country\n";i++;}
		}  		  
		if (i>=1)
		  {alert(msg);return false;}
			document.form_compte.submit();
			return true;
	}
}


function ValiderCarteBleu(iLangue){
var i = 0;
var msg = "";
var numero_carte = document.form_cartebleu.elements['numero_carte'].value;
//alert("cool");	
	// Langue FR
	if(iLangue=="fr"){
		if (numero_carte.length<16 && i<1)
		  {msg += "Remplissez votre Nom\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_cartebleu.submit();
			return true;
	}
	
	if(iLangue=="uk"){
		if (numero_carte.length<16 && i<1)
		  {msg += "Please fill your Lastname\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_cartebleu.submit();
			return true;
	}
}


function ValidationCommande(iLangue){
var i = 0;
var msg = "";
var mention_legale = document.form_validation.elements.mention_legale.checked;
//alert("cool");	
	// Langue FR
	if(iLangue=="fr"){
		if (mention_legale==false)
		  {msg += "Veuillez cocher la case pour accepter les mentions légales et valider votre commande\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_validation.submit();
			return true;
	}
	
	// Langue  UK
	if(iLangue=="uk"){
		if (mention_legale==false)
		  {msg += "Please check the box to accept the legal and complete your order\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_validation.submit();
			return true;
	}
}

function AffichageAdresseFacturation(iSessionUser){
//	alert("hello");
	var civilite = document.form_compte.elements['civilite_client'].value;
	var nom = document.form_compte.elements['nom_client'].value;
	var prenom = document.form_compte.elements['prenom_client'].value;
	var adresse = document.form_compte.elements['adresse_client'].value;
	var fonction = document.form_compte.elements['fonction_client'].value;
	var cp = document.form_compte.elements['cp_client'].value;
	var ville = document.form_compte.elements['ville_client'].value;
	var pays = document.form_compte.elements['pays_client'].value;
	var telephone = document.form_compte.elements['telephone_client'].value; 
	var email = document.form_compte.elements['email_client'].value;

	var adresse_facturation = document.form_compte.elements.adresse_facturation.checked;
		if(iSessionUser==""){
			window.location='panier.php?action=COMPTE&facturation='+adresse_facturation+'&civilite='+civilite+'&nom='+nom+'&prenom='+prenom+'&adresse='+adresse+'&fonction='+fonction+'&cp='+cp+'&ville='+ville+'&pays='+pays+'&telephone='+telephone+'&email='+email;
		}else{
			window.location='panier.php?action=MODIFIER&facturation='+adresse_facturation;
		}
	}

//
// DEUBT: FONCTION BACKOFFICE REFERENT
//

function EnregistrementContactReferent(iLangue){

/*
alert("cool");	
	// Langue FR
*/	
var i = 0;
var msg = "";
var civilite = document.form_utilisateur.elements['civilite_client'].value;
var nom = document.form_utilisateur.elements['nom_client'].value;
var prenom = document.form_utilisateur.elements['prenom_client'].value;
var email = document.form_utilisateur.elements['email_client'].value;
//var liste_formation = document.form_utilisateur.elements.liste_formation.checked;
var confirmation_association=document.form_utilisateur.elements.confirmation_association.checked;

	
	if(iLangue=="fr"){
		if (civilite==0)
		  {msg += "Remplissez votre Civilité\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Remplissez votre Nom\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Remplissez votre Prénom\n";i++;}
		if (email.length<4 && i<1)
		  {msg += "Remplissez votre adresse EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "Ceci n'est pas une adresse EMail valide\n";i++;}
		if (confirmation_association==false)
		  {msg += "Vérifier vous avez choisi une formation et cochez la case de confirmation pour l'enregistrement\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}		
	
	if(iLangue=="uk"){
		if (civilite==0)
		  {msg += "Please fill your Civility\n";i++;}
		if (nom.length<2 && i<1)
		  {msg += "Please fill Lastname\n";i++;}
		if (prenom.length<2 && i<1)
		  {msg += "Please fill your Surname\n";i++;}
		if (email.length<4 && i<1)
		  {msg += "Please fill your EMail\n";i++;}
		if (email.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/)==-1 && i<1)
		  {msg += "It's a wrong EMail\n";i++;}
		if (confirmation_association==false)
		  {msg += "Please verify you have selected a training and check the box for the registration confirmation\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}		

}


function EnregistrementModificationContactReferent(iLangue){
var i = 0;
var msg = "";
var confirmation_association=document.form_utilisateur.elements.confirmation_association.checked;

	if(iLangue=="fr"){
		if (confirmation_association==false)
		  {msg += "Vérifier vous avez choisi une formation et cochez la case de confirmation pour l'enregistrement\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}		
	
	
	if(iLangue=="uk"){
		if (confirmation_association==false)
		  {msg += "Please verify you have selected a training and check the box for the registration confirmation\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}		

}

function EnregistrementAssociationUtilisateur(iLangue){

/*
alert("cool");	
	// Langue FR
*/	
var i = 0;
var msg = "";
var confirmation_association=document.form_utilisateur.elements.confirmation_association.checked;

	
	if(iLangue=="fr"){
		if (confirmation_association==false)
		  {msg += "Vérifier vous avez choisi une formation et cochez la case de confirmation pour l'enregistrement\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}	
	
	if(iLangue=="uk"){
		if (confirmation_association==false)
		  {msg += "Please verify you have selected a training and check the box for the registration confirmation\n";i++;}
		if (i>=1)
		  {alert(msg);return false;}
			document.form_utilisateur.submit();
			return true;
	}	

}

//
// FIN: FONCTION BACKOFFICE REFERENT
//

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FIN SITE MARCHAND
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// TRAINING
function TrainingSessionPayement(){
	document.form_training_payement.submit();
}

