<!--
var numb = '0123456789';
var lwr = 'abcdefghijklmnopqrstuvwxyz';
var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var ok = 'éçèàùëËïÏÎîêÊäÄâÂ .,;!$£€';  
 
function isValid(parm,val) {
//alert(parm); 
  if (parm == "") return false;
  for (i=0; i<parm.length; i++) {
     
    if (val.indexOf(parm.charAt(i),0) == -1) return false;
  }
  return true;
}
 
function isNum(parm) {return isValid(parm,numb);}
function isLower(parm) {return isValid(parm,lwr);}
function isUpper(parm) {return isValid(parm,upr);}
function isAlpha(parm) {return isValid(parm,lwr+upr);}
function isAlphanum(parm) {return isValid(parm,lwr+upr+numb);}
function isAlphanumPlus(parm) {return isValid(parm,lwr+upr+numb+ok);}

function testChamps(champ){
         //alert(champ.value);
  if(!isAlphanum(champ.value)){
  champ.value = "";       
}
}
function testPrenom(champ){
         //alert(champ.value);
  if(!isAlphanumPlus(champ.value)){
  champ.value = "";       
}
}
  




function verification(){

    var msg = "";
    var pseudo = document.getElementById("envoiforminscription").pseudo.value;
    var password1 = document.getElementById("envoiforminscription").password1.value;
    var password2 = document.getElementById("envoiforminscription").password2.value;
    var pseudoexistant = "";
    if(pseudo == ""){
        msg = "Vous devez mettre un pseudonyme";
    }
    if(password1 != password2){
        msg = "Les deux mots de passe doivent être identique";
    }
    
    if((password1.length  <= 4)||(password2.length  <= 4)){
        msg = "Le mot de passe doit faire au minimum 5 caractères.";
    }
    if(isset(document.getElementById("pseudoBDD"))){
        pseudoexistant = document.getElementById("pseudoBDD").src;
    }
    long = pseudoexistant.length;
    pseudoexistant = pseudoexistant.substring(long-10,long);
    if(document.getElementById("testDemaps").innerHTML != document.getElementById("reponse").value){
        msg = "Vous n'avez pas entré le bon numéro";
    }
    if(pseudoexistant  != "valide.png"){
        msg = "Ce compte existe déjà";
    }
    if(msg != ""){
        alert(msg);
    }else{
        document.getElementById("envoiforminscription").submit();
    }
}
function testSpam(){
    var magic = parseInt(1000+(Math.random())*4253);
	document.getElementById("tesst").value = magic;
    document.getElementById("testDemaps").innerHTML = magic;
}
function testpseudo(){ 
            
            var xhr = null;
            
            /*try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
            catch (e) 
            {
                try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
                catch (e2) 
                {
                  try {  xhr = new XMLHttpRequest();     }
                  catch (e3) {  xhr = false;   }
                }
             }*/
                     if (window.XMLHttpRequest)                 //  Objet de la fenêtre courant
                { 
                    xhr = new XMLHttpRequest();     //  Firefox, Safari, ...
                } 
                else 
                   if (window.ActiveXObject)                    //  Version Active
                   {
                      xhr = new ActiveXObject("Microsoft.XMLHTTP");   // Internet Explorer 
                   }
                 
            xhr.onreadystatechange  = function()
            { 
                 if(xhr.readyState  == 4)
                 {
                      if(xhr.status  == 200){ 
                         document.getElementById("resultatpseudo").innerHTML =  xhr.responseText;
                        /* obj.style.backgroundColor = xhr.responseText;*/
                        
                         
                         //<input type="text" name="envoye" />
                      } 
                      else{
                         //document.forms[0].envoye.value="Error code " + xhr.status;
                      }
                 }
            }; 
           xhr.open( "POST", "verifpseudo.php",  true);
           xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
           xhr.send("pseudo="+document.getElementById("envoiforminscription").pseudo.value);

}
function isset(  ) {
     // http://kevin.vanzonneveld.net
     // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: FremyCompany
     // +   improved by: Onno Marsman
    // *     example 1: isset( undefined, true);
     // *     returns 1: false
     // *     example 2: isset( 'Kevin van Zonneveld' );
      // *     returns 2: true
    
    var a=arguments; var l=a.length; var i=0;
    
      if (l==0) {
         throw new Error('Empty isset');
     }
    
       while (i!=l) {
         if (typeof(a[i])=='undefined' || a[i]===null) {
               return false;
          } else {
              i++;
           }
       }
       return true;
}
function IsMail(email){
    return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email));
}

function verificationFormulaireContact(){

    var msg = "";
    var pseudo = document.getElementById("contact").pseudo.value;
    var pseudoexistant = "";
    

    if(pseudo == ""){
        msg = "Vous devez mettre votre prénom";
    }
    
    if(!IsMail(document.getElementById("mail").value)){
       msg = "Votre adresse mail n'est pas valide";                                                 
    }
    
    if(document.getElementById("testDemaps").innerHTML != document.getElementById("reponse").value){
        msg = "Vous n'avez pas entré le bon numéro";
    }
    
    

    
    if(msg != ""){
        alert(msg);
    }else{
        document.getElementById("contact").submit();
        alert('Votre message à bien été envoyé.');
    }
}
-->