function isnumeric ( valeur )
{
   for (var i = 0; i < valeur.length; i++) 
   {
      var ch = valeur.substring(i, i + 1);
      if (ch < "0" || "9" < ch)
      {return false;}
   }
   return true;
}

function ValideFormIdent()
   {
   // controle de saisie de l identifiant d'annonce
   if (document.FormRechIdent.ID.value.replace(/[\s]/g,"")!='')
   {
     if (isnumeric(document.FormRechIdent.ID.value))
     {
       document.FormRechIdent.action = '/scripts/consult/annonce/detail.asp';
       document.FormRechIdent.submit();
     }
     else
     {
       document.FormRechIdent.ID.focus();
       if (document.FormRechIdent.L.value == '1')
           {alert("Veuillez entrer une valeur numérique.");}
       else {alert("Please, use numeric value.");}
     }
   }
}

function ValideForm()
{
   // controle de saisie de la ville(V) ou choix combo ville(I)
   if ((document.inputForm.V.value.replace(/[\s]/g,"")!='') ||
        (document.inputForm.I.value != ''))
   {
      document.inputForm.action = '/scripts/consult/rech/rech_simple.asp';
      document.inputForm.submit();
   }
   else
   {
      document.inputForm.V.focus();
      if (document.inputForm.L.value == '1')
      {
         alert("Veuillez choisir une destination.");
      }
      else
      {
         alert("Please, choose a destination.");
      }
   }
}
function ValideFormClient()
{
   // controle de saisie Matricule (CM) et téléphone (CT)
   if ( (document.inputFormClient.CM.value.replace(/[\s]/g,"")!='') && (document.inputFormClient.CT.value.replace(/[\s]/g,"")!='') )
   {
      document.inputFormClient.action = '/scripts/consult/annonce/liste_client.asp';
      document.inputFormClient.submit();
   }
   else
   {
      document.inputFormClient.CM.focus();
      if (document.inputFormClient.L.value == '1')
      {
         alert("Veuillez entrer un code client ET un numéro de téléphone.");
      }
      else
      {
         alert("Please, choose client code AND a telephone number.");
      }
   }
}
