function doHttpRequest(cmd, div) {  // This function does the AJAX request 
	myDiv=div;
	//alert(cmd);
    document.getElementById(myDiv).innerHTML = "Loading Menu...";
	http.open("REQUEST", cmd, true);
	http.onreadystatechange = getHttpRes;
	http.send(null);
}

function doHttpRequestLoadMenu(cmd, div) {  // This function does the AJAX request 
	myDiv=div;
	cmd=cmd;
	//alert(cmd);
	http.open("REQUEST", cmd, true);
	http.onreadystatechange = getHttpRes;
	http.send(null);
}

function getHttpRes() {
  if (http.readyState == 4) { 
    res = http.responseText;  // These following lines get the response and update the page
    document.getElementById(myDiv).innerHTML = "";
    document.getElementById(myDiv).innerHTML = res;
    //document.getElementById(myDiv).value = res;
  }
}

function getXHTTP() {
  var xhttp;
   try {   // The following "try" blocks get the XMLHTTP object for various browsers…
      xhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
 		 // This block handles Mozilla/Firefox browsers...
	    try {
	      xhttp = new XMLHttpRequest();
	    } catch (e3) {
	      xhttp = false;
	    }
      }
    }
  return xhttp; // Return the XMLHTTP object
}

var myDiv; // This executes when the page first loads.
var http = getXHTTP(); // This executes when the page first loads.


