function request(_) {
	_ = this;
	_.uid = new Date().getTime().toString()+Math.floor(Math.random()*100).toString();
	_.method = null;
	_.responseText = null;
	_.responseXML = null;
	_.onInit = function(){return null}
	_.onLoaded = function(){return null}
	_.onInteractive = function(){return null}
	_.onError = function(){return null}
	_.onDone = function(){return null}
	_.createXmlHttpRequest=function(){
		if(typeof XMLHttpRequest!="undefined") return new XMLHttpRequest();
		try{return new ActiveXObject("Msxml2.XMLHTTP");}
		catch(E){
			try{return new ActiveXObject("Microsoft.XMLHTTP");}
			catch(e){
				if(typeof this.onFatalError=="function") this.onFatalError(e);
				return null;
			}
			if(typeof this.onFatalError=="function") this.onFatalError(E);
		}
		return null;
	};

	_.post = function() {
		_.method = 'POST';
		_.send()
	}
	_.get = function() {
		_.method = 'GET';
		_.send()
	}
	_.send = function(){
		if(!_.method) return null;
		_.query = '';
		for(var p in _.params) _.query += ((_.query.length>0) ? '&':'')+encodeURIComponent(p)+'='+encodeURIComponent(_.params[p]);
		_.url += '?uid='+_.uid;
		_.req = _.createXmlHttpRequest();
		if (_.req) {
			_.req.open(_.method,(_.method=='GET')?_.url+'&'+_.query:_.url, true);
			_.req.onreadystatechange = function() {
				s = _.req.readyState;
				switch(_.req.readyState){
				case 1:	_.onInit();
					break;
				case 2:	_.onLoaded();
					break;
				case 3:	_.onInteractive();
					break;
				case 4:	if (_.req.status == 200 || _.req.status == 304) {
						_.responseText = _.req.responseText;
						_.responseXML = _.req.responseXML;
						_.onDone();
					} else _.onError();
					_.query = null;
					break;
				}
			};
			if(_.method=='POST') _.req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
			(_.method=='POST') ? _.req.send(_.query):_.req.send(null);
		}
	}
	_.abort = function(){try{_.req.onreadystatechange = null}catch(e){}_.req.abort();}
}