var envoyer;
envoyer = 0;

//+------------------------------------------+
//|    Formulaire d'authentification         |
//+------------------------------------------+


  function auth()
  {
  c1 = document.form.pp_test.value;

  verif = true;

    if(verif)
    {
      if(!c1 || c1=="")
      {
      alert ('Veuillez indiquer votre PASSWORD !');
      document.form.pp_test.focus ();
      document.form.pp_test.select ();
      verif = false;
      }
    }

    if(verif)
    envoyer++;

    if(verif && envoyer==1)
    document.form.submit();

  return verif;
  }


//+------------------------------------------+
//|    Formulaire d'ID invalide              |
//+------------------------------------------+

  function valid()
  {
  c1 = document.form.num.value;

  verif = true;

    if(verif)
    {
      if(!c1 || c1=="")
      {
      alert ('Veuillez indiquer votre ID !');
      document.form.num.focus ();
      document.form.num.select ();
      verif = false;
      }
    }

    if(verif)
    envoyer++;

    if(verif && envoyer==1)
    document.form.submit();

  return verif;
  }

//+------------------------------------------+
//|    Formulaire d'inscription              |
//+------------------------------------------+

  function inscription()
  {
  c1  = document.form.auteur.value;
  c2  = document.form.password.value;
  c3  = document.form.password2.value;

  verif = true;

    if(verif)
    {
      if(!c1 || c1=="")
      {
      alert ('Veuillez indiquer un AUTEUR (Pseudo) pour vos messages !');
      document.form.auteur.focus ();
      document.form.auteur.select ();
      verif = false;
      }
    }


    if(verif)
    {
      if(!c2 || c2=="")
      {
      alert ('Veuillez indiquer un PASSWORD !');
      document.form.password.focus ();
      document.form.password.select ();
      verif = false;
      }
    }

    if(verif)
    {
      if(c2 != c3)
      {
      alert ('PASSWORD différents !');
      document.form.password.focus ();
      document.form.password.select ();
      verif = false;
      }
    }

    if(verif)
    {
      if(c1.indexOf('\\') != -1 ||
         c1.indexOf('\"') != -1 ||
         c1.indexOf('\'') != -1 ||
         c1.indexOf('\`') != -1 )
      {
      alert ('Votre PSEUDO ne peut pas contenir les caractères suivants : \\\"\'\`');
      document.form.auteur.focus ();
      document.form.auteur.select ();
      verif = false;
      }
    }

    if(verif)
    {
      if(c2.indexOf('\\') != -1 ||
         c2.indexOf('\"') != -1 ||
         c2.indexOf('\'') != -1 ||
         c2.indexOf('\`') != -1 )
      {
      alert ('Votre PASSWORD ne peut pas contenir les caractères suivants : \\\"\'\`');
      document.form.password.focus ();
      document.form.password.select ();
      verif = false;
      }
    }

    if(verif)
    envoyer++;

    if(verif && envoyer==1)
    document.form.submit();

  return verif;
  }


//+------------------------------------------+
//|       Apercu..                           |
//+------------------------------------------+


  function previsu()
  {
  document.apercu.msg.value     = document.form.sign.value;

  format = document.form.sign_format.checked;
    if(format)
    document.apercu.format.value  = "1";
    else
    document.apercu.format.value  = "2";

  document.apercu.submit();
  }

