//script login

function veriform(){
  Err=0;
  
  /*----------PAS DE CARACTERE SPECIAUX DANS LE CODE AGENCE--------- */
  codagence=document.Identification.Login_1.value.toLowerCase();
    if ( ( (codagence.charAt(0)=='²')||(codagence.charAt(0)=='&')||(codagence.charAt(0)=='é')||(codagence.charAt(0)=='~')
  ||(codagence.charAt(0)=='"')||(codagence.charAt(0)=='\'')||(codagence.charAt(0)=='{')||(codagence.charAt(0)=='(')
  ||(codagence.charAt(0)=='[')||(codagence.charAt(0)=='-')||(codagence.charAt(0)=='|')||(codagence.charAt(0)=='è')
  ||(codagence.charAt(0)=='`')||(codagence.charAt(0)=='\\')||(codagence.charAt(0)=='ç')||(codagence.charAt(0)=='^')
  ||(codagence.charAt(0)=='à')||(codagence.charAt(0)=='@')||(codagence.charAt(0)==')')||(codagence.charAt(0)=='°')
  ||(codagence.charAt(0)==']')||(codagence.charAt(0)=='$')||(codagence.charAt(0)=='£')||(codagence.charAt(0)=='¤')
  ||(codagence.charAt(0)=='%')||(codagence.charAt(0)=='ù')||(codagence.charAt(0)=='*')||(codagence.charAt(0)=='µ')
  ||(codagence.charAt(0)==',')||(codagence.charAt(0)==';')||(codagence.charAt(0)=='.')||(codagence.charAt(0)=='/')
  ||(codagence.charAt(0)==':')||(codagence.charAt(0)=='.')||(codagence.charAt(0)=='!')||(codagence.charAt(0)=='§')
  ||(codagence.charAt(0)=='}')||(codagence.charAt(0)=='=')||(codagence.charAt(0)=='+')||(codagence.charAt(0)=='_')
  ||(codagence.charAt(0)=='?')||(codagence.charAt(0)=='§')||(codagence.charAt(0)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 1");
  document.Identification.Login_1.value="";
  document.Identification.Login_1.focus();

  Err=1;
  }
    if ( ( (codagence.charAt(1)=='²')||(codagence.charAt(1)=='&')||(codagence.charAt(1)=='é')||(codagence.charAt(1)=='~')
  ||(codagence.charAt(1)=='"')||(codagence.charAt(1)=='\'')||(codagence.charAt(1)=='{')||(codagence.charAt(1)=='(')
  ||(codagence.charAt(1)=='[')||(codagence.charAt(1)=='-')||(codagence.charAt(1)=='|')||(codagence.charAt(1)=='è')
  ||(codagence.charAt(1)=='`')||(codagence.charAt(1)=='\\')||(codagence.charAt(1)=='ç')||(codagence.charAt(1)=='^')
  ||(codagence.charAt(1)=='à')||(codagence.charAt(1)=='@')||(codagence.charAt(1)==')')||(codagence.charAt(1)=='°')
  ||(codagence.charAt(1)==']')||(codagence.charAt(1)=='$')||(codagence.charAt(1)=='£')||(codagence.charAt(1)=='¤')
  ||(codagence.charAt(1)=='%')||(codagence.charAt(1)=='ù')||(codagence.charAt(1)=='*')||(codagence.charAt(1)=='µ')
  ||(codagence.charAt(1)==',')||(codagence.charAt(1)==';')||(codagence.charAt(1)=='.')||(codagence.charAt(1)=='/')
  ||(codagence.charAt(1)==':')||(codagence.charAt(1)=='.')||(codagence.charAt(1)=='!')||(codagence.charAt(1)=='§')
  ||(codagence.charAt(1)=='}')||(codagence.charAt(1)=='=')||(codagence.charAt(1)=='+')||(codagence.charAt(1)=='_')
  ||(codagence.charAt(1)=='?')||(codagence.charAt(1)=='§')||(codagence.charAt(1)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 1");
  document.Identification.Login_1.value="";
  document.Identification.Login_1.focus();

  Err=1;
  }
  
  /*----------PAS DE LETTRE DANS LE CODE AGENCE--------- */
  
  codagence=document.Identification.Login_1.value.toUpperCase();
   

    /*----------PAS DE CARACTERE SPECIAUX DANS LE CODE MATRICULE--------- */
  codematr=document.Identification.Login_2.value.toLowerCase();
    if ( ( (codematr.charAt(0)=='²')||(codematr.charAt(0)=='&')||(codematr.charAt(0)=='é')||(codematr.charAt(0)=='~')
  ||(codematr.charAt(0)=='"')||(codematr.charAt(0)=='\'')||(codematr.charAt(0)=='{')||(codematr.charAt(0)=='(')
  ||(codematr.charAt(0)=='[')||(codematr.charAt(0)=='-')||(codematr.charAt(0)=='|')||(codematr.charAt(0)=='è')
  ||(codematr.charAt(0)=='`')||(codematr.charAt(0)=='\\')||(codematr.charAt(0)=='ç')||(codematr.charAt(0)=='^')
  ||(codematr.charAt(0)=='à')||(codematr.charAt(0)=='@')||(codematr.charAt(0)==')')||(codematr.charAt(0)=='°')
  ||(codematr.charAt(0)==']')||(codematr.charAt(0)=='$')||(codematr.charAt(0)=='£')||(codematr.charAt(0)=='¤')
  ||(codematr.charAt(0)=='%')||(codematr.charAt(0)=='ù')||(codematr.charAt(0)=='*')||(codematr.charAt(0)=='µ')
  ||(codematr.charAt(0)==',')||(codematr.charAt(0)==';')||(codematr.charAt(0)=='.')||(codematr.charAt(0)=='/')
  ||(codematr.charAt(0)==':')||(codematr.charAt(0)=='.')||(codematr.charAt(0)=='!')||(codematr.charAt(0)=='§')
  ||(codematr.charAt(0)=='}')||(codematr.charAt(0)=='=')||(codematr.charAt(0)=='+')||(codematr.charAt(0)=='_')
  ||(codematr.charAt(0)=='?')||(codematr.charAt(0)=='§')||(codematr.charAt(0)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 2");
  document.Identification.Login_2.focus();
  document.Identification.Login_2.value="";
  Err=1;
  }
    if ( ( (codematr.charAt(1)=='²')||(codematr.charAt(1)=='&')||(codematr.charAt(1)=='é')||(codematr.charAt(1)=='~')
  ||(codematr.charAt(1)=='"')||(codematr.charAt(1)=='\'')||(codematr.charAt(1)=='{')||(codematr.charAt(1)=='(')
  ||(codematr.charAt(1)=='[')||(codematr.charAt(1)=='-')||(codematr.charAt(1)=='|')||(codematr.charAt(1)=='è')
  ||(codematr.charAt(1)=='`')||(codematr.charAt(1)=='\\')||(codematr.charAt(1)=='ç')||(codematr.charAt(1)=='^')
  ||(codematr.charAt(1)=='à')||(codematr.charAt(1)=='@')||(codematr.charAt(1)==')')||(codematr.charAt(1)=='°')
  ||(codematr.charAt(1)==']')||(codematr.charAt(1)=='$')||(codematr.charAt(1)=='£')||(codematr.charAt(1)=='¤')
  ||(codematr.charAt(1)=='%')||(codematr.charAt(1)=='ù')||(codematr.charAt(1)=='*')||(codematr.charAt(1)=='µ')
  ||(codematr.charAt(1)==',')||(codematr.charAt(1)==';')||(codematr.charAt(1)=='.')||(codematr.charAt(1)=='/')
  ||(codematr.charAt(1)==':')||(codematr.charAt(1)=='.')||(codematr.charAt(1)=='!')||(codematr.charAt(1)=='§')
  ||(codematr.charAt(1)=='}')||(codematr.charAt(1)=='=')||(codematr.charAt(1)=='+')||(codematr.charAt(1)=='_')
  ||(codematr.charAt(1)=='?')||(codematr.charAt(1)=='§')||(codematr.charAt(1)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 2");
  document.Identification.Login_2.focus();
  document.Identification.Login_2.value="";
  Err=1;
  }
    if ( ( (codematr.charAt(2)=='²')||(codematr.charAt(2)=='&')||(codematr.charAt(2)=='é')||(codematr.charAt(2)=='~')
  ||(codematr.charAt(2)=='"')||(codematr.charAt(2)=='\'')||(codematr.charAt(2)=='{')||(codematr.charAt(2)=='(')
  ||(codematr.charAt(2)=='[')||(codematr.charAt(2)=='-')||(codematr.charAt(2)=='|')||(codematr.charAt(2)=='è')
  ||(codematr.charAt(2)=='`')||(codematr.charAt(2)=='\\')||(codematr.charAt(2)=='ç')||(codematr.charAt(2)=='^')
  ||(codematr.charAt(2)=='à')||(codematr.charAt(2)=='@')||(codematr.charAt(2)==')')||(codematr.charAt(2)=='°')
  ||(codematr.charAt(2)==']')||(codematr.charAt(2)=='$')||(codematr.charAt(2)=='£')||(codematr.charAt(2)=='¤')
  ||(codematr.charAt(2)=='%')||(codematr.charAt(2)=='ù')||(codematr.charAt(2)=='*')||(codematr.charAt(2)=='µ')
  ||(codematr.charAt(2)==',')||(codematr.charAt(2)==';')||(codematr.charAt(2)=='.')||(codematr.charAt(2)=='/')
  ||(codematr.charAt(2)==':')||(codematr.charAt(2)=='.')||(codematr.charAt(2)=='!')||(codematr.charAt(2)=='§')
  ||(codematr.charAt(2)=='}')||(codematr.charAt(2)=='=')||(codematr.charAt(2)=='+')||(codematr.charAt(2)=='_')
  ||(codematr.charAt(2)=='?')||(codematr.charAt(2)=='§')||(codematr.charAt(2)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 2");
  document.Identification.Login_2.focus();
  document.Identification.Login_2.value="";
  Err=1;
  }
    if ( ( (codematr.charAt(3)=='²')||(codematr.charAt(3)=='&')||(codematr.charAt(3)=='é')||(codematr.charAt(3)=='~')
  ||(codematr.charAt(3)=='"')||(codematr.charAt(3)=='\'')||(codematr.charAt(3)=='{')||(codematr.charAt(3)=='(')
  ||(codematr.charAt(3)=='[')||(codematr.charAt(3)=='-')||(codematr.charAt(3)=='|')||(codematr.charAt(3)=='è')

  ||(codematr.charAt(3)=='`')||(codematr.charAt(3)=='\\')||(codematr.charAt(3)=='ç')||(codematr.charAt(3)=='^')
  ||(codematr.charAt(3)=='à')||(codematr.charAt(3)=='@')||(codematr.charAt(3)==')')||(codematr.charAt(3)=='°')
  ||(codematr.charAt(3)==']')||(codematr.charAt(3)=='$')||(codematr.charAt(3)=='£')||(codematr.charAt(3)=='¤')
  ||(codematr.charAt(3)=='%')||(codematr.charAt(3)=='ù')||(codematr.charAt(3)=='*')||(codematr.charAt(3)=='µ')
  ||(codematr.charAt(3)==',')||(codematr.charAt(3)==';')||(codematr.charAt(3)=='.')||(codematr.charAt(3)=='/')
  ||(codematr.charAt(3)==':')||(codematr.charAt(3)=='.')||(codematr.charAt(3)=='!')||(codematr.charAt(3)=='§')
  ||(codematr.charAt(3)=='}')||(codematr.charAt(3)=='=')||(codematr.charAt(3)=='+')||(codematr.charAt(3)=='_')
  ||(codematr.charAt(3)=='?')||(codematr.charAt(3)=='§')||(codematr.charAt(3)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 2");
  document.Identification.Login_2.focus();
  document.Identification.Login_2.value="";
  Err=1;
  }
    if ( ( (codematr.charAt(4)=='²')||(codematr.charAt(4)=='&')||(codematr.charAt(4)=='é')||(codematr.charAt(4)=='~')
  ||(codematr.charAt(4)=='"')||(codematr.charAt(4)=='\'')||(codematr.charAt(4)=='{')||(codematr.charAt(4)=='(')
  ||(codematr.charAt(4)=='[')||(codematr.charAt(4)=='-')||(codematr.charAt(4)=='|')||(codematr.charAt(4)=='è')
  ||(codematr.charAt(4)=='`')||(codematr.charAt(4)=='\\')||(codematr.charAt(4)=='ç')||(codematr.charAt(4)=='^')
  ||(codematr.charAt(4)=='à')||(codematr.charAt(4)=='@')||(codematr.charAt(4)==')')||(codematr.charAt(4)=='°')
  ||(codematr.charAt(4)==']')||(codematr.charAt(4)=='$')||(codematr.charAt(4)=='£')||(codematr.charAt(4)=='¤')
  ||(codematr.charAt(4)=='%')||(codematr.charAt(4)=='ù')||(codematr.charAt(4)=='*')||(codematr.charAt(4)=='µ')
  ||(codematr.charAt(4)==',')||(codematr.charAt(4)==';')||(codematr.charAt(4)=='.')||(codematr.charAt(4)=='/')
  ||(codematr.charAt(4)==':')||(codematr.charAt(4)=='.')||(codematr.charAt(4)=='!')||(codematr.charAt(4)=='§')
  ||(codematr.charAt(4)=='}')||(codematr.charAt(4)=='=')||(codematr.charAt(4)=='+')||(codematr.charAt(4)=='_')
  ||(codematr.charAt(4)=='?')||(codematr.charAt(4)=='§')||(codematr.charAt(4)=='#') )&& (Err==0) ){
  window.alert("Pas de caractère(s) dans le code salarié 2");
  document.Identification.Login_2.focus();
  document.Identification.Login_2.value="";
  Err=1;
  }
  
  
  /*----------PAS DE LETTRE DANS LE CODE MATRICULE--------- */
  codematr=document.Identification.Login_2.value.toUpperCase();
  
  
  /*--------------SAISIE DE TOUT LES CHAMPS---------------- */
      
  if ((document.Identification.Login_1.value=="")&&(Err==0))
  {
    window.alert("Vous devez introduire votre code salarié.");
    document.Identification.Login_1.focus();
    Err=1;
  }
  
  if ((document.Identification.Login_2.value=="")&&(Err==0))
  {
    window.alert("Vous devez introduire tout le code salarié.");
    document.Identification.Login_2.focus();
    Err=1;
  }
  
  if((codagence.length<1)&&(Err==0)){
  //window.alert("Le code salarié est incomplet.");
  //document.Identification.Login_1.focus();
  //Err=1;
  }
  
  if((codematr.length<5) &&(Err==0)){
  //window.alert("Le code salarié est incomplet.");
  //document.Identification.Login_2.focus();
  //Err=1;
  }
  
  
  if (Err==0)
  {
  //si on veut manipuler la date dans le javascript
  //var m=document.Identification.Annee_naissance.value;alert("m : "+String(m).substring(2,4)); 
  //document.Identification.Annee_naissance.value=String(m).substring(2,4);
  document.Identification.submit();
  }

}
