function saisieLogement(id, type, nom, adresse, distinction, mobilite, animaux, lien, description)
{
	var OAjax;
	if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
	else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP');
	OAjax.open('POST',"./modules/saisie-logement/validation-ajout.php",true);
	OAjax.onreadystatechange = function()
	{
		if (OAjax.readyState == 4 && OAjax.status==200)
		{
			if (document.getElementById)
			{  
				var elem = (OAjax.responseText).split('|');
				if(elem[0] == 1) {
					document.getElementById('idMsg').innerHTML='<font color=GREEN>'+elem[1]+'</font>';
					document.getElementById('formulaire').innerHTML='';
				}
				else{
					document.getElementById('idMsg').innerHTML='<font color=RED>'+elem[1]+'</font>';
				}
			}     
		}
	}
	OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	OAjax.send('id='+id+'&type='+type+'&nom='+nom+'&adresse='+adresse+'&distinction='+distinction+'&mobilite='+mobilite+'&animaux='+animaux+'&lien='+lien+'&description='+description);
}; 


function saisieCommentaire(id_lac, pseudo, commentaire, captcha)
{
	var OAjax;
	if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
	else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP');
	OAjax.open('POST',"./modules/fiche-lac/validation-commentaire.php",true);
	OAjax.onreadystatechange = function()
	{
		if (OAjax.readyState == 4 && OAjax.status==200)
		{
			if (document.getElementById)
			{  
				var elem = (OAjax.responseText).split('|');
				if(elem[0] == 1) {
					document.getElementById('idMsg').innerHTML='<font color=GREEN>'+elem[1]+'</font>';
					document.getElementById('formulaire').innerHTML='';
				}
				else{
					document.getElementById('idMsg').innerHTML='<font color=RED>'+elem[1]+'</font>';
				}
			}     
		}
	}
	OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	OAjax.send('id_lac='+id_lac+'&pseudo='+pseudo+'&commentaire='+commentaire+'&captcha='+captcha);
}; 

function saisieLac(nom, code_departement, description, domaine_public, superficie, acces, commentaire)
{
	var OAjax;
	if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
	else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP');
	OAjax.open('POST',"./modules/saisie-lac/validation-ajout.php",true);
	OAjax.onreadystatechange = function()
	{
		if (OAjax.readyState == 4 && OAjax.status==200)
		{
			if (document.getElementById)
			{  
				var elem = (OAjax.responseText).split('|');
				if(elem[0] == 1) {
					document.getElementById('idMsg').innerHTML='<font color=GREEN>'+elem[1]+'</font>';
					document.getElementById('formulaire').innerHTML='';
				}
				else{
					document.getElementById('idMsg').innerHTML='<font color=RED>'+elem[1]+'</font>';
				}
			}     
		}
	}
	OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	OAjax.send('nom='+nom+'&code_departement='+code_departement+'&description='+description+'&domaine_public='+domaine_public+'&superficie='+superficie+'&acces='+acces+'&commentaire='+commentaire);
}; 

