var http; // Notre objet XMLHttpRequest

function createRequestObject()
{
    var http;
    if(window.XMLHttpRequest)
    { // Mozilla, Safari, ...
        http = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    { // Internet Explorer
        http = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return http;
}

function news(id)
{
    http = createRequestObject();
    http.open('get', 'message.php?act='+id, true);
	http.setRequestHeader('Content-type', 'text/html; charset=iso-8859-1');
    http.onreadystatechange = function()  { 
				if(http.readyState == 4 && http.responseText != "")
				{	
				msgShow(http.responseText, messagerie);
				}
			}
    http.send(null);
}
function imgmed(id, img)
{
    http = createRequestObject();
    http.open('get', 'message.php?img_id='+id+'&img='+img, true);
	http.setRequestHeader('Content-type', 'text/html; charset=iso-8859-1');
    http.onreadystatechange = function()  { 
				if(http.readyState == 4 && http.responseText != "")
				{	
				msgShow2(http.responseText, img_med);
				}
			}
    http.send(null);
}

function msgShow(result, id) {
	new Effect.BlindUp(id, {duration:.5, afterFinish:function() { 
		Element.update(id, unescape(result));
		new Effect.BlindDown(id, {duration:.5});
	} });
}
function msgShow2(result, id) {
	
		Element.update(id, unescape(result));

}

