function getXhr() {
   // Firefox et autres
   if(window.XMLHttpRequest)
      return new XMLHttpRequest();
      
   // IE   
   if(window.ActiveXObject) {
      try {
         return new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
         return new ActiveXObject("Microsoft.XMLHTTP");
      }
   }
   
   return null;
}

function refresh_infos() {
  var xhr = getXhr();
  if (xhr == null)
    return;
    
  xhr.onreadystatechange = function() {
    if(xhr.readyState == 4 && xhr.status == 200) {
      node = xhr.responseXML.documentElement;
      var w1 = node.getAttribute("nbrMembers") == 1 ? "member" : "members";
      var w2 = node.getAttribute("nbrGames") == 1 ? "game" : "games";
      document.getElementById("infos").innerHTML = "<i>Currently online</i> : <br/>"+node.getAttribute("nbrMembers")+" "+w1+" and "+node.getAttribute("nbrGames")+" "+w2;
    }
  }
  
  xhr.open("GET", "getInfos.php", true);
  xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  xhr.send("");
  
  window.setTimeout(refresh_infos,10000);
}