// JavaScript Document
function changeBackgroundColor(elemnt)
	{
		if (elemnt) {elemnt.style.backgroundColor = "FF9900";}
		return;
	}
function verifcommande()
 	{
		if(document.commande.nom.value == "") {
		alert("Veuillez entrer votre nom");
		changeBackgroundColor(document.commande.nom);
		document.commande.nom.focus();
		return false;
		}
		else
		if(document.commande.prenom.value == "") {
		alert("Veuillez entrer votre prenom");
		changeBackgroundColor(document.commande.prenom);
		document.commande.prenom.focus();
		return false;
		}
		else
		if(document.commande.ddn.value == "") {
		alert("Veuillez entrer votre date de naissance");
		changeBackgroundColor(document.commande.ddn);
		document.commande.ddn.focus();
		return false;
		}
		else
		if(document.commande.adresse.value == "") {
		alert("Veuillez entrer votre adresse");
		changeBackgroundColor(document.commande.adresse);
		document.commande.adresse.focus();
		return false;
		}
		else
		if(document.commande.codepostal.value == "") {
		alert("Veuillez entrer votre code postal");
		changeBackgroundColor(document.commande.codepostal);
		document.commande.codepostal.focus();
		return false;
		}
		else
		if(document.commande.codepostal.value.length != 5)	{ 
		alert ("Votre code postal doit contenir 5 chiffres !"); 
		document.commande.codepostal.focus();
		return false;
		}
		else
		if(document.commande.ville.value == "") {
		alert("Veuillez entrer le nom de votre ville ou commune");
		changeBackgroundColor(document.commande.ville);
		document.commande.ville.focus();
		return false;
		}
		if(document.commande.email.value == "") {
		alert("Veuillez entrer votre adresse électronique");
		changeBackgroundColor(document.commande.email);
		document.commande.email.focus();
		return false;
		}
		else
		if(document.commande.email.value.search(/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) == -1) {
		alert("Ce n'est pas une adresse électronique valide !");
		changeBackgroundColor(document.commande.email);
		document.commande.email.focus();
		return false;
		}
		else
		if(document.commande.telfixe.value == "") {
		alert("Veuillez entrer votre numéro de téléphone");
		changeBackgroundColor(document.commande.telfixe);
		document.commande.telfixe.focus();
		return false;
		}
		else
		if(document.commande.telfixe.value.length != 10)	{ 
		alert ("Votre téléphone doit contenir 10 chiffres !"); 
		document.commande.telfixe.focus();
		return false;
		}
		else
		return true;
	}
