	function magic(id, titre, fonction, nom_image, timestamp)
	{
		if(fonction == 'redimensionner' || fonction == 'recadrer')
		{
			if(fonction == 'redimensionner')
			{
				xajax_magic_redim(nom_image,id);
			}
			else
			{
				xajax_magic_recadrer(nom_image,id);
			}			
			document.getElementById('action_box').style.width = '950px';
			document.getElementById('action_box').style.marginLeft = '-475px';
			document.getElementById('action_box').style.top = '35px';
		}
		else
		{
			document.getElementById('action_box').style.width = '700px';
			document.getElementById('action_box').style.marginLeft = '-350px';
			document.getElementById('action_box').style.top = '140px';
			document.getElementById('action_box_content').style.height = 'auto';
		}
		if(fonction == 'supprimer')
		{
			xajax_magic_supprimer(id,nom_image);
		}
		if(fonction == 'rotation')
		{
			xajax_magic_rotation(id,nom_image);
		}
		if(fonction == 'infos')
		{
			nom_dossier = document.getElementById('info_dossier_'+id).innerHTML;
			xajax_magic_infos(id,nom_image,nom_dossier,timestamp);
		}
		Effect.Appear('masque', {duration:0.2, fps:25, from:0.0, to:0.7,afterFinish:function() {
			Effect.Appear('action_box', {duration:0.3, fps:25, from:0.0, to:1.0});
		}});
		document.getElementById('action_box_titre').innerHTML = titre;
	}
	function fermer_magic()
	{
		Effect.Fade('action_box',{duration:0.2,afterFinish:function(){ vider_magic(); }});
		Effect.Fade('masque',{duration:0.2});
		return false;
	}
	function vider_magic(){
		document.getElementById('action_box_titre').innerHTML = ' ';
		document.getElementById('action_box_content').innerHTML = '<img src="images/magic_load.gif" style="margin-top:35px;" alt="chargement" />';
	}
	function aff_historique(){
	document.getElementById('historique').style.display=document.getElementById('historique').style.display=="none"?"block":"none";
	
	}
		function remove_px(data)
	{
		return parseInt(data.substring(0,data.length-2));
	}
	
	function charger_coord()
	{
		fou = document.getElementById('input_x').value = remove_px(document.getElementById('area').style.left);
		document.getElementById('input_y').value = remove_px(document.getElementById('area').style.top);
		document.getElementById('input_largeur').value = remove_px(document.getElementById('area').style.width);
		document.getElementById('input_hauteur').value = remove_px(document.getElementById('area').style.height);
	}
	function charger_reponse(id)
	{
		document.getElementById('id_mess').value = id;
		//document.getElementById('repondre').style.display=document.getElementById('repondre').style.display=="none"?"block":"none";
		document.getElementById('reponse_form').style.display=document.getElementById('reponse_form').style.display=="block"?"none":"block";
	}
