/***********************************************************************************/
/*                   Creation de l'object http request                            */
/*********************************************************************************/

var xmlhttp=false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
        xmlhttp=false;
    }
}
if (!xmlhttp && window.createRequest) {
    try {
        xmlhttp = window.createRequest();
    } catch (e) {
        xmlhttp=false;
    }
}

/**************************************************************/
/*              Fonction call Ajax                           */
/************************************************************/

function call_ajax(url){
	xmlhttp.open("GET", url, true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status == 200) {
			 var monscript = document.createElement('script');
					monscript.text = xmlhttp.responseText;
					monscript.type = "text/javascript";
					document.getElementById('ajax').appendChild(monscript);     
			}
		}
	xmlhttp.send(null);
}

/**********************************************************************************/
/*                           fonction pour les ligthbox                          */
/********************************************************************************/

function show_multibox(e, _url, _h, _w){
    try{
        Multibox.close();
    }catch(e){}
	Multibox.overlay.show();
    setTimeout("create_multibox('"+_url+"', "+_h+", "+_w+");",1400);
	stopProp(e);
	return false;
}
function create_multibox(_url, _h, _w){
    Multibox.options.movieHeight=_h;
	Multibox.options.movieWidth=_w;
	document.getElementById('lien').href = _url;
	fireClick(document.getElementById('lien'));
}
function fireClick(target){
	if(document.dispatchEvent){
		var oEvent = document.createEvent("MouseEvents");
		oEvent.initMouseEvent("click", true, true,window, 1, 1, 1, 1, 1, false, false, false, false, 0, target);
		target.dispatchEvent(oEvent);
	}else if(document.fireEvent){
		try{
			target.click();
		}catch(e){ 
			target.fireEvent("onclick");
		}
	}
} 
function stopProp(e){
	if (window.event) var e = window.event;
	if(e){
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
	}
}

