function displayReponse(sText,pos)
{
	var info = document.getElementById(pos);
	info.innerHTML = sText;
}

function addWidgetInfo(id,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/displayinfo.php?module=" + id + "&page=" + page, true);
	oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					//alert('OK : ' + oXmlHttp.responseText);
					displayReponse(oXmlHttp.responseText,"contenu_filinfo");
				}
				else {
					//alert('Erreur : ' + oXmlHttp.statusText);
					displayReponse("Erreur : " + oXmlHttp.statusText,"contenu_filinfo");
				}
		}
	};
	oXmlHttp.send(null);
}

function addWidgetResultat(id,journee)
{
	//alert(id);
	var oXmlHttp = null; 
	 
	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/displayresultat.php?module=" + id + "&journee_select=" + journee, true);
	oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					//alert('OK : ' + oXmlHttp.responseText);
					displayReponse(oXmlHttp.responseText,"contenu_resultat");
				}
				else {
					//alert('Erreur : ' + oXmlHttp.statusText);
					displayReponse("Erreur : " + oXmlHttp.statusText,pos);
				}
		}
	};
	oXmlHttp.send(null);
}


function addWidgetLigue1(id,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/displayinfol1.php?module=" + id + "&page=" + page, true);
	oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					//alert('OK : ' + oXmlHttp.responseText);
					displayReponse(oXmlHttp.responseText,"contenu_filinfo");
				}
				else {
					//alert('Erreur : ' + oXmlHttp.statusText);
					displayReponse("Erreur : " + oXmlHttp.statusText,pos);
				}
		}
	};
	oXmlHttp.send(null);
}

function addWidgetligue(id,page,ligue)
{
	//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/displayinfoligue.php?module=" + id + "&page=" + page + "&ligue=" + ligue, true);
	oXmlHttp.onreadystatechange = function () {
		if (oXmlHttp.readyState == 4) {
				if (oXmlHttp.status == 200) {
					//alert('OK : ' + oXmlHttp.responseText);
					displayReponse(oXmlHttp.responseText,"contenu_filinfo");
				}
				else {
					//alert('Erreur : ' + oXmlHttp.statusText);
					displayReponse("Erreur : " + oXmlHttp.statusText,pos);
				}
		}
	};
	oXmlHttp.send(null);
}

function redirect_filinfo()
{
	if (document.getElementById('tri_news').options[document.getElementById('tri_news').selectedIndex].value!="")
	{
			addWidgetInfo(document.getElementById('tri_news').options[document.getElementById('tri_news').selectedIndex].value,0);
	}
}
