// JavaScript Document
function isValidMail(mail)
{
	if (mail.length == 0)
		return false;
	else if (mail.length < 8)
		return false;
	if ( (mail.indexOf("@")>=0) && (mail.indexOf(".")>=0) ) 
		return true;
	else 
		return false;
}

  function valider_form(theForm) 
  {  
		if (theForm.champ1.value.length == 0)
		{
			alert("Les Champs marqué (*) sont obligatoires !");
			theForm.champ1.focus();
			return false;
		}
		if (theForm.champ2.value.length == 0)
		{
			alert("Les Champs marqué (*) sont obligatoires !");
			theForm.champ2.focus();
			return false;
		}
		if (theForm.champ3.value.length == 0)
		{
			alert("Les Champs marqué (*) sont obligatoires !");
			theForm.champ3.focus();
			return false;
		}
		if (!isValidMail(theForm.champ4.value))
		{
			alert("Adresse E-mail non valide !");
			theForm.champ4.focus()
			return false;
		}
		if (theForm.champ5.value.length < 6)
		{
			alert("Le mot de passe doit comporter au moins 6 caractères !");
			theForm.champ5.focus();
			return false;
		}
		if (theForm.champ5.value != theForm.champ6.value)
		{
			alert("Veuillez resaisir votre mot de passe");
			theForm.champ6.value="";
			theForm.champ6.focus();
			return false;
		}
    return true;
  }