<!--
// Validation Email.
function check_email(e) {
 ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
  for(i=0; i < e.length ;i++){
      if(ok.indexOf(e.charAt(i))<0){ 
        return (false);
      }	
  } 
  if (document.images) {
      re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
      re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
      if (!e.match(re) && e.match(re_two)) {
        return (-1);		
      } 
  }
}
// Suppression des intitulés des cases au clic (focus)
function FocusText(BoxName) {
	if (BoxName.value == BoxName.defaultValue)
	{
		BoxName.value = '';
	}
}
function BlurText(BoxName) {
	if (BoxName.value == '')
	{
		BoxName.value = BoxName.defaultValue;
	}
}
// TESTS proprement dit !
var compteur=0;
var pop_merci;
function check_form(f) { 


//NOM
if ((f.Nom.value.length < 2) || (f.Nom.value == "NOM*") || (f.Nom.value == "Surname")) {
alert("Merci d'indiquer votre nom");
f.Nom.focus();
if(document.all || document.getElementByID){
f.Nom.style.background = "#FFD5D5";
}
return (false);
}
//PRENOM
if ((f.Prenom.value.length < 2) || (f.Prenom.value == "Prenom*") || (f.Prenom.value == "Surname")) {
alert("Merci d'indiquer votre prénom");
f.Prenom.focus();
if(document.all || document.getElementByID){
f.Prenom.style.background = "#FFD5D5";
}
return (false);
}
//ADRESSE
if ((f.Adresse.value.length < 5) || (f.Adresse.value == "Adresse*")) {
alert("Merci d'indiquer votre adresse");
f.Adresse.focus();
if(document.all || document.getElementByID){
f.Adresse.style.background = "#FFD5D5";
}
return (false);
}
//CODE POSTAL
if ((f.CodePostal.value.length < 5) || (f.CodePostal.value == "Code postal*")) {
alert("Merci d'indiquer votre code postal");
f.CodePostal.focus();
if(document.all || document.getElementByID){
f.CodePostal.style.background = "#FFD5D5";
}
return (false);
}
//VILLE
if ((f.Ville.value.length < 2) || (f.Ville.value == "Ville*")) {
alert("Merci d'indiquer votre ville");
f.Ville.focus();
if(document.all || document.getElementByID){
f.Ville.style.background = "#FFD5D5";
}
return (false);
}
//Pays
if ((f.Pays.value.length < 2) || (f.Pays.value == "Pays*")) {
alert("Merci d'indiquer votre pays");
f.Pays.focus();
if(document.all || document.getElementByID){
f.Pays.style.background = "#FFD5D5";
}
return (false);
}


// TEST DOUBLE-ENVOIE !!! [Fonctionne en ligne car temps + long!]
if (compteur == 0){
compteur++;
//pop_merci=window.open("../merci.html","merci","width=280,height=160,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
return true;
}
else{
//alert("Transmission en cours!\n \nTransmission in progress!");
return false;
}
return (true);
}
//-->
function check_form2(f) { 


//NOM
if ((f.Nom.value.length < 2) || (f.Nom.value == "NOM*") || (f.Nom.value == "Surname")) {
alert("Merci d'indiquer votre nom");
f.Nom.focus();
if(document.all || document.getElementByID){
f.Nom.style.background = "#FFD5D5";
}
return (false);
}
//PRENOM
if ((f.Prenom.value.length < 2) || (f.Prenom.value == "Prenom*") || (f.Prenom.value == "Surname")) {
alert("Merci d'indiquer votre prénom");
f.Prenom.focus();
if(document.all || document.getElementByID){
f.Prenom.style.background = "#FFD5D5";
}
return (false);
}

//ADRESSE
if ((f.Adresse.value.length < 5) || (f.Adresse.value == "Adresse*")) {
alert("Merci d'indiquer votre adresse");
f.Adresse.focus();
if(document.all || document.getElementByID){
f.Adresse.style.background = "#FFD5D5";
}
return (false);
}
//CODE POSTAL
if ((f.CodePostal.value.length < 5) || (f.CodePostal.value == "Code postal*")) {
alert("Merci d'indiquer votre code postal");
f.CodePostal.focus();
if(document.all || document.getElementByID){
f.CodePostal.style.background = "#FFD5D5";
}
return (false);
}
//VILLE
if ((f.Ville.value.length < 2) || (f.Ville.value == "Ville*")) {
alert("Merci d'indiquer votre ville");
f.Ville.focus();
if(document.all || document.getElementByID){
f.Ville.style.background = "#FFD5D5";
}
return (false);
}
//Pays
if ((f.Pays.value.length < 2) || (f.Pays.value == "Pays*")) {
alert("Merci d'indiquer votre pays");
f.Pays.focus();
if(document.all || document.getElementByID){
f.Pays.style.background = "#FFD5D5";
}
return (false);
}


//ETUDE
if ( (f.etude.value == "0")) {
alert("Merci d'indiquer votre niveau d'étude");
f.etude.focus();
if(document.all || document.getElementByID){
f.etude.style.background = "#FFD5D5";
}
return (false);
}

//ETUDE
if ( (f.day.value == "0")) {
alert("Merci d'indiquer une date de naissance valide");
f.day.focus();
if(document.all || document.getElementByID){
f.day.style.background = "#FFD5D5";
}
return (false);
}
if ( (f.month.value == "0")) {
alert("Merci d'indiquer une date de naissance valide");
f.month.focus();
if(document.all || document.getElementByID){
f.month.style.background = "#FFD5D5";
}
return (false);
}
if ( (f.year.value == "0")) {
alert("Merci d'indiquer une date de naissance valide");
f.year.focus();
if(document.all || document.getElementByID){
f.year.style.background = "#FFD5D5";
}
return (false);
}
if ( (f.comment.value == "0")) {
alert("Merci d'indiquer comment vous avez connu l'ESO");
f.comment.focus();
if(document.all || document.getElementByID){
f.comment.style.background = "#FFD5D5";
}
return (false);
}

// TEST DOUBLE-ENVOIE !!! [Fonctionne en ligne car temps + long!]
if (compteur == 0){
compteur++;
//pop_merci=window.open("../merci.html","merci","width=280,height=160,top=0,left=0,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
return true;
}
else{
//alert("Transmission en cours!\n \nTransmission in progress!");
return false;
}
return (true);
}