function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
        result = true;
  }
  return result;
}

function FormValidator(theForm)
{

if(theForm.nom.value == "")
    {
     alert("Veuillez entrer votre nom!");
     document.formulaire.nom.focus();
     return false;
    }
  if (theForm.email.value == "")
  {
    alert("Veuillez entrer votre adresse ‚lectronique.");
    theForm.email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email.value))
  {
    alert("Veuillez entrez une adresse email complete du type : nom@domaine.com ");
    theForm.email.focus();
    return (false);
  }
   
  if (theForm.email.value.length < 3)
  {
    alert("Veuillez entrer au moins 3 caracters dans le champe email.");
    theForm.email.focus();
    return (false);
  }
  return (true);
}

