
function updateChangeYearState() {
  if (http.readyState == 4) {
    window.location.reload();
    isWorking = false;
  }
}

var isWorking = false;

function changeYear() {
  if (!isWorking && http) {
    var year = document.getElementById("changeYear").value;
    http.open("GET", 'changeYear.xql?year=' + escape(year)+ '&amp;x=' + Math.random(), true);
    http.onreadystatechange = updateChangeYearState;
          // this sets the calls back function to be invoked when a response from the HTTP request is returned
    isWorking = true;
    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



