function valide_formulaire() { 
	var chAlert=''
	if(document.inscription.nom_formation.value == "")
	{
		chAlert+='Veuillez choisir une formation\r\n';
	}
	if(document.inscription.nb_participants.value == "")
	{
		chAlert+='Veuillez indiquer le nombre de participants\r\n';
	}
	if (document.inscription.nom.value == "")
	{
		chAlert+='Veuillez saisir votre nom\r\n';
	}
	if(document.inscription.prenom.value == "")
	{
		chAlert+='Veuillez saisir votre prénom\r\n';
	}
	if(document.inscription.telephone.value == "")
	{
		chAlert+='Veuillez saisir votre n° de téléphone\r\n';
	}
	if(document.inscription.email.value == "")
	{
		chAlert+='Veuillez saisir votre adresse email\r\n';
	} else {
		texte = file('/ajax/verifMail.php?mail=' + document.inscription.email.value);
		if(texte=="false"){
			chAlert+='Vous avez saisi une adresse email non valide\r\n';
		}
	}
	if(chAlert==''){
		document.inscription.submit();
	}else{
		alert(chAlert);
	}
}

function valide_formulaire_contact() { 
	var chAlert='';
	if (document.contact.contact_nom.value == "")
	{
		chAlert+='Veuillez saisir votre nom\r\n';
	}
	if(document.contact.contact_prenom.value == "")
	{
		chAlert+='Veuillez saisir votre prénom\r\n';
	}
	if(document.contact.contact_telephone.value == "")
	{
		chAlert+='Veuillez saisir votre n° de téléphone\r\n';
	}
	if(document.contact.contact_email.value == "")
	{
		chAlert+='Veuillez saisir votre adresse email\r\n';
	} else {
		texte = file('/ajax/verifMail.php?mail=' + document.contact.contact_email.value);
		if(texte=="false"){
			chAlert+='Vous avez saisi une adresse email non valide\r\n';
		}
	}
	if(chAlert==''){
		document.contact.submit();
	}else{
		alert(chAlert);
	}
}

function file(fichier){

	if(window.XMLHttpRequest) // FIREFOX
		xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // IE
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else 
		return(false); 
	
	xhr_object.open("GET", fichier, false); 
	xhr_object.send(null); 
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}