Ajax = function() {
	// this.request = this.setRequest();
}

Ajax.prototype.request 					= null;
Ajax.prototype.method	 				= null;
Ajax.prototype.url	 					= null;
Ajax.prototype.async	 				= null;
Ajax.prototype.stateChangeCallback 		= null;


Ajax.prototype.setRequest 		= function () {
	if (window.XMLHttpRequest) {
	/*** alle Browser ausser IE | 10.10.2006 | mpf ***/
		this.request = new XMLHttpRequest();
		if (this.request.overrideMimeType) {
			this.request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) {
	/*** IE gehtber ActiveX | 10.10.2006 | mpf ***/
		try {
			this.request = new ActiveXObject("Msxml2.XMLHTTP"); // MS xml2 parser
		} catch (e) {
			try {
				this.request = new ActiveXObject("Microsoft.XMLHTTP"); // MS xml (alter) parser
			} catch (e) {}
		}
	}
	if (this.request == null) {
	/*** Kein xhttp objekt erzeugt. evtl activeX ausgeschaltet | 10.10.2006 | mpf ***/
		alert('Fehler : Kann keine XMLHTTP-Instanz erzeugen');
		// return false;
	}
	
}

Ajax.prototype.send 		= function () {
	this.request.open( this.method, this.url, this.async);
	if(this.method == 'post') {
		// this.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		// this.request.setRequestHeader("Content-length", params.length);
		// this.request.setRequestHeader("Connection", "close");
		// this.request.send(params);
		this.request.send(null);
	} else {
		this.request.send(null);
	}

	return this.request.responseText;
}


Ajax.prototype.setStateChangeCallback 		= function ( callback ) {
	this.stateChangeCallback = callback;
	if( this.request != null ) {
		this.request.onreadystatechange = this.stateChangeCallback;
	}
}

Ajax.prototype.setMethod 		= function ( method ) {
	this.method = method;
}

Ajax.prototype.setUrl	 		= function ( url ) {
	this.url= url;
}

Ajax.prototype.setAsync 		= function ( async ) {
	this.async = async;
}
