// JavaScript Document w0d | Lab Test AJAX
var xmlhttp
var url
var tag
// Chargement des donns, document  charger, TAG o doivent tre charg les donnes. 
function loadXMLDoc(url,tag)
	{
	
	document.getElementById(tag).innerHTML= "Chargement..."
	
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
		{
		xmlhttp=new XMLHttpRequest()
		xmlhttp.onreadystatechange=state_Change
		xmlhttp.open("GET",url,true)
		xmlhttp.send(null)
  
  		}
	// code for IE
	else if (window.ActiveXObject)
		{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
   		if (xmlhttp)
    		{
			xmlhttp.onreadystatechange=state_Change
			xmlhttp.open("GET",url,true)
    		xmlhttp.send()
    		}
 		}
		
	// Chargement du DIV
	function state_Change()
		{
		// if xmlhttp shows "loaded"
		if (xmlhttp.readyState==0)
			{
   			document.getElementById(tag).innerHTML = "Connexion..."
  			}
 		if (xmlhttp.readyState==4)
 			{
 			// if "OK"
 			if (xmlhttp.status==200)
 			{
  			document.getElementById(tag).innerHTML= xmlhttp.responseText
   			}
  		else
  			{
  			document.getElementById(tag).innerHTML= xmlhttp.statusText
  			}
  		}  
  	}
}

function fermer(tagid)
	{
		
		document.getElementById(tagid).innerHTML= ""
		
	}
// ****************************************************************************************


// JavaScript Document w0d | Lab Test AJAX

// Chargement des donns, document  charger, TAG o doivent tre charg les donnes. 
function LoadNEWS()


	{
	url = "../feeds/newsFEED.aspx"
	
	document.getElementById('date').innerHTML= "Chargement..."
	
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
		{
		xmlhttp=new XMLHttpRequest()
		xmlhttp.onreadystatechange=state_ChangeB
		xmlhttp.open("GET",url,true)
		xmlhttp.send(null)
  
  		}
	// code for IE
	else if (window.ActiveXObject)
		{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
   		if (xmlhttp)
    		{
			xmlhttp.onreadystatechange=state_ChangeB
			xmlhttp.open("GET",url,true)
    		xmlhttp.send()
    		}
 		}
		
	// Chargement du DIV
	function state_ChangeB()
		{
		// if xmlhttp shows "loaded"
		if (xmlhttp.readyState==0)
			{
   			document.getElementById('date').innerHTML = "Connexion..."
  			}
 		if (xmlhttp.readyState==4)
 			{
 			// if "OK"
 			if (xmlhttp.status==200)
 			{
				document.getElementById('date').innerHTML = "Connexion..."
			results = xmlhttp.responseText.split(",");

 		   document.getElementById('date').innerHTML = results[0];

   			document.getElementById('titre').innerHTML = results[1];
			
   			document.getElementById('lien').innerHTML = results[2];
   			}
  		else
  			{
  			document.getElementById(tag).innerHTML= xmlhttp.statusText
  			}
  		}  
  	}
}

function changeButton(buttonId) {
	
	document.getElementById("sector1").style.background="url(images/bouton.jpg) no-repeat";
	document.getElementById("sector1").style.color="#FFFFFF";
	document.getElementById("sector2").style.background="url(images/bouton.jpg) no-repeat";
	document.getElementById("sector2").style.color="#FFFFFF";
	document.getElementById("sector5").style.background="url(images/bouton.jpg) no-repeat";
	document.getElementById("sector5").style.color="#FFFFFF";
	document.getElementById("sector8").style.background="url(images/bouton.jpg) no-repeat";
	document.getElementById("sector8").style.color="#FFFFFF";
	
	document.getElementById(buttonId).style.background="url(images/bouton_selected.jpg) no-repeat";
	document.getElementById(buttonId).style.color="#221E1F";
}