var ajaxRequest = function(u, f, m, b, h, s)
{
	this.url = u;
	this.wState = f || function(){};
	this.method = m || 'GET';
	this.body = b || null;
	this.headers = h || false;
	this.sync = s || true;
	this.abortReq = false;
	
	// GECKO und IE 7
	if(window.XMLHttpRequest)
		this.req = new XMLHttpRequest();
	// IE
	else if(window.ActiveXObject)
		this.req = new ActiveXObject('Microsoft.XMLHTTP');
	else
		this.req = false;

	
	// Anfrage an Server schicken
	this.doRequest = function()
	{
	 	// Verbindung zum Server aufbauen
		this.req.open(this.method, this.url, this.sync);
		
		// falls Header der Anfrage gesetzt werden soll
		if(this.headers)
		{
			for(var i=0; i<this.headers.length; i+=2)
			{
				this.req.setRequestHeader(this.headers[i], this.headers[i+1]);
			}
		}
		
		// Anfrage senden
		this.req.onreadystatechange = this.wState;
		this.req.send(this.body);
	}

};