function testAjax(id, typologie) {
	var data = document.getElementById('liste_article');
	var hid = document.getElementById(typologie);
	if(id != hid.value)
	{
		typoz = ['prix','type','categorie'];
		idz = id;
		for(i=0;i<typoz.length;i++) {
			if(typologie != typoz[i])
				if(document.getElementById(typoz[i]).value != "")
					idz += ','+document.getElementById(typoz[i]).value;
		}
		var myAjax = new Ajax.Request('http://leparisdumardi/wp-content/themes/lpm/testajax.php',
		  {
			method:'get',
			parameters: 'id=' + idz,
			onSuccess: function(myAjax){
				if(myAjax.responseText != "") {
				var json = myAjax.responseText.evalJSON(true);
				
				var mesdata = json.article;
				/*var tableau = mesdata.split(';;');
				for (var i=1; i<(tableau.length - 1); i++) {
					var item = tableau[i].split(';');
					affichage += '<option value="'+item[0]+'">'+examen+' '+item[1]+'</option>';
				}*/
				
				data.innerHTML = "";
				for(i=0;i<mesdata.length;i++) {
					html = '<br /><a href="'+mesdata[i].url+'">'+mesdata[i].name+'</a>';
					data.innerHTML += html;
				}
				//document.getElementById(id).className += '-actif';
				hid.value = id;
				}
				else data.innerHTML = "<br />Pas de r&eacute;sultat !";
			},
			onFailure: function() {
				data.innerHTML ="Pas bon";
			},
			onLoading: function() {
				document.getElementById('img').style.display = "block";
			},
			onLoaded: function() {
				document.getElementById('img').style.display = "none";
			}
		  });
	}
	
	
}

function suppr(typologie) {
	var hid = document.getElementById(typologie);
	hid.value = "";
	typoz = ['prix','type','categorie'];
	for(i=0;i<typoz.length;i++) {
		if(typologie != typoz[i]) {
			if(document.getElementById(typoz[i]).value != "") {
				var id = document.getElementById(typoz[i]).value;
				document.getElementById(typoz[i]).value = "";
				testAjax(id, typoz[i]);
				break;
			}
		}
	}
}