// JavaScript Document

function valid_email(){
	var modele=new RegExp("^[a-zA-Z0-9]+[a-zA-Z0-9.-_]?@[a-zA-Z0-9]+[.][a-z]{2,4}$");
	var email=document.Fcontact.email.value;
	if (!modele.test(email)){
		alert("Le courriel saisi est invalide.");
		document.Fcontact.email.focus();
		return false;	
	}else{
		return true;	
	}
}

function valid_nom(){
	var nom=document.Fcontact.nom.value;
	var modele=new RegExp("^[a-zA-Z0-9]+[a-zA-Z0-9.-_]?@[a-zA-Z0-9]+[.][a-z]{2,4}$");
	if (!modele.test(nom)){
		var modele2=new RegExp("[\r\n]");
		if (!modele2.test(nom)){
			return true;
		}else{
			alert("Le nom saisi ne peut pas être multi-ligne.");
			document.Fcontact.nom.focus();
			return false;
		}
	}else{
		alert("Le nom saisi est invalide.");
		document.Fcontact.nom.focus();
		return false;
	}
}

function valid_champ(){
	if ((document.Fcontact.nom.value=="")||(document.Fcontact.email.value=="")||(document.Fcontact.message.value=="")){
		document.Fcontact.nom.focus();
		alert("Veuillez remplir tous les champs.");
		return false;
	}else{
		return true;	
	}
}

function valid_formail(){

	if (valid_email()&&valid_nom()&&valid_champ()){
		return true;
	}else{	
		return false;
	}

}