function ajaxLoader(page, ajaxId, moreData, method, asynchronous)
{
	var data = 'mode=' + ajaxId;

	if(moreData != null)
		data += '&' + moreData;
	if(method == null)
		method = "POST";
	// Firefox ne fonctionne pas en mode synchrone
	if(asynchronous == null || navigator.userAgent.indexOf("Firefox") != -1)
		asynchronous = true;

	// IE
	if(document.all && !window.opera)
		var XML_Http = new ActiveXObject("Microsoft.XMLHTTP");
	// Mozilla
	else
		var XML_Http = new XMLHttpRequest();

	if(method == "GET")
		XML_Http.open("GET", page + "?" + data, asynchronous);
	else if(method == "POST")
		XML_Http.open("POST", page, asynchronous);

	// La page permet de recevoir les données
	XML_Http.onreadystatechange = function()
	{
		if (XML_Http.readyState == 4 && XML_Http.status == 200)
		{
			// Données reçues, code inhérent à chaque page
			switch(ajaxId)
			{
				case '1vs1':
					if(XML_Http.responseText == "1")
						document.location.href = "battle.php";
					break;
				case 'besace_delete_object':
					if(XML_Http.responseText != "")
						$("#besace_objet_" + XML_Http.responseText).html("");
					break;
				case 'clanvsclan_battle':
					if(XML_Http.responseText == "0")
						document.location.href = "game_clanvsclan.php";
					else if(XML_Http.responseText == "1")
						document.location.href = "battle.php";
					break;
				case 'clanvsclan_table_game':
					if(XML_Http.responseText != "")
						$("#load_table_game").html(XML_Http.responseText);
					break;
				case 'clanvsclan_clan_enemy':
					if(XML_Http.responseText != "")
					{
						if(XML_Http.responseText == "0")
							document.location.href = "game_clanvsclan.php";
						else if(XML_Http.responseText == "1")
							document.location.href = "battle.php";
						else
							$("#load_clan_enemy").html(XML_Http.responseText);
					}
					break;
				case 'pnj':
					var txtReceived = XML_Http.responseText;
					var tabTxt = txtReceived.split("#");

					hidePlayerBubble();

					if(tabTxt.length == 2) {
						showPnjBubble(tabTxt[0]);
						
						if(tabTxt[1] != '0')
							showPlayerBubble(tabTxt[1]);
					}
					break;
				case 'resources_infos':
					var all_resources_infos = XML_Http.responseText;
					var splited_resources = all_resources_infos.split("#");

					// Afficher les ressources
					for(var i = 1; i <= 7; i++) {
						if($.isNumeric(splited_resources[i - 1]) && splited_resources[i - 1] >= 0)
							$("#resource_" + i).html(splited_resources[i - 1]);
					}
		
					// Cacher la notification précédente
					HideNotif();

					// Notifications
					if(splited_resources.length > 7)
						ViewNotif(splited_resources[7], _rootPath + splited_resources[8]);
					break;
			}
		}
	}

	if(method == "GET")
		XML_Http.send(null);
	else if(method == "POST")
	{
		XML_Http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		XML_Http.send(data);
	}
}

