var serverAddress = "/include/ajax.asp";
var cache = new Array();
function getHttpObject() {
    var objType = false;
    try {
        objType = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        try {
            objType = new ActiveXObject('Microsoft.XMLHTTP');
        } catch(e) {
            objType = new XMLHttpRequest();
        }
    }
    return objType;
}
function getAJAX(postBody,messageID){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX(messageID);};
  theHttpRequest.open("POST", serverAddress, true);
  theHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  theHttpRequest.send(postBody);

    function processAJAX(messageID){
       if (theHttpRequest.readyState == 4) {
         if (theHttpRequest.status == 200) {
           document.getElementById(messageID).innerHTML = theHttpRequest.responseText;
           //setTimeout("validate();", 500);
         } else {
           document.getElementById(messageID).innerHTML="<p>错误信息:&nbsp;" + theHttpRequest.statusText +"<\/p>";
         }
       }
    }
}
function validate(messageID,thisid,filemenu){
    cache.push("filemenu="+filemenu+"&thisid="+thisid);
  if (cache.length > 0){
    var cacheEntry = cache.shift();
    getAJAX(cacheEntry,messageID);
  }
}
