function AjaxRequestClass()
{
    this.xmlDoc = false;
    this.xml = false;
    this.text = false;
    this.method = 'GET';
    this.vars = null;
    this.retObj = false;
}

AjaxRequestClass.prototype = {
    fetchUrl : function (url, obj)
    {
        var _this = this;
        if (typeof window.ActiveXObject != 'undefined' ) {
          this.xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
          this.xmlDoc = new XMLHttpRequest();
        }
        this.xmlDoc.onreadystatechange = function(e) { _this.waitForXML(obj); }
                
        this.xmlDoc.open(this.method, url, true);
        if(this.method == 'POST') {
        	this.xmlDoc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=Windows-1251");
        }               
        this.xmlDoc.send(this.vars);
    },

    waitForXML : function(obj)
    {
        if (this.xmlDoc.readyState != 4) return;
        this.text = this.xmlDoc.responseText;
        if(this.retObj) obj.dataFromXML(this.xmlDoc);
        else obj.dataFromXML(this.xmlDoc.responseXML);
    }
}