function getXMLHTTPRequest() {
try {
req = new XMLHTTPRequest();
} catch(err1) {
   try {
   req = new ActiveXObject("Msxml2.XMLHTTP");
   } catch(err2) {
      try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(err3) {
         req = false;
      }
   }
}
return req;
}

var http = getXMLHTTPRequest();

function getCalendar(myurl) {
// random number added to URL to avoid cache problems
var modurl = myurl;
http.open("GET", modurl, true);
// set up the callback function
http.onreadystatechange = useHttpResponse;
http.send(null);
}

function useHttpResponse(type) {
if(http.readyState == 4) {
if(http.status == 200) {
var calValue = http.responseText;
document.getElementById('calDiv').innerHTML = calValue;
document.getElementById('calTitle').innerHTML = '<h2>Event Calendar</h2>';
}
}else{
document.getElementById('calTitle').innerHTML = '<img src="../scripts/calendar/images/loading.gif" style="width:19px; height:19px;"> <b>Loading</b><p>';
}
}