function AJAX(){
	this.peticion_http = null;
}

AJAX.prototype.inicializa_xhr = function(){
	if (window.XMLHttpRequest) {
		this.peticion_http = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		this.peticion_http = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

AJAX.prototype.realizaPeticion = function(url, metodo, parametros, funcion){
	if(this.peticion_http == null){
		this.inicializa_xhr();
	}
	if (this.peticion_http != null) {
		this.peticion_http.onreadystatechange = funcion;
		this.peticion_http.open(metodo, url, true);
		if(metodo=='post')
			this.peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
		this.peticion_http.send(parametros);
	}
}
