
function verifSubmitContactForm (form,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16) {

			var new_string = new String(form.email.value);

			if ( form.titleCivil2.value != "nochecked" ) {
				if ( form.titleCivil.value == "-" ) {			    
						alert(n1);
						form.titleCivil.focus();
						return(false);	
				}  
			}
	
			if (( form.secondname2.value != "nochecked" )) {
				if ( form.secondname.value == "" ) {
				   
					alert(n3);
					form.secondname.focus();
					return(false);				
				}  
			}
			
			if (( form.firstName2.value != "nochecked" )) {
				if ( form.firstName.value == "" ) {
					alert(n2);
					form.firstName.focus();
					return(false);				
				}  
			}
			if (( form.company2.value != "nochecked" )) {
				if ( form.company.value == "" ) {
				   
						alert(n14);
						form.company.focus();
						return(false);				
				}  
			}
			
			if (( form.address2.value != "nochecked" )) {
				if ( form.address.value == "" ) {
				   
						alert(n4);
						form.address.focus();
						return(false);				
				}  
			}

			if (( form.postcode2.value != "nochecked" )) {
				if ( form.postcode.value == "" ) {
					alert(n5);
					form.postcode.focus();
					return(false);					
				}  
			}
		
			if (( form.ville2.value != "nochecked" )) {
				if ( form.ville.value == "" ) {				    
					alert(n6);
					form.ville.focus();
					return(false);					
				}  
			}
			if (( form.country2.value != "nochecked" )) {
					if ( form.country.value == "" ) {				   
						alert(n7);
						form.country.focus();
						return(false);					
					}  
			}	
			if (( form.phone2.value != "nochecked" )) {
					if ( form.phone.value == "" ) {				   
						alert(n12);
						form.phone.focus();
						return(false);					
					} 
					if(isNaN(form.phone.value)!=false){
						alert(n15);
						form.phone.focus();
						return(false);					
					} 
								
			}
			if (( form.fax2.value != "nochecked" )) {
					if ( form.fax.value == "" ) {				   
						alert(n13);
						form.fax.focus();
						return(false);					
					} 
					if(isNaN(form.fax.value)!=false){
						alert(n16);
						form.fax.focus();
						return(false);					
					} 		
			}			
			 if((form.mailto.value == "-1")){
				alert(n11);
				form.message.focus();
				return(false);
				 
			}
			 if((form.email.value == "")){
				alert(n8);
				form.email.focus();
				return(false);
			} 
			if ((!new_string.match('^[-_\.0-9a-zA-Z]{1,}@[-_\.0-9a-zA-Z]{1,}[\.][0-9a-zA-Z]{2,}$')))  { 
				alert(n9);
				form.email.focus();
				return(false);  
			}
				   
			if((form.message.value == "")){
				alert(n10);
				form.message.focus();
				return(false);
					 
			}

	
}

function getXhr(){
	var xhr = null;
	if(window.XMLHttpRequest){ // Firefox et autres
		xhr = new XMLHttpRequest(); 
	
	}
	else if(window.ActiveXObject){ // Internet Explorer 
		try {
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	else { // XMLHttpRequest non supporté par le navigateur 
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		xhr = false; 
	} 
	    return xhr;
}



/**
* Méthode qui sera appelée sur le click du bouton
*/
function change(){

	var xhr = getXhr();
	
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
	//alert(xhr.readyState);
	// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
	if(xhr.readyState == 4 && xhr.status == 200){
		di = document.getElementById('contact_mailto');
		di.innerHTML = xhr.responseText;
	}
	}
	// Ici on va voir comment faire du post
	xhr.open("POST","./app/contact/mod/ajaxcontact.php",true);
	// ne pas oublier ça pour le post
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	// ne pas oublier de poster les arguments
	// ici, l'id de l'auteur
	idauteur = document.getElementById('bcms_cct').options[document.getElementById('bcms_cct').selectedIndex].value;
	xhr.send("con_cat_fk_cct_id="+idauteur);


}






