  function valider_form_avance(theForm)  
  {  
  
		if (theForm.nom.value.length == 0)
		{
			alert("Les champs marqué * sont obligatoires !");
			theForm.nom.focus();
			return false;
		}
		if (theForm.prenom.value.length == 0)
		{
			alert("Les champs marqué * sont obligatoires !");
			theForm.prenom.focus();
			return false;
		}
		if (theForm.email.value.length == 0)
		{
			alert("Les champs marqué * sont obligatoires !");
			theForm.email.focus();
			return false;
		}
		if (!isValidMail(theForm.email.value))
		{
			alert("Format mail invalide !");
			theForm.email.focus();
			return false;
		}
	
		//tel
		if (theForm.pTel.value.length == 0)
		{
			alert("Les champs marqué * sont obligatoires !");
			theForm.pTel.focus();
			return false;
		}
		
		if(!isPhoneNumber(theForm.pTel.value))
		{
			alert("Format de téléphone est incorrecte!");
			theForm.pTel.focus();
			return false;
		}
		
		if (theForm.cp.value.length == 0)
		{
			alert("Les champs marqué * sont obligatoires !");
			theForm.cp.focus();
			return false;
		}
		if ( !isNumeric(theForm.cp.value) )
		{
			alert("Format numérique invalide !");
			theForm.cp.focus();
			return false;
		}


		if (theForm.pVille.value.length == 0)
		{
			alert("Veuillez sélectionnez une ville !");
			return false;
		}

		// cp doit être de 5 chiffres
		if (theForm.cp.value.length >0 && theForm.cp.value.length != 5)
		{
			alert("Le code postal doit être sur 5 chiffres !");
			theForm.cp.focus();
			return false;
		}


		if (document.getElementById('pEtrecontact').checked)
		{
			if(theForm.telephone.value.length == 0)
			{
			alert("Les champs marqué * sont obligatoires !");
			theForm.telephone.focus();
			return false;
			}
		}
		k=0;
		for (i=1; i<=4; i++)
		{
			champ = 'pRecevoire' + i;
			if (document.getElementById(champ).checked)
				k++;
		}
		if (k == 0)
		{
			alert("Veuillez cocher au moins une case ");
			return false;
		}

    alert('tout ok')
	return false;
	
	
	return true;
  }
