// ajax.js
// funcions to create xmlhttp object

// create boolean variable to check for a valid IE istance
var xmlhttp = false;

// check if we are using IE
try {
   // if the javascript version is grater then 5
   xmlhttp = new ActiveXObject("Msxml2.XMLHHTP");
} catch (e) {
   // if not, then use the older active x object
   try {
      // if we are using IE
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
      // else we must be using a non-IE browser
      xmlhttp = false;
   }
}
// if we are using a non-IE browser, create JavaScript istance of the object
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
   xmlhttp = new XMLHttpRequest();
}


// function makeRequest: send a server-side request - TEST function
function makeRequest(serverPage, objID) {
   var obj = document.getElementById(objID);
   xmlhttp.open("GET", serverPage);
   xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
         obj.innerHTML = xmlhttp.responseText;
      }
   }
   xmlhttp.send(null);
}

