	// M A S K   L A   F E N  E T R E  EDIT / MODIF / AJOUT
	function mask_div(val)
	{
			document.getElementById(val).style.display = "none";
			document.getElementById('mon_iframe').src = "";
			if (document.getElementById('ma_liste'))
				val = document.getElementById('ma_liste');
			else
				val="rien";
			list_table(val,table);
	}
	
	// A F F I C H E  L A  L I S T E  D E   L A  T A B L E
	// I D _ M E N U   P E R M E T   D E  F A I R E   U N  F I L T R E  S U R   L A   T A B L E
	function list_table(val,table)
	{
		var requet = new XMLHttpRequest();
		if (val != "rien")
			fichier = "req_list.php?table="+table+"&id_menu="+val.value+"&v="+Math.random();
		else
			fichier = "req_list.php?table="+table+"&v="+Math.random();
		requet.open('GET',fichier,false);
		requet.onreadystatechange = function()
		{
			document.getElementById('resultat').innerHTML = requet.responseText;
		}
		requet.send(null);
	}

	// A F F I C H E   U N E   F I C H E   D E   S A I S I E    EN   A J O U T  (OU=1)
	function ajout(table){
		document.getElementById('mon_iframe').src = "req_fich.php?table="+table+"&ou=1"+"&v="+Math.random();
		document.getElementById('fiche').style.display = ""
	}
	
	// A F F I C H E   U N E   F I C H E   D E   S A I S I E    EN   M O D I F  (OU=2)
	function edit(table,val,idmenu){
		document.getElementById('mon_iframe').src = "req_fich.php?table="+table+"&id="+val+"&idmenu="+idmenu+"&ou=2"+"&v="+Math.random();
		document.getElementById('fiche').style.display = ""	
	}
	
// A F F I C H E   U N E   F I C H E   D E   S U P P R  (OU=3)
	function efface(table,val)
	{
		if (confirm("effacer ?"))
		{
			document.getElementById('mon_iframe').src = "req_fich.php?table="+table+"&id="+val+"&ou=3";
			document.getElementById('fiche').style.display = ""	
		}
	}
	
	function affiche(val)
	{
		//table = document.getElementById('table"');
		x = val.innerHTML ;
		val.innerHTML = "<textarea id=\"la\" type=\"text\" rows='10' cols='20' >"+x+"</textarea><a href='javascript:enregistr("+val.id+")'>Ok</a> - <a href='javascript:quitte("+val.id+")'>Annuler</a>";
	}
	
	function enregistr(val)
	{
		x = document.getElementById('la').value;
		val.innerHTML = x;
		sql = "UPDATE `"+table.innerHTML+"` SET `"+val.id.substring(0,val.id.indexOf("_"))+"` = '"+x+"' WHERE `id` = "+val.id.substring(val.id.indexOf("_")+1,val.id.length);
		var requet = new XMLHttpRequest();
		fichier = "exec_sql.php";
		requet.open('POST',fichier,false);
		requet.onreadystatechange = function()
		{
			document.getElementById('resultat').innerHTML = requet.responseText;
		}
		requet.send(sql);
	}
	
	function quitte(val)
	{
		val.innerHTML = x;
	}
	
	function test(id,feuil)
	{
		if (confirm('effacer '+id+' ! Confirmer'))
		{document.location.href = feuil + '&id='+id;}
	}
	
	function change(id,p,feuil)
	{
		location=feuil+'&id='+id+'&fic='+p;
	}
			
	function chang_menu(listd)
	{
		if (listd != '0')
			{location=listd;}
	}
	function ouvrir_dde_rdv(width,height,elus)
	{
		x = (640 - width)/2, y = (480 - height)/2;
		if (screen)
		{
			y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
		}
		if (screen.availWidth > 1800)
		{
			x = ((screen.availWidth/2) - width)/2;
		}
		window.open('mail_dde_rdv.php?elus='+elus,'newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
