var url2 = "https://www.citrusjaguars.com/calendar/displayFormCalendar.php"; // The server-side script
function handleHttpResponseBegin() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    var newCalendar = http.responseText;
    document.getElementById('begCalendar').innerHTML = newCalendar;
  }
}

function handleHttpResponseEnd() {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    var newCalendar = http.responseText;
    document.getElementById('endCalendar').innerHTML = newCalendar;
  }
}

function updateFormMonth(month,year,which) {
 
  http.open("GET", url2 + "?month=" + escape(month) + "&year=" + escape(year) + "&which=" + escape(which), true);
  if(which =='beg')
  {
	  http.onreadystatechange = handleHttpResponseBegin;
  	
  }
  else
  {
  	http.onreadystatechange = handleHttpResponseEnd; 	
  }
  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();
	  xmlhttp.overrideMimeType("text/xml"); 
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

var http = getHTTPObject(); // We create the HTTP Object
