/********************************************************************/
/* Vérification de la saisie des mots-clés pour recherches de liens */
/********************************************************************/

function Verif_Lien(NomForm,Mot,Cas)
{
 var Correct=true;
 var Msg1="Je suis désolé,\n";
 var Msg3=".\n\nMerci de votre compréhension";
 Mot=Mot.toLowerCase();
 if (
     ((NomForm=='ChercherSite')&&(Mot.length<12))
     &&
     (
      (
       (Mot.indexOf('http')!=-1)
       ||
       (Mot.indexOf('www')!=-1)
      )
     )
    )
 {
  Correct=false;
  MsgErr=Msg1+'cette adresse ('+Mot+') est trop courte pour être traitée.'+Msg3;
  alert(MsgErr);
  //document.NomForm.MotLien.value=Mot;
  document.NomForm.MotLien.focus();
  return false;
 }
 if ((Correct==true)&&(Mot.length<3))
 {
  Correct=false;
  MsgErr=Msg1+' ce mot est trop court (3 car. minimum)'+Msg3;
  alert(MsgErr);
  //document.NomForm.MotLien.value=Mot;
  document.NomForm.MotLien.focus();
  return false;
 }
 
 if ((Correct==true)&&((Mot=='lien')||(Mot=='site')||(Mot.indexOf('http')!=-1)||(Mot.indexOf('www')!=-1)))
 {
  Correct=false;
  MsgErr=Msg1+' ce mot est trop répandu ...'+Msg3;
  alert(MsgErr);
  document.NomForm.MotLien.value=Mot;
  document.NomForm.MotLien.focus();
  return false;
 }
 
 
 if (Correct==true)
 {
  location.href='Liens.php?k='+Cas+'&ds=&dl=&ed=&lg=&m='+document.NomForm.MotLien.value+'&nc=Liens_MotsCles&np=&o=TitreSite&r=&th=1&ts=&tl=Recherches de liens philatéliques ou non<br />contenant le mot «'+document.NomForm.MotLien.value+'»&ty=1';
  document.NomForm.MotLien.value=Mot;
  document.NomForm.MotLien.focus();
  return true;
 }
 else
 return false;
}
