// http://www.mywebexperiences.com/javascript/ajaxito/ by René López Caballero 
function Ajaxito(url, callback, post) {
	this.onStateChange = function(){
		if (this.transport.readyState == 4 && this.transport.status == 200) {
			if (this.callback) setTimeout(this.bind(function(){this.callback(this.transport);},this), 10);
			this.transport.onreadystatechange = function(){};
		}
	}
	this.bind = function(caller,obj){ return function(){ return caller.apply(obj,arguments); } }
	this.transport = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : ( window.XMLHttpRequest ? new XMLHttpRequest() : false )
	this.callback = callback || null;
	this.transport.open((post?'post':'get'), url, true);
	this.transport.onreadystatechange = this.bind(this.onStateChange,this);
	if(post){
		this.transport.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
		if (this.transport.overrideMimeType) this.transport.setRequestHeader('Connection', 'close');
	}
	this.transport.send(post);
}
