// JavaScript Document

// Ajoute la fonction trim comme méthode de l'objet String.
String.prototype.trim = function()
{ return this.replace(/(^\s*)|(\s*$)/g, ""); };

function verif() 
{ 

	var nom = document.formulaire.nom;
	if (nom.value.trim() == "")
	{
		alert ('Veuillez entrer votre nom');
		nom.focus();
		nom.style.backgroundColor='#d8ed09';
		return false;
	}
	
	var prenom = document.formulaire.prenom;
	if (prenom.value.trim() == "")
	{
		alert ('Veuillez entrer votre prénom');
		prenom.focus();
		prenom.style.backgroundColor='#d8ed09';
		return false;
	}
	
	var telephone = document.formulaire.telephone;
	if (telephone.value.trim() == "")
	{
		alert ('Veuillez entrer votre numéro de téléphone');
		telephone.focus();
		telephone.style.backgroundColor='#d8ed09';
		return false;
	}
	
	var adresse = document.formulaire.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
	{}else
	{
		alert('Entrez une adresse e-mail valide!!');
		document.formulaire.mail.focus();
		document.formulaire.mail.style.backgroundColor='#d8ed09';
		return false;
	}
	
	document.formulaire.submit();

}