<!--
var xmlHttp;

function fetchCalendar(room)
{ 
  xmlHttp = getXmlHttpObject();

  if (xmlHttp)
  {
    var url = "ajax_bookings.php?r=" + room + "&l=2&t=" + Math.floor(Math.random()*99);
    xmlHttp.onreadystatechange = stateChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
  }
}

function stateChanged() 
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
    document.getElementById("BookingCalendar").innerHTML = xmlHttp.responseText;
  } 
}

function getXmlHttpObject()
{
  var xmlHttp = false;
  try
  {
    xmlHttp = new XMLHttpRequest();
  }catch (e){
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }catch (e){
        alert("AJAX ERROR, your browser does not support HTTP Request!");
      }
    }
  }
  return xmlHttp;
} 
//-->

