var LeArray = new Array("nom1", "courriel1", "lemessage1")

function finalVerif()	
{
	//COPIE?
	if(document.Formulaire.boitecopie.value=='on'){document.Formulaire.recipients.value=document.Formulaire.LErecipients.value + ',' + document.Formulaire.courriel.value}
	else{document.Formulaire.recipients.value=document.Formulaire.LErecipients.value};


	//NOMBRE DE VÉRIFICATIONS CORRECTES
	var Nb_Corrects = 0
		
			//CHANGER LES MESSAGES DE CHAQUE VERIFICATION
	for (x=0; x<LeArray.length; x++)
	{
		if(eval("document.getElementById('"+LeArray[x]+"').firstChild.nodeValue") == "   ")
		{
			Nb_Corrects ++
		}
		else
		{
			eval("document.getElementById('"+LeArray[x]+"').firstChild.nodeValue = 'Fill'") 
		}
	}

			//COMPARE LE NB DE CHAMPS CORRECTES AVEC LE NB DE CHAMPS A VERIFIER
	if (Nb_Corrects == LeArray.length)
	{
		for (x=0; x<LeArray.length; x++)
		{
		}
		
		document.Formulaire.submit();
	}
	else
	{
		//alert("Une erreur s'est produite")
	}
}

function courrielValidation(LeId, champ)
	{
		var message = LeId+"1"	
		eval("var LeChamp = document.getElementById('"+message+"')")	//RÉSULTAT
		var LeChampVerifie = eval("document.getElementById('"+LeId+"')")  //CHAMP UTILISATEUR
	
		
		var VerificationNum = trim(LeChampVerifie.value);  // value of field with whitespace trimmed off
 		var LettresEspaces = /^[a-zA-Z0-9\-_]{1,50}[a-zA-Z0-9\-_.]{0,50}[@][a-zA-Z0-9\-_]{1,50}[a-zA-Z0-9\-_.][a-zA-Z0-9\-_]{1,50}[.][a-zA-Z0-9]{1,50}[a-zA-Z0-9.]{1,50}$/
						//!^[a-zA-Z][a-zA-Zéèàêâùïüë-]{2,}[a-zA-Z]$!


		if (LettresEspaces.test(VerificationNum)) 
		{
			LeChamp.firstChild.nodeValue = "   ";
		}
		else
		{
			LeChamp.firstChild.nodeValue = " * ";
			//setfocus(LeChampVerifie);
		}

	}
	
	
function duTexte(LeId, champ)
	{
		var message = LeId+"1"	
		eval("var LeChamp = document.getElementById('"+message+"')")	//RÉSULTAT
		var LeChampVerifie = eval("document.getElementById('"+LeId+"')")  //CHAMP UTILISATEUR
		
		var VerificationNum = trim(LeChampVerifie.value);  // value of field with whitespace trimmed off
 		var LettresEspaces = /^[a-zA-ZéèàêâùïîüëçôòäöÙÉÀÇÈÂÄÔÖÛÜ"'#:;`,\!&*{}()¨?%@$-_=~.0123456789 \n]{2,999}$/
						//!^[a-zA-Z][a-zA-Zéèàêâùïüë-]{2,}[a-zA-Z]$!
		
		if (LettresEspaces.test(VerificationNum)) 
		{
			LeChamp.firstChild.nodeValue = "   ";
		}
		else
		{
			LeChamp.firstChild.nodeValue = " * ";
			//setfocus(LeChampVerifie);
		}

	}	
	
		function trim(val)	
		{
	 	if (!val) return val;

	 		while(val.charAt(0) == ' ') val = val.substring(1,val.length);
	 		while(val.charAt(length)==' ')  val = val.substring(0,val.length-1);

		 return val;
		}

