     //-----------------------------------
     // Create xmlhttp request object
     //-----------------------------------
var xmlhttp=false;
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhtttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

 if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

    //-----------------------------------------------------------
    // Message handler
    //  - Sends message to script and waits for completion
    //  - On completion, updates page with script output
    //-----------------------------------------------------------
    // url = url to call server-side script
    // resultID = ID of DIV or SPAN element to receive the output
    //-----------------------------------------------------------
function handleMessages (url, resultID) {
  var obj;
  xmlhttp.open("GET", url, true);
  xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) {
            obj = document.getElementById(resultID);
            obj.innerHTML = xmlhttp.responseText;
       }
  }
 xmlhttp.send();
 return 0;
}