<!--

function form_Validator(theForm)
{
	
// test choix sexe
  var radioSelected = false;
  for (i = 0;  i < theForm.civilite.length;  i++)
  {
    if (theForm.civilite[i].checked)
        radioSelected = true;
  }  
  if (!radioSelected)
  {
    alert("Veuillez indiquer votre civilité, SVP.");
    return (false);
  }
  // test prenom
 if (theForm.prenom.value == "")
  {
    alert("Veuillez indiquer votre prénom, SVP.");
    theForm.prenom.focus();
    return (false);
  }
  // test nom	
 if (theForm.nom.value == "")
  {
    alert("Veuillez indiquer votre nom, SVP.");
    theForm.nom.focus();
    return (false);
  }
  
// verif mail ******************************************************
 if (theForm.email.value == "")
  {
    alert("Veuillez indiquer votre adresse mail, SVP.");
    theForm.email.focus();
	//theForm.email.style.backgroundColor = "#D10707";
    return (false);
  }

// test adresse mail sur à et .
  var checkemail = "@.";
  var checkStr = theForm.email.value;
  var emailValid = false;
  var emailAt = false;
  var emailPeriod = false;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkemail.length;  j++)
    {
      if (ch == checkemail.charAt(j) && ch == "@")
        emailAt = true;
      if (ch == checkemail.charAt(j) && ch == ".")
        emailPeriod = true;
	  if (emailAt && emailPeriod)
		break;
	  if (j == checkemail.length)
		break;
	}
    if (emailAt && emailPeriod)
    {
		emailValid = true
		break;
	}
  }
  if (!emailValid)
  {
    alert("Veuillez indiquer une adresse e-mail valide, SVP.");
    theForm.email.focus();
    return (false);
  }
  
 
// test heure début ************************************************
  if (theForm.Hdebut.selectedIndex <= 0)
  {
    alert("Veuillez indiquer à partir de quelle heure\nvous souhaitez être joint, SVP.");
    theForm.Hdebut.focus();
    return (false);
  }
  
// test heure fin ************************************************
  if (theForm.Hfin.selectedIndex <= 0)
  {
    alert("Veuillez indiquer jusqu'à quelle heure\nvous souhaitez être joint, SVP.");
    theForm.Hfin.focus();
    return (false);
  }
// test telephone
 if (theForm.tel.value == "")
  {
    alert("Veuillez indiquer votre téléphone, SVP.");
    theForm.tel.focus();
    return (false);
  }
  
// test que des chiffres
  var checkOK = "0123456789";
  var checkStr = theForm.tel.value;
  var allValid = true;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Le téléphone ne peut comporter que des chiffres !");
    theForm.tel.focus();
    return (false);
  }
  
  
// test des cases à cocher que si on est pas sur Mac *********************************************
// ***********************************************************************************************
 var APP=navigator.appName;
 var VERS=parseFloat(navigator.appVersion);
 if (navigator.appVersion.indexOf("Mac") == -1) {
	 
	 // test produit *****************************************************
  	var checkSelected = false;
  	for (i = 0;  i < theForm.produit.length;  i++)
  	{
  	if (theForm.produit[i].checked)
  	checkSelected = true;
  	}
  	if (!checkSelected)
  	{
  	alert("Veuillez indiquer au moins un produit qui vous intéresse, SVP.");
  	return (false);
  	}
 }  // fin du if mac
// ***********************************************************************************************  
}
//-->

