// JavaScript Document

function callAjax(phpPageName,params,functionNameGetHttpRes) {
  //  Set our destination PHP page "ajaxpost.php"…
  ajaxRequest.open('POST', phpPageName, true);
  ajaxRequest.onreadystatechange = functionNameGetHttpRes;
  // Set our POST header correctly…
  ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  ajaxRequest.setRequestHeader("Content-length", params.length);
  ajaxRequest.setRequestHeader("Connection", "close");
  // Send the parms data…
  ajaxRequest.send(params);
}
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 ajaxRequest = getXHTTP(); // This executes when the page first loads.


