function displayReponse(sText,pos)
{
	var info = document.getElementById(pos);
	info.innerHTML = sText;
}

function addWidget(id,arg,pos,page)
{
	//alert(id);
	var oXmlHttp = null; 
	 
	//alert(id);
	if(window.XMLHttpRequest)
		oXmlHttp = new XMLHttpRequest();
	else if(window.ActiveXObject)
	{
	   try  {
                oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
	}
	oXmlHttp.open("get","/mod/display.php?module=" + id + "&arg=" + arg + "&page=" + page, true);
	oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					//alert('OK : ' + oXmlHttp.responseText);
					displayReponse(oXmlHttp.responseText,pos);
					if (id=="1")
					{
						addWidget('2',arg,'menu',page)
					}
				}
				else {
					//alert('Erreur : ' + oXmlHttp.statusText);
					displayReponse("Erreur : " + oXmlHttp.statusText,pos);
				}
		}
	};
	oXmlHttp.send(null);
}
