function affiche_mesimages(type, membre_id, debut, nombre, affichepar, afficherubrique, affichehtml, afficheformat, affichenom, affichejeu, affichedate) { 
	var req = null; 
	document.getElementById("zone_mesimages_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_mesimages_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_mesimages_"+type+"").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_mesimages_"+type+"").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "include_admin_des_images.php?type="+type+"&membre_id="+membre_id+"&debut="+debut+"&nombre="+nombre+"&affichepar="+affichepar+"&afficherubrique="+afficherubrique+"&affichehtml="+affichehtml+"&afficheformat="+afficheformat+"&affichenom="+affichenom+"&affichejeu="+affichejeu+"&affichedate="+affichedate, true);
	req.send(null); 
}

function affiche_magalerie(type, membre_id, debut, nombre, affichepar, afficherubrique, affichehtml, afficheformat, affichenom, affichejeu, affichedate, affichepoids, affichetaille, clickbbcode, clickhtml, afficheinfovignette, rubrique) { 
	var req = null; 
	document.getElementById("zone_magalerie").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_magalerie").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_magalerie").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_magalerie").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "include_ma_galerie.php?type="+type+"&membre_id="+membre_id+"&debut="+debut+"&nombre="+nombre+"&affichepar="+affichepar+"&afficherubrique="+afficherubrique+"&affichehtml="+affichehtml+"&afficheformat="+afficheformat+"&affichenom="+affichenom+"&affichejeu="+affichejeu+"&affichedate="+affichedate+"&affichepoids="+affichepoids+"&affichetaille="+affichetaille+"&clickbbcode="+clickbbcode+"&clickhtml="+clickhtml+"&afficheinfovignette="+afficheinfovignette+"&rubrique="+rubrique, true);
	req.send(null); 
}

function affiche_images(id, affichenav, affichejeu) {
	if (window.innerWidth > 0) {
		var largeurnav = (window.innerWidth);
		var hauteurnav = (window.innerHeight);
	}
	else {
		var largeurnav = (document.documentElement.clientWidth);
		var hauteurnav = (document.documentElement.clientHeight);
	}
	var req = null; 
	document.getElementById("zone_galerie").innerHTML = "<table id=\"zone_galerie_table\" cellspacing=\"0\"><tr><td><div id=\"chargement\">Chargement en cours...<br><a href=\"http://www.unreal.fr/images.php?id="+id+"\" style=\"color: #CC0000;\">cliquez ici si le chargement semble bloqué</a></div></td></tr></table>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_galerie").innerHTML = "<table id=\"zone_galerie_table\" cellspacing=\"0\"><tr><td><div id=\"chargement\">Chargement en cours...<br><a href=\"http://www.unreal.fr/images.php?id="+id+"\" style=\"color: #CC0000;\">cliquez ici si le chargement semble bloqué</a></div></td></tr></table>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_galerie").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_galerie").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "../images.php?mode=galerieajax&id="+id+"&affichenav="+affichenav+"&affichejeu="+affichejeu+"&largeurnav="+largeurnav+"&hauteurnav="+hauteurnav, true); 
	req.send(null); 
}

function delete_images(type, image, membre_id, debut, nombre, affichepar, afficherubrique, affichehtml, afficheformat, affichenom, affichejeu, affichedate) {
	if (confirm('Etes vous sur de vouloir effacer cette image ?')) {
		var req = null; 
		document.getElementById("zone_mesimages_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if (window.XMLHttpRequest) 	{
			req = new XMLHttpRequest();
			if (req.overrideMimeType) {
				req.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e) {}
			}
		}
		req.onreadystatechange = function() { 
			document.getElementById("zone_mesimages_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
			if(req.readyState == 4) {
				if(req.status == 200)	{
					document.getElementById("zone_mesimages_"+type+"").innerHTML  = req.responseText;	
				}	
				else {
					document.getElementById("zone_mesimages_"+type+"").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}
			}
		}; 
		req.open("GET", "include_admin_des_images.php?mode=delete&type="+type+"&image="+image+"&membre_id="+membre_id+"&debut="+debut+"&nombre="+nombre+"&affichepar="+affichepar+"&afficherubrique="+afficherubrique+"&affichehtml="+affichehtml+"&afficheformat="+afficheformat+"&affichenom="+affichenom+"&affichejeu="+affichejeu+"&affichedate="+affichedate, true);
		req.send(null); 
	}
}

function archives(type, jeu, fichier, debut, nombre, dateaffiche, stitreaffich, style) { 
	var req = null; 
	document.getElementById("zone_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_"+type+"").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_"+type+"").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_"+type+"").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "include_archives.php?type="+type+"&jeu="+jeu+"&fichier="+fichier+"&debut="+debut+"&nombre="+nombre+"&dateaffiche="+dateaffiche+"&stitreaffich="+stitreaffich+"&style="+style, true); 
	req.send(null); 
}

