function verifPage2() {
	LS_msg = "";
	LS_msg_nom = "";
	LS_msg_prenom = "";
	LS_msg_adr = "";
	LS_msg_cp = "";
	LS_msg_ville = "";
	LS_msg_tel = "";
	LS_msg_mob = "";
	LS_msg_mail = "";
	LS_msg_raison = "";
	LS_msg_soc = "";
	LS_msg_siret = "";
	LS_msg_c16 = "";

	if (document.getElementById('form_participant').nom.value=="" || document.getElementById('form_participant').nom.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre nom<BR />";
		LS_msg_nom += "veuillez pr&eacute;ciser votre nom<BR />";
	}
	if (document.getElementById('form_participant').prenom.value=="" || document.getElementById('form_participant').prenom.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre pr�nom<BR />";
		LS_msg_prenom += "veuillez pr&eacute;ciser votre pr&eacute;nom<BR />";
	}
	if (document.getElementById('form_participant').adresse.value=="" || document.getElementById('form_participant').adresse.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre adresse<BR />";
		LS_msg_adr += "veuillez pr&eacute;ciser votre adresse<BR />";
	}
	if (document.getElementById('form_participant').cp.value=="" || document.getElementById('form_participant').cp.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre code postal<BR />";
		LS_msg_cp += "veuillez pr&eacute;ciser votre code postal<BR />";
	}
	if (!checkCodePostal(document.getElementById('form_participant').cp.value) && document.getElementById('form_participant').cp.value!="" && document.getElementById('form_participant').cp.value!=undefined) {
		LS_msg += "votre code postal n'est pas valide<BR />";
		LS_msg_cp += "votre code postal n'est pas valide<BR />";
	}
	if (document.getElementById('form_participant').ville.value=="" || document.getElementById('form_participant').ville.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre ville<BR />";
		LS_msg_ville += "veuillez pr&eacute;ciser votre ville<BR />";
	}
	if (document.getElementById('form_participant').tel.value=="" || document.getElementById('form_participant').tel.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre num&eacute;ro de t&eacute;l&eacute;phone<BR />";
		LS_msg_tel += "veuillez pr&eacute;ciser votre num&eacute;ro de t&eacute;l&eacute;phone<BR />";
	}
	if (!checkPhone(document.getElementById('form_participant').tel.value) && document.getElementById('form_participant').tel.value!="" && document.getElementById('form_participant').tel.value!=undefined) {
		LS_msg += "votre num&eacute;ro de t&eacute;l&eacute;phone n'est pas valide<BR />";
		LS_msg_tel += "votre num&eacute;ro de t&eacute;l&eacute;phone n'est pas valide<BR />";
	}
	if (document.getElementById('form_participant').mail.value=="" || document.getElementById('form_participant').mail.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre e-mail<BR />";
		LS_msg_mail += "veuillez pr&eacute;ciser votre e-mail<BR />";
	}
	if (!checkMail(document.getElementById('form_participant').mail.value) && document.getElementById('form_participant').mail.value!="" && document.getElementById('form_participant').mail.value!=undefined) {
		LS_msg += "votre e-mail n'est pas une adresse valide<BR />";
		LS_msg_mail += "votre e-mail n'est pas une adresse valide<BR />";
	}
	if (document.getElementById('form_participant').date_naissance.value=="" || document.getElementById('form_participant').date_naissance.value==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre date de naissance<BR />";
		LS_msg_raison += "veuillez pr&eacute;ciser votre date de naissance<BR />";
	}
	if (!CheckDate(document.getElementById('form_participant').date_naissance.value) && document.getElementById('form_participant').date_naissance.value!="" && document.getElementById('form_participant').date_naissance.value!=undefined) {
		LS_msg += "votre date de naissance n'est pas valide<BR />";
		LS_msg_raison += "votre date de naissance n'est pas valide<BR />";
	}
	if (document.getElementById('form_participant').c16.checked=="" || document.getElementById('form_participant').c16.checked==undefined) {
		LS_msg += "veuillez pr&eacute;cisez votre date de naissance<BR />";
		LS_msg_c16 += "veuillez pr&eacute;ciser votre date de naissance<BR />";
	}
	if (LS_msg=="") {
		//document.getElementById('form_participant').target = "_blank";
		document.getElementById('form_participant').submit();
	} else {
		document.getElementById('form_participant').msg.value='Des erreurs sont apparues pendant le traitement de votre formulaire.<br />';
		if (LS_msg_nom!="") document.getElementById('form_participant').msg_nom.value=LS_msg_nom;
		if (LS_msg_prenom!="") document.getElementById('form_participant').msg_prenom.value=LS_msg_prenom;
		if (LS_msg_adr!="") document.getElementById('form_participant').msg_adr.value=LS_msg_adr;
		if (LS_msg_cp!="") document.getElementById('form_participant').msg_cp.value=LS_msg_cp;
		if (LS_msg_ville!="") document.getElementById('form_participant').msg_ville.value=LS_msg_ville;
		if (LS_msg_tel!="") document.getElementById('form_participant').msg_tel.value=LS_msg_tel;
		if (LS_msg_mail!="") document.getElementById('form_participant').msg_mail.value=LS_msg_mail;
		if (LS_msg_raison!="") document.getElementById('form_participant').msg_raison.value=LS_msg_raison;
		if (LS_msg_c16!="") document.getElementById('form_participant').msg_c16.value=LS_msg_c16;
		document.getElementById('form_participant').target = "";
		document.getElementById('form_participant').action = "index.php";
		document.getElementById('form_participant').submit();
	}
}
function checkMail(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function checkCodePostal(cp)
{

if (cp.length < 5 && cp.length > 0 )
{
//alert("Indiquez un code postal � 5 chiffres");
return false;
}
if (cp.length == 0)
{
//alert("Indiquez un code postal");
return false;
}
if (isNaN(cp) == true)
{
//alert("Un code postal ne peut pas contenir de lettres");
return false;
}
return true;
} 
function checkPhone(num_tel)
{
// Definition du motif a matcher
var regex = new RegExp(/^(01|02|03|04|05|06|08|09)[0-9]{8}/gi);

// Definition de la variable booleene match
var match = false;

// Test sur le motif
if(regex.test(num_tel))
{
match = true;
}
else
{
match = false;
}

// On renvoie match
return match;
} 
function CheckDate(d) {
      // Cette fonction vérifie le format JJ/MM/AAAA saisi et la validité de la date.
      // Le séparateur est défini dans la variable separateur
      var amin=1900; // année mini
      var amax=1993; // année maxi
      var separateur="/"; // separateur entre jour/mois/annee
      var j=(d.substring(0,2));
      var m=(d.substring(3,5));
      var a=(d.substring(6));
      var ok=1;
      if ( ((isNaN(j))||(j<1)||(j>31)) && (ok==1) ) {
         //alert("Le jour n'est pas correct.");
		 ok=0;
      }
      if ( ((isNaN(m))||(m<1)||(m>12)) && (ok==1) ) {
         //alert("Le mois n'est pas correct.");
		 ok=0;
      }
      if ( ((isNaN(a))||(a<amin)||(a>amax)) && (ok==1) ) {
         //alert("L'année n'est pas correcte.");
		 ok=0;
      }
      if ( ((d.substring(2,3)!=separateur)||(d.substring(5,6)!=separateur)) && (ok==1) ) {
         //alert("Les séparateurs doivent être des "+separateur);
		 ok=0;
      }
      if (ok==1) {
         var d2=new Date(a,m-1,j);
         j2=d2.getDate();
         m2=d2.getMonth()+1;
         a2=d2.getFullYear();
         if (a2<=100) {a2=1900+a2}
         if ( (j!=j2)||(m!=m2)||(a!=a2) ) {
            //alert("La date "+d+" n'existe pas !");
            ok=0;
         }
      }
      return ok;
   }