var ok = "#FFFFFF";
var nok = "#F5D3E7";

function verif_remplissage_champ(champ) {
	var i = 0;
	if(!champ.value && !i) {
		champ.style.background = nok;
		return false;
	}
	else { champ.style.background = ok; }
	return true;
}

function verif_remplissage(champs) {
   var j;
   var i = 0;
   for(j=0; j<champs.length; j++) {
      if(!champs[j].value && !i) {
		  champs[j].style.background = nok;
		  
	     //alert("Vous n'avez pas rempli tous les champs obligatoires !");

		  return false;
	  }
	    else { champs[j].style.background = ok; }
   }
	return true;
}



function verif_mail(champ) {
	var syntaxe_mail = new RegExp("^[a-zA-Z0-9]{1}[a-zA-Z0-9\-\._]*@[\-a-zA-Z0-9\._]+[\.]{1}[a-zA-Z]{2,4}$", "");
	if(!syntaxe_mail.test(champ.value)) {
		champ.style.background = nok;
		return false;
	}
	else
	{
	champ.style.background = ok;
	return true;
	}
}

