/*******************************************************************************
* Software: Ajax Prototype                                                         *
* Version:  1.0                                                                *
* Date:     2007-06-18                                                         *
* Author:   Fernando Vargas L.                                                 *
* License:  Freeware                                                           *
*                                                                              *
* You may use and modify this software as you wish.                            *
*******************************************************************************/

function Ajax(){ 	
	this.parentClass = null;
	this.xmlhttp = false;
	
	try{ 
		// Creacion del objeto AJAX para navegadores no IE
		this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}catch(e){ 
		try{ 
			// Creacion del objet AJAX para IE 
			this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		}catch(E){ this.xmlhttp=false; }
	}

	if ( !this.xmlhttp && typeof XMLHttpRequest!='undefined') { this.xmlhttp=new XMLHttpRequest(); } 
}

Ajax.prototype.abort = function(){ this.xmlhttp.abort(); }

Ajax.prototype.open = function(_method,_url,_asynchronous){	this.xmlhttp.open(_method,_url,_asynchronous); }

Ajax.prototype.send = function(_vars){ this.xmlhttp.send(_vars); }

Ajax.prototype.setRequestHeader = function(_content_type,_type){ this.xmlhttp.setRequestHeader(_content_type,_type); }

Ajax.prototype.onreadystatechange = function(_function){ this.xmlhttp.onreadystatechange = _function; }

Ajax.prototype.readyState = function(){ return this.xmlhttp.readyState; }

Ajax.prototype.status = function(){ return this.xmlhttp.status; }

Ajax.prototype.responseXML = function(){ return this.xmlhttp.responseXML; }

Ajax.prototype.responseText = function(){ return this.xmlhttp.responseText; }

Ajax.prototype.setParentClass = function(_class){ this.parentClass = _class; }