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 Form_Validator(theForm)
{

    if (theForm.firma.value == "")
 { 
    alert("Veuillez indiquer le nom de votre \"Société\".");
    theForm.firma.focus();
    return (false);
  }

  if (theForm.city.value == "")
 {
  alert("Veuillez indiquer votre \"NP Lieu\".");
  theForm.city.focus();
  return (false);
 }

   if (theForm.kundennr.value == "")
 { 
    alert("Veuillez indiquer votre \"N° de client\".");
    theForm.kundennr.focus();
    return (false);
  }

  if (theForm.forename.value == "")
 {
  alert("Veuillez indiquer votre \"Prénom\".");
  theForm.forename.focus();
  return (false);
 }

 if (theForm.surname.value == "")
 {
  alert("Veuillez indiquer votre \"Nom de famille\".");
  theForm.surname.focus();
  return (false);
 }
 
  if (theForm.email.value == "")
 { 
    alert("Veuillez indiquer votre \"Courriel\".");
    theForm.email.focus();
    return (false);
  }
   if (!isEmailAddr(theForm.email.value))
  {
    alert("Cette \"adresse courriel\" n'est pas valable!");
    theForm.email.focus();
    return (false);
  }

}
