var envoyer=0;


function TestPerso ()
{

var pass;
var npass;
var npassb;
var nemail;
var nurl;

var NbChar;
var NbCharMax;

    verif = true;

    pass=document.perso.pass.value;
    npass=document.perso.npass.value;
    npassb=document.perso.npassb.value;
    nemail=document.perso.nemail.value;
    nurl=document.perso.nurl.value;

    if(!pass)
    {
    alert ('Par mesure de sécurité, veuillez indiquer votre password actuel avant la modification de vos informations personnelles !');
    document.perso.pass.focus ();
    document.perso.pass.select ();
    verif = false;
    }


   if(verif)
   {
    if((!nemail) || ((nemail.indexOf('@')) == -1) || ((nemail.indexOf('.')) == -1))
    {
    alert ('Email invalide !');
    document.perso.nemail.focus ();
    document.perso.nemail.select ();
    verif = false;
    }
   }

   if(verif)
   {
   NbChar=nemail.length;
   NbCharMax=50;
    if(NbChar>NbCharMax)
    {
    alert ('Votre email comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.perso.nemail.focus ();
    document.perso.nemail.select ();
    verif = false;
    }
   }


   if(verif)
   {
    if(!nurl)
    {
    alert ('URL invalide !');
    document.perso.nurl.focus ();
    document.perso.nurl.select ();
    verif = false;
    }
   }

   if(verif)
   {
   NbChar=nurl.length;
   NbCharMax=50;
    if(NbChar>NbCharMax)
    {
    alert ('Votre URL comporte ' + NbChar + ' caractères ! \n'+'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.perso.nurl.focus ();
    document.perso.nurl.select ();
    verif = false;
    }
   }

   if(verif && npass)
   {
     if(npass!=npassb)
     {
     alert ('Nouveaux password différents !');
     document.perso.npass.focus ();
     document.perso.npass.select ();
     verif = false;
     }
   }

   if(verif)
   {
   NbChar=npass.length;
   NbCharMax=20;
    if(NbChar>NbCharMax)
    {
    alert ('Votre Password comporte ' + NbChar + ' caractères ! \n'+'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.perso.npass.focus ();
    document.perso.npass.select ();
    verif = false;
    }
   }

   if(verif)
   {
   envoyer++;
   }

   if(verif && envoyer==1)
   {
   document.perso.submit();
   }

   return verif;
}




function test ()
{
var nNom;
var nQuestion;
var nChoix1;
var nChoix2;
var nChoix3;
var nChoix4;
var nChoix5;
var nChoix6;

var NbChar;
var NbCharMax;

verif    = true;

nNom      = document.form1.nNom.value;
nQuestion = document.form1.nQuestion.value;
nChoix1   = document.form1.nChoix1.value;
nChoix2   = document.form1.nChoix2.value;
nChoix3   = document.form1.nChoix3.value;
nChoix4   = document.form1.nChoix4.value;
nChoix5   = document.form1.nChoix5.value;
nChoix6   = document.form1.nChoix6.value;



  if(!nNom && verif)
  {
  alert ('Veuillez indiquer le nom du sondage !');
  document.form1.nNom.focus ();
  document.form1.nNom.select ();
  verif = false;
  }

  if(verif)
  {
  NbChar=nNom.length;
  NbCharMax=50;
    if(NbChar>NbCharMax)
    {
    alert ('Le nom du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nNom.focus ();
    document.form1.nNom.select ();
    verif = false;
    }
  }


  if(!nQuestion && verif)
  {
  alert ('Veuillez indiquer une question !');
  document.form1.nQuestion.focus ();
  document.form1.nQuestion.select ();
  verif = false;
  }

  if(verif)
  {
  NbChar=nQuestion.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('La question du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nQuestion.focus ();
    document.form1.nQuestion.select ();
    verif = false;
    }
  }

  if(!nChoix1 && verif)
  {
  alert ('Veuillez indiquer au moins 1 choix !');
  document.form1.nChoix1.focus ();
  document.form1.nChoix1.select ();
  verif = false;
  }




  if(verif)
  {
  NbChar=nChoix1.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 1 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix1.focus ();
    document.form1.nChoix1.select ();
    verif = false;
    }
  }





  if(verif)
  {
  NbChar=nChoix2.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 2 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix2.focus ();
    document.form1.nChoix2.select ();
    verif = false;
    }
  }





  if(verif)
  {
  NbChar=nChoix3.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 3 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix3.focus ();
    document.form1.nChoix3.select ();
    verif = false;
    }
  }





  if(verif)
  {
  NbChar=nChoix4.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 4 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix4.focus ();
    document.form1.nChoix4.select ();
    verif = false;
    }
  }





  if(verif)
  {
  NbChar=nChoix5.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 5 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix5.focus ();
    document.form1.nChoix5.select ();
    verif = false;
    }
  }





  if(verif)
  {
  NbChar=nChoix6.length;
  NbCharMax=255;
    if(NbChar>NbCharMax)
    {
    alert ('Le choix 6 du sondage comporte ' + NbChar + ' caractères !\n' +'Le maximum est fixé à '+ NbCharMax +' caractères.');
    document.form1.nChoix6.focus ();
    document.form1.nChoix6.select ();
    verif = false;
    }
  }





  if(verif)
  {
  envoyer++;
  }

  if(verif && envoyer==1)
  {
  document.form1.submit();
  }

   return verif;

}


