// Get the HTTP Object

var req;

function processCalChange() {

    if (req.readyState == 4 && req.status == 200) {
      document.getElementById( "SIDE-BLOCK" ).innerHTML = eval(req.responseText);
      expand();
    }
}

function calButton(yw) {
   // code for when the calendar button is pressed
   if (typeof window.ActiveXObject  != 'undefined') {
     //req = new ActiveXObject("Microsoft.XMLHTTP");
     req = new ActiveXObject('MSXML2.XMLHTTP.3.0');
     req.onreadyStateChange = processCalChange;
   } else {
     req = new XMLHttpRequest();
     req.onload = processCalChange;
   }  
   try {
//     req.open('GET','http://www2.agw.ca/json_cal.php?a='+yw, true);
     req.open('GET','/json_cal.php?a='+yw, true);
   }
   catch (e) {
  //     alert(e);
     // fail-over to non-ajax version of side calendar
     window.location.href=window.location.href+'/CALCURRX';
   }
   req.send("");
}
