function validForm(pForm)
{
	var message = "";


	if (trim(pForm._Nom.value) == "")
 		message = message + "Champ \"Votre nom\" obligatoire\n";

	if ((pForm._Alert.checked || pForm._Copy.checked) && trim(pForm._Mail.value) == "")
		message = message + "Champ \"Votre e-mail\" obligatoire\n";

	if (trim(pForm._Mail.value) != "" && !isEmail(trim(pForm._Mail.value)))
		message = message + "Champ \"Votre e-mail\" incorrecte\n";

	if (trim(pForm._Mail1.value) == "")
		message = message + "1er champ \"E-mail\" obligatoire\n";
	else if (!isEmail(trim(pForm._Mail1.value)))
		message = message + "1er champ \"E-mail\" incorrecte\n";

	if (trim(pForm._Mail2.value) != "" && !isEmail(trim(pForm._Mail2.value)))
		message = message + "2nd champ \"E-mail\" incorrecte\n";

	if (trim(pForm._Mail3.value) != "" && !isEmail(trim(pForm._Mail3.value)))
		message = message + "3ème champ \"E-mail\" incorrecte\n";

	if (trim(pForm._Mail4.value) != "" && !isEmail(trim(pForm._Mail4.value)))
		message = message + "4ème champ \"E-mail\" incorrecte\n";

	if (trim(pForm._Mail5.value) != "" && !isEmail(trim(pForm._Mail5.value)))
		message = message + "5ème champ \"E-mail\" incorrecte\n";

	if (message != "")
	{
		alert(message);
		return false;
	}

	return true;
}

function isEmail(uneChaine)
{
	var car_avant  = 0;
	var car_apres  = 0;
	var car_trouve = 0;
	var caractere;
	var i;

	if (uneChaine.length == 0)
		return true;

	if (uneChaine.search(/^[a-zA-Z0-9]+([_\.-][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([_\.-][a-zA-Z0-9]+)*\.[a-zA-Z0-9]+$/)==-1)
		return false;

	return true;
}

function trim(str)
{
	var deb_pos;
	var fin_pos;

	for(deb_pos=0;deb_pos<str.length && str.substring(deb_pos,deb_pos+1)==' ';deb_pos++);
	for(fin_pos=str.length-1;fin_pos>=0 && str.substring(fin_pos,fin_pos+1)==' ';fin_pos--);

	return str.substring(deb_pos,fin_pos+1);
}

