// JavaScript Document

/***** Coloration des champs mal renseignés *****/
function colorise(truc) {
	var bgColor0 = truc.style.backgroundColor;
	if(truc.value == '')
	{
		truc.style.backgroundColor = '#DD0000';
	} else {
		truc.style.backgroundColor = bgColor0;
	}
}

/*************************************************/
function formCheckContact(form){
	colorise(form.manuel_nom);
	colorise(form.manuel_prenom);
	colorise(form.manuel_adresse);
	colorise(form.manuel_cp);
	colorise(form.manuel_ville);
	colorise(form.manuel_tel);
	colorise(form.manuel_email);
	colorise(form.manuel_demande);
	if (form.manuel_nom.value == "") {
		alert("Veuillez saisir votre nom.");
		return false;
	}
	if (form.manuel_prenom.value == "") {
		alert("Veuillez saisir votre prénom.");
		return false;
	}
	if (form.manuel_adresse.value == "") {
		alert("Veuillez saisir votre adresse postal.");
		return false;
	}
	if (form.manuel_cp.value == "") {
		alert("Veuillez saisir votre code postal.");
		return false;
	}
	if (form.manuel_ville.value == "") {
		alert("Veuillez saisir le nom de votre ville.");
		return false;
	}
	if (form.manuel_tel.value == "") {
		alert("Veuillez saisir un numéro de téléphone fixe.");
		return false;
	}
	if (form.manuel_email.value.indexOf("@") == -1)
	{
		alert("Adresse e-mail mal formatée");
		return false;
	}
	if (form.manuel_email.value.indexOf(".") == -1)
	{
		alert("Adresse e-mail mal formatée");
		return false;
	}
	if (form.manuel_email.value == "") {
		alert("Veuillez saisir votre adresse email.");
		return false;
	}
	if (form.manuel_demande.value == "") {
		alert("Veuillez saisir votre demande afin que nous puissions y répondre.");
		return false;
	}
}