// JavaScript Document
      
      function couleur(obj) {
      obj.style.backgroundColor = "#FFFFFF";
      }
      
      function ouvre_popup(page) {
       window.open(page,"PopUp","menubar=no, status=no, toolbar=no, location=no, scrollbars=no, resizable=no menubar=no, width=600, height=350");
      }
      
      function ouvre_popup2(page) {
       window.open(page,"PopUp","menubar=no, status=no, toolbar=no, location=no, scrollbars=yes, resizable=no menubar=no, width=1100, height=600");
      }
      
      function check() {
      	var msg = "";
      
      		if (document.formulaire.email.value != "")	{
      		indexAroba = document.formulaire.email.value.indexOf('@');
      		indexPoint = document.formulaire.email.value.indexOf('.');
      		if ((indexAroba < 0) || (indexPoint < 0))		{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      			msg += "Le mail est incorrect\n";
      		}
      	}
      	else	{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      		msg += "Veuillez saisir votre mail.\n";
      	}
      
      if (document.formulaire.message.value == "")	{
      		msg += "Veuillez saisir un message\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
      	
      	if (msg == "") return(true);
      	else	{
      		alert(msg);
      		return(false);
      	}
      }


      function check2() {
      	var msg = "";
      
      		if (document.form_ins.email.value != "")	{
      		indexAroba = document.form_ins.email.value.indexOf('@');
      		indexPoint = document.form_ins.email.value.indexOf('.');
      		if ((indexAroba < 0) || (indexPoint < 0))		{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      			msg += "Le mail est incorrect\n";
      		}
      	}
      	else	{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      		msg += "Veuillez saisir votre mail.\n";
      	}
      
      if (document.form_ins.postal.value == "")	{
      		msg += "Veuillez saisir un code postal\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
      
      if (document.form_ins.association.value == 0)	{
      		msg += "Veuillez choisir une association\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
      	
      if(document.form_ins.checkbox.checked == false){
		   msg += "Veuillez cocher les conditions g\351n\351rales d'utilisation\n";
	    }
      	
      	if (msg == "") return(true);
      	else	{
      		alert(msg);
      		return(false);
      	}
      }
      
      function verif(){
    var date_pas_sure = document.getElementById('valeur').value;
    var format = /^(\d{1,2}\/){2}\d{4}$/;
    if(!format.test(date_pas_sure)){alert('Date non valable !')}
    else{
        var date_temp = date_pas_sure.split('/');
        date_temp[1] -=1;        // On rectifie le mois !!!
        var ma_date = new Date();
        ma_date.setFullYear(date_temp[2]);
        ma_date.setMonth(date_temp[1]);
        ma_date.setDate(date_temp[0]);
        if(ma_date.getFullYear()==date_temp[2] && ma_date.getMonth()==date_temp[1] && ma_date.getDate()==date_temp[0]){
            alert('Date valable !');
        }
        else{
            alert('Date non valable !');
        }
    }
}
    
    function verif_nombre(champ)
      {
    	var chiffres = new RegExp("[0-9]");
    	var verif;
    	var points = 0;
     
    	for(x = 0; x < champ.value.length; x++)
    	{
                verif = chiffres.test(champ.value.charAt(x));
    	    if(champ.value.charAt(x) == "."){points++;}
                if(points > 1){verif = false; points = 1;}
      	    if(verif == false){champ.value = champ.value.substr(0,x) + champ.value.substr(x+1,champ.value.length-x+1); x--;}
    	}
      }

      function check3() {
      	var msg = "";
        var date_pas_sure = document.form_insc.naissance.value;
        var format = /^(\d{1,2}\/){2}\d{4}$/;
        
      		if (document.form_insc.email.value != "")	{
      		indexAroba = document.form_insc.email.value.indexOf('@');
      		indexPoint = document.form_insc.email.value.indexOf('.');
      		if ((indexAroba < 0) || (indexPoint < 0))		{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      			msg += "Le mail est incorrect\n";
      		}
      	}
      	else	{
      		//document.formulaire.email.style.backgroundColor = "#EF5858";
      		msg += "Veuillez saisir votre mail.\n";
      	}
      
      if (document.form_insc.association.value == 0)	{
      		msg += "Veuillez choisir une association\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
      
      if(!format.test(date_pas_sure)){msg += "Date de naissance invalide.\n";}
      	
      if ((document.form_insc.postal.value == "") || (document.form_insc.postal.value == "Code Postal *"))	{
      		msg += "Veuillez saisir un code postal\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
           	
      if (document.form_insc.naissance.value == "")	{
      		msg += "Veuillez saisir votre date de naissance\n";
      		//document.formulaire.message.style.backgroundColor = "#EF5858";
      	}
     	
      if(document.form_insc.checkbox.checked == false){
		   msg += "Veuillez cocher les conditions g\351n\351rales d'utilisation\n";
	    }
      	
      	if (msg == "") return(true);
      	else	{
      		alert(msg);
      		return(false);
      	}
      }