function calendrier(date) { 
	var req = null; 
	document.getElementById("zone_menu_calendrier").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_menu_calendrier").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_menu_calendrier").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_menu_calendrier").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "menu_blocs.php?bloc=calendrier&dt="+date, true); 
	req.send(null); 
}

function shoutbox(debut, nombre) { 
	var req = null; 
	document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_shoutbox").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_shoutbox").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "shoutbox.php?debut="+debut+"&nombre="+nombre, true);
	req.send(null); 
}

function shoutbox_delete(post, debut, nombre) {
	if (confirm('Etes vous sur de vouloir effacer le message n°' + post + '?')) {
		var req = null; 
		document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if (window.XMLHttpRequest) 	{
			req = new XMLHttpRequest();
			if (req.overrideMimeType) {
				req.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e) {}
			}
		}
		req.onreadystatechange = function() { 
			document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
			if(req.readyState == 4) {
				if(req.status == 200)	{
					document.getElementById("zone_shoutbox").innerHTML  = req.responseText;	
				}	
				else {
					document.getElementById("zone_shoutbox").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}
			}
		}; 
		req.open("GET", "shoutbox.php?mode=delete&post="+post+"&debut="+debut+"&nombre="+nombre, true); 
		req.send(null); 
	}
}

function shoutbox_add(msg, debut, nombre) {
	//msg = escape(msg);
	var req = null; 
	document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_shoutbox").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_shoutbox").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_shoutbox").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "shoutbox.php?mode=add&msg="+msg+"&debut="+debut+"&nombre="+nombre, true); 
	req.send(null); 
}

function favoris_add(urlfav) {
	//urlfav = escape(urlfav);
	nomfav = prompt("Entrez un court descriptif");
	//nomfav = escape(nomfav);
	var req = null; 
	document.getElementById("zone_menu_favoris").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_menu_favoris").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_menu_favoris").innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_menu_favoris").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "menu_blocs.php?bloc=favoris&urlfav="+urlfav+"&nomfav="+nomfav, true); 
	req.send(null); 
}

function favoris_delete(signet) {
	if (confirm('Etes vous sur de vouloir effacer ce signet ?')) {
		var req = null; 
		document.getElementById("zone_menu_favoris").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if (window.XMLHttpRequest) 	{
			req = new XMLHttpRequest();
			if (req.overrideMimeType) {
				req.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e) {}
			}
		}
		req.onreadystatechange = function() { 
			document.getElementById("zone_menu_favoris").innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
			if(req.readyState == 4) {
				if(req.status == 200)	{
					document.getElementById("zone_menu_favoris").innerHTML  = req.responseText;	
				}	
				else {
					document.getElementById("zone_menu_favoris").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}
			}
		}; 
		req.open("GET", "menu_blocs.php?bloc=favoris&mode=delete&signet="+signet, true); 
		req.send(null); 
	}
}

function menu_blocs(bloc) {
	var req = null; 
	document.getElementById("zone_menu_"+bloc).innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
	if (window.XMLHttpRequest) 	{
		req = new XMLHttpRequest();
		if (req.overrideMimeType) {
			req.overrideMimeType('text/xml');
		}
	} 
	else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	req.onreadystatechange = function() { 
		document.getElementById("zone_menu_"+bloc).innerHTML = "<div id=\"chargement\">Chargement en cours...</div>";
		if(req.readyState == 4) {
			if(req.status == 200)	{
				document.getElementById("zone_menu_"+bloc).innerHTML  = req.responseText;	
			}	
			else {
				document.getElementById("zone_menu_"+bloc).innerHTML="Error: returned status code " + req.status + " " + req.statusText;
			}
		}
	}; 
	req.open("GET", "menu_blocs.php?bloc="+bloc, true); 
	req.send(null); 
}

function sendData(data, page, method) {
    if(document.all) {
        var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
    }
    else {
        var XhrObj = new XMLHttpRequest();
    }
    var content = document.getElementById("zone");
    if(method == "GET") {
        if(data == 'null') {
            XhrObj.open("GET", page);
        }
        else {
            XhrObj.open("GET", page+"?"+data);
        }
    }
    else if(method == "POST") {
        XhrObj.open("POST", page);
    }
    XhrObj.onreadystatechange = function() {
        if (XhrObj.readyState == 4 && XhrObj.status == 200)
            content.innerHTML = XhrObj.responseText ;
    }    
    if(method == "GET") {
        XhrObj.send(null);
    }
    else if(method == "POST") {
        XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
        XhrObj.send(data);
    }
}

function getFile(page) {
    sendData('null', page, 'GET')
}
