function XMLReqObj() {
  //this.xmlClient=null;
  this.initXMLReqObj();
  this.DEAD = false;
  /*
  actionFunc is called automatically when the XML string is successfully retrieved
  it is passed the XML string as it's argument
  actionFunc can be set (externally) as any javascript code, just like it is here
  this keeps this object flexible
  */
  this.actionFunc = function (ajaxstr) {
    eval(ajaxstr);
  }
}
XMLReqObj.prototype.initXMLReqObj = function () {
    if (window.XMLHttpRequest) {
            this.xmlClient = new XMLHttpRequest();
            if (!this.xmlClient) {
                    this.initFailure();
            }
    }
    else if(window.ActiveXObject){
            this.xmlClient = new ActiveXObject("MsXml2.XmlHttp");
            if (!this.xmlClient) {
                    this.initFailure();
            }
    }
    else {
            this.initFailure();
    }
//alert(this.xmlClient);
}
XMLReqObj.prototype.initFailure = function() {
        this.DEAD = true;
        this.xmlClient = null;
        alert("***\n\nYour browser does not properly support the XMLHttpRequest Object.\n\nYou will not be able to use the full functionality of this page.\n\n***");
}
XMLReqObj.prototype.processReqStatChange = function() {
//alert(this.xmlClient);
        if (this.xmlClient.readyState == 4) {
                if (this.xmlClient.status == 200) {
                        //eval(this.xmlClient.responseText);
                        this.actionFunc(this.xmlClient.responseText);
                        this.xmlClient = null;
                }
                else {
                        // ERROR this.setContent("There was a problem retrieving the XML data:\n" + this.xmlClient.statusText);
                }
        }
}
XMLReqObj.prototype.getFile = function(URL) {
        if (this.xmlClient && !this.DEAD) {
//alert(this.xmlClient);
                //this.xmlClient.onreadystatechange = this.processReqStatChange();
                this.xmlClient.onreadystatechange = function () {
                  xmlobj.processReqStatChange();
                }
                this.xmlClient.open("GET", URL, true);
                this.xmlClient.send(null);
        }
        else if(this.DEAD) {
                this.initFailure();
        }
        else {
                this.initXMLReqObj();
                this.getFile(URL);
        }
}

var xmlobj = new XMLReqObj();
var xmlrequestloaded = false;
