//<!--
function ajaxStatsXp (nb)
{
	ouvrirDiv ("imgStatsXpLoader");
	
	//nouvelle connexion
	var xhr_object = setNewXMLHttpRequest();
	if (xhr_object == null) return;
	
	//on fait le traitement
	xhr_object.open("GET", "statistiques_by_xp.php?nb=" + nb, true); 
	xhr_object.onreadystatechange = function() 
	{ 
	   if(xhr_object.readyState == 4)
	   {
	   		var reponse = xhr_object.responseText;
	   		document.getElementById ("divContentStatsXp").innerHTML = reponse;
	   		fermerDiv ("imgStatsXpLoader");
	   		
	   		
	   		//en attendant...
	   		if (document.getElementById ("divContentQuotas").innerHTML == '')
	   			ajaxQuotas ();
	   } 
	}
	xhr_object.send(null);		
}

function ajaxStatsNiv ()
{
	ouvrirDiv ("imgStatsNivLoader");
	
	//nouvelle connexion
	var xhr_object = setNewXMLHttpRequest();
	if (xhr_object == null) return;
	
	//on fait le traitement
	xhr_object.open("GET", "statistiques_by_niveau.php", true); 
	xhr_object.onreadystatechange = function() 
	{ 
	   if(xhr_object.readyState == 4)
	   {
	   		var reponse = xhr_object.responseText;
	   		document.getElementById ("divContentStatsNiv").innerHTML = reponse;
	   		fermerDiv ("imgStatsNivLoader");
	   } 
	}
	xhr_object.send(null);		
}

function ajaxStatsForces ()
{
	ouvrirDiv ("imgStatsForcesLoader");
	
	//nouvelle connexion
	var xhr_object = setNewXMLHttpRequest();
	if (xhr_object == null) return;
	
	//on fait le traitement
	xhr_object.open("GET", "statistiques_forces.php", true); 
	xhr_object.onreadystatechange = function() 
	{ 
	   if(xhr_object.readyState == 4)
	   {
	   		var reponse = xhr_object.responseText;
	   		document.getElementById ("divContentStatsForces").innerHTML = reponse;
	   		fermerDiv ("imgStatsForcesLoader");
	   } 
	}
	xhr_object.send(null);		
}

function ajaxQuotas ()
{
	ouvrirDiv ("imgQuotasLoader");
	
	//nouvelle connexion
	var xhr_object = setNewXMLHttpRequest();
	if (xhr_object == null) return;
	
	//on fait le traitement
	xhr_object.open("GET", "statistiques_quotas.php", true); 
	xhr_object.onreadystatechange = function() 
	{ 
	   if(xhr_object.readyState == 4)
	   {
	   		var reponse = xhr_object.responseText;
	   		document.getElementById ("divContentQuotas").innerHTML = reponse;
	   		fermerDiv ("imgQuotasLoader");
	   		
	   } 
	}
	xhr_object.send(null);		
}

function ajaxRefreshStats ()
{
	ajaxStatsXp (10);
	ajaxStatsNiv ();
	ajaxStatsForces ();
	//ajaxQuotas ();		
}

//-->