function envoi()
 {
	var ch=document.SeulForm;
	bon="abcdefghijklmnopqrstuvwxyzéèêôûààçëïîù'-ABCDÉÊËEFGHIJKLMNOPQRSTUVWXYZ "
	num="0123456789"
	tel="0123456789 -.pP"
	
	var typ = "ND";
  
  
		
		
		
		if (typ!="AD" && typ!="ND" && typ!="PR")
		 {
		   
		   if (ch.strNom.value.length==0)
	      {
		     alert("Veuillez saisir votre nom");
		     ch.strNom.focus();
		     return;
		    }
		   
		   
		   if (ch.strPrenom.value.length==0 && ch.intTitre.value != 4)
	      {
		     alert("Veuillez saisir votre prénom");
		     ch.strPrenom.focus();
		     return;
		   }
		   
		   if (ch.intTitre.value != 4)
			{ 
			  
				for(i=0;i<ch.strPrenom.value.length;i++)
					{
						if (bon.indexOf(ch.strPrenom.value.charAt(i))==-1)
						{
					      alert("Votre prénom contient des caractères illégaux");
					      ch.strPrenom.focus();
					      return;
						}
					} 
				
				for(i=0;i<ch.strNom.value.length;i++)
					{
						if (bon.indexOf(ch.strNom.value.charAt(i))==-1)
						{
						  alert("Votre nom contient des caractères illégaux");
						  ch.strNom.focus();
						  return;
						}
					}
			}
			  
		   
		    if (ch.intTitre.value==2)
		     {
		      if (ch.strNomJF.value.length==0)
	         {
		        alert("Veuillez saisir votre nom de jeune fille");
		        ch.strNomJF.focus();
		        return;
		       }
		     }
		     
		    
	      for(i=0;i<ch.strNomJF.value.length;i++)
	       {
		      if (bon.indexOf(ch.strNomJF.value.charAt(i))==-1)
		       {
			      alert("Votre nom de jeune fille contient des caractères illégaux");
			      ch.strNomJF.focus();
			      return;
		       }
		     } 
		     
		   
		    if ((ch.strAdresse2.value.length==0) && (ch.strAdresse3.value.length==0))
	       {
		      alert("Veuillez saisir votre adresse");
		      ch.strAdresse2.focus();
		      return;
		     }
		   
		   
		    if (ch.strVille.value.length==0)
	       {
		      alert("La ville n'a pas été saisie");
		      ch.strVille.focus();
		      return;
		     }
		    
		    
	      for(i=0;i<ch.strTel.value.length;i++)
	      {
		    if (tel.indexOf(ch.strTel.value.charAt(i))==-1)
		     {
			    alert("Votre numéro de téléphone doit être de forme numérique");
			    ch.strTel.focus();
			    return;
		     }
		   }  
		    
	      for(i=0;i<ch.strTelPortable.value.length;i++)
	      {
		    if (tel.indexOf(ch.strTelPortable.value.charAt(i))==-1)
		     {
			    alert("Votre numéro de téléphone portable doit être de forme numérique");
			    ch.strTelPortable.focus();
			    return;
		     }
		   }  
		   if ((ch.strTel.value.length==0) && (ch.strEmail.value.length==0) && (ch.strTelPortable.value.length==0))
	       {
		      alert("Veuillez renseigner le champs Téléphone (personnel ou portable) ou E-Mail");
		      ch.strEmail.focus();
		      return
		   }
		   
		   
	     for(i=0;i<ch.strFax.value.length;i++)
	     {
		    if (tel.indexOf(ch.strFax.value.charAt(i))==-1)
		     {
			    alert("Votre numéro de fax doit être de forme numérique");
			    ch.strFax.focus();
			    return;
		     }
		   } 
		   
		   
		   if (typ!="AD" && typ!="ND" && typ!="PR")
		   {
			 
				if (ch.strCodeBanque.value.length==0)
					{
						alert("Votre code banque n'a pas été saisi");
						ch.strCodeBanque.focus();
						return;
					}
		    
		    
				if (ch.strCodeGuichet.value.length==0)
					{
						alert("Votre code guichet n'a pas été saisi");
						ch.strCodeGuichet.focus();
						return;
					}
		    
		    
				if (ch.strNumCompte.value.length==0)
					{
						alert("Votre numéro de compte n'a pas été saisi");
						ch.strNumCompte.focus();
						return;
					}
		    
		    
				if (ch.strCleRib.value.length==0)
					{
						alert("Votre clé RIB n'a pas été saisi");
						ch.strCleRib.focus();
						return;
					}
		    
		    
				if (document.getElementById('intTitulaireRIB').value==0) {
					alert('Vous devez indiquer qui est le titulaire du RIB !');
					return
				}
		    
		    
		    
				var myField = document.getElementById('strAdressePayeur')
				if (myField.value.length==0)
					{
						alert("L'adresse du titulaire du compte n'a pas été saisi");
						myField.focus();
						return;
					}
		    
		    
				var myField = document.getElementById('intTitrePayeur')
				if (myField.value=="0")
					{
						alert("Veuillez saisir un titre pour le titulaire du compte");
						myField.focus();
						return;
					}
	      
		    
				var myField = document.getElementById('strNomPayeur');
				if (myField.value.length==0)
					{
						alert("Le nom du titulaire du compte n'a pas été saisi");
						myField.focus();
						return;
					}
		    
		    
						for(i=0;i<myField.value.length;i++)
							{
								if (bon.indexOf(myField.value.charAt(i))==-1)
									{
										alert("Le nom du titulaire du compte contient des caractères illégaux");
										myField.focus();
										return;
									}
							}
			 
			
			if ( document.getElementById('intTitrePayeur').value != 4)	{
			var myField = document.getElementById('strPrenomPayeur')
			 for(i=0;i<myField.value.length;i++)
			  {
				if (bon.indexOf(myField.value.charAt(i))==-1)
				  {
					alert("Le prénom du titulaire du compte contient des caractères illégaux");
					myField.focus();
					return;
				   }
			  }
		  		  
		   
		   var myField = document.getElementById('strPrenomPayeur') 
		    if (myField.value.length==0 && document.getElementById('intTitrePayeur').value!="4")
			{
		     alert("Le prénom du titulaire du compte n'a pas été saisi");
		     myField.focus();
		     return;
		    }
		  }  
			
		    if (ch.strCPPayeur.value.length==0)
	      {
		     alert("Le code postal du titulaire du compte n'a pas été saisi");
		     ch.strCPPayeur.focus();
		     return;
		    }
		    
		 
	     for(i=0;i<ch.strCPPayeur.value.length;i++)
	     {
		    if (num.indexOf(ch.strCPPayeur.value.charAt(i))==-1)
		     {
			    alert("Le code postal de ville du titulaire du compte ne peut être que numérique");
			    ch.strCPPayeur.focus();
			    return;
		     }
		   }
        
        
		    if (ch.strVillePayeur.value.length==0)
	      {
		     alert("La ville du titulaire du compte n'a pas été saisi");
		     ch.strVillePayeur.focus();
		     return;
		   }
		  
		 
	    if (ch.strTelPayeur.value.length != 0)
	      {
			for(i=0;i<ch.strTelPayeur.value.length;i++)
			 {
			   if (tel.indexOf(ch.strTelPayeur.value.charAt(i))==-1)
			    {
					alert("Le numéro de téléphone du titulaire du compte doit être de forme numérique");
				    ch.strTelPayeur.focus();
				    return;
			    }
			 }  
		   } 
		  
		   
			 
			 for(i=0;i<ch.strVillePayeur.value.length;i++)
			 {
			    if (bon.indexOf(ch.strVillePayeur.value.charAt(i))==-1)
			     {
				    alert("La ville du titulaire du compte contient des caractères illégaux");
				    ch.strVillePayeur.focus();
				    return;
			     }
			   }
			  
			}
		}
		
				


	if (ch.intTitre.value=="0")
	{
		alert("Veuillez saisir votre titre");
		ch.intTitre.focus();
		return;
	}

	if (ch.strCP.value.length==0)
	{
		alert("Veuillez saisir votre code postal");
		ch.strCP.focus();
		return;
	}

	if (ch.strCP.value.length < 5)
	{
		alert("Veuillez saisir un code postal à 5 chiffres");
		ch.strCP.focus();
		return;
	}

	for(i=0;i<ch.strCP.value.length;i++)
	{
		if (num.indexOf(ch.strCP.value.charAt(i))==-1)
		{
			alert("Le code postal ne peut être que de forme numérique ( ex : 92100)");
			ch.strCP.focus();
			return;
		}
	}	
	
	
	var Mail=ch.strEmail.value;
	var test="" + Mail;
	
	if (Mail.length > 0)
	{
		if (Mail.length < 6)
		{
			alert("Veuillez saisir une adresse mail Correct");
			ch.strEmail.focus();
			return;
		}	
		
		if ((Mail.indexOf('@',0) == -1) || (Mail.indexOf('.',0) == -1))
		{
			alert("Veuillez saisir une adresse mail Correct ");
			ch.strEmail.focus();
			return;
		}
	}
	if (ch.strTel.value.length > 0)
	{
		if ((ch.strTel.value.length < 10) && (ch.strTel.value.toUpperCase() != 'P'))
			{
			alert("Veuillez saisir un N° de téléphone Correct ");
			ch.strTel.focus();
			return;
			}	
	}
	if (ch.strTelPortable.value.length > 0)
	{
		if ((ch.strTelPortable.value.length < 10) && (ch.strTelPortable.value.toUpperCase() != 'P'))
			{
			alert("Veuillez saisir un N° de téléphone Portable Correct ");
			ch.strTelPortable.focus();
			return;
			}	
	}
		
		ch.action="http://net.assurance-juridique.fr/AJ/CLIENT/CLIENT_MAJ.ASP";
		ch.submit();
			
}

function checkValid(theField) {
	if (!theField.value=='') {
		document.all['motifValid'].style.visibility = 'visible';
	} else {
		document.all['motifValid'].style.visibility = 'hidden';
	}
}


function tabulAuto(form,formNext,longMax)
{
	
	var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	var character = String.fromCharCode(code);
	
	if ((code==9)||(code==16)||((code>36)&&(code<41))) {
	
		return 0;
	}

	var intTmp = form.value.length;
	if (intTmp < longMax)
		{
		return 0;
		}
	
	if (document.getElementById(formNext).value.length != 0)
		{
		
		document.getElementById(formNext).select();
		}
	else
		{
		
		document.getElementById(formNext).focus();
		}
}
