//CALENDAR FUNCTIONS//////////////////////////////////////////////////////////////////////////////////
var http, url, div, vars;

function outputResponse(){
	//var myOutput = theOutput;
   document.getElementById(div).innerHTML = http.responseText;
}

function handleHttpResponse() {
  if (http.readyState == 4) {
	outputResponse();
  }
}

function buildCal(p_url,p_div,p_vars) {
  url = p_url; div = p_div; vars = p_vars; http = getHTTPObject();
  http.open("GET", url + vars, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
 }
 
function getHTTPObject() {
  var xmlhttp;
    /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } 
	catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}