//------------------------------------------------------ JavaScript Document
function RFR_req_articles(limit1, limit2, type)
{
    var xhr=null;
    
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
		
    }
    else if (window.ActiveXObject) 
    {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    //on définit l'appel de la fonction au retour serveur
    xhr.onreadystatechange = function() { alert_ajax(xhr); };
    
    //on affiche le message d'acceuil
    //document.getElementById("loading").className="encours";
    obj = document.getElementById("result");
	obj.innerHTML = "<br><br><div style='text-align:center;'><img src='../public/images/loading-rond.gif' width='48' height='48' /><br><span class='info-detail'>chargement des donn&eacute;es</span></div>";
    //on appelle le fichier reponse.txt
	
    xhr.open("GET", "../public/php/req_articles.php?limit1=" + limit1 + "&&limit2=" + limit2 + "&&type=" + type, true);
	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=iso-8859-1');
    xhr.send(null);
}

function alert_ajax(xhr)
{
    if (xhr.readyState==4)     {
    	
			obj = document.getElementById("result");
			obj.innerHTML = xhr.responseText;
			//obj.innerHTML = "<br><br><div style='text-align:center;'><img src='../public/images/loading-rond.gif' width='48' height='48' /><br><span class='info-detail'>chargement des donn&eacute;es</span></div>";
    	
    }
}
