function lAj(nomVar,contVar,leDiv)
{
	$.ajax({
	  	type : 'POST', // envoi des données en GET ou POST
		url : 'moduleCamping/client/moteur.php5' , // url du fichier de traitement
		data : nomVar+'='+contVar , // données à envoyer en  GET ou POST
		beforeSend : function() { // traitements JS à faire AVANT l'envoi
			if(leDiv != '')
			$('#'+leDiv).html("<div  id=\"ajax-loader\"><center><br/><br/><img src = \"../images/loading.gif\"/></center></div>"); // ajout d'un loader pour signifier l'action
		},
		success : function(data){ // traitements JS à faire APRES 
		$('#ajax-loader').remove(); // on enleve le loader
		$('#'+leDiv).html(data);
	}
      });
}
function chercheDeptEtVille()
{
	reg = document.fMoteurRecherche.sR.options[document.fMoteurRecherche.sR.selectedIndex].value;
	if(reg != '')
	lAj("dETv",reg,'champDeptEtVille');
}
function chercheVilleM()
{
	dep = document.fMoteurRecherche.sD.options[document.fMoteurRecherche.sD.selectedIndex].value;
	if(dep != '')
	lAj("v",dep,'champVille');
}

function verifMoteurRecherche()
{
	p = document.fMoteurRecherche.elements[0].value;
	if(p == '')
	{
		document.fMoteurRecherche.elements[0].style.backgroundColor = "red";
		document.fMoteurRecherche.elements[0].focus();
		return false;
	}
	return true;
}
function verifFMC()
{
	document.getElementById('spanAlerteFmc').style.display = "none";
	chemin = document.formeContactMail;
	if(chemin.nom.value == '')
	{
		document.getElementById('spanAlerteFmc').style.display = "block";
		chemin.nom.style.backgroundColor = "red";
		return false;
	}
	if(chemin.email.value == "")
	{
		document.getElementById('spanAlerteFmc').style.display = "block";
		chemin.email.style.backgroundColor = "red";
		return false;
	}
	if (chemin.email.value.indexOf("@") == "-1" || chemin.email.value.indexOf(".") == "-1")
	{
		document.getElementById('spanAlerteFmc').style.display = "block";
		chemin.email.style.backgroundColor = "red";
		return false;
	}
	return true;
}


