Function.prototype.bind = function(object) {
	var __method = this;
	return function() {
		return __method.apply(object, arguments);
	}
}
function CAjax() {
    this.reqObj;
    this.callback;
    this.method;
    this.url;
    this.isRun = false;
    this.init();
}
CAjax.prototype = {
    init:function() {
        if (window.XMLHttpRequest) {
            this.reqObj = new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            this.reqObj = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else {
            window.status = "create xmlhttp Object err";
            return;
        }
        this.reqObj.onreadystatechange = this.onreadystateChange.bind(this);
        this.method = 'get';
    },
    abort:function() {
        if (this.isRun) {
            this.reqObj.abort();
        }
    },
    open:function(url) {
        this.reqObj.open(this.method, url, true);
    },
    send:function() {
        this.reqObj.send(null);
    },
    request:function(url) {
        this.isRun = true;
        this.open(url);
        this.send();
    },
    onreadystateChange:function() {
        if(this.reqObj.readyState  == 4) {
            try {
                if (this.reqObj.status == 200) {
                    this.isRun = false;
                    if (this.callback) {
                        this.callback(this.reqObj.responseText);
                    }
                }
            }
            catch(e) {
            }
        }
    }
}