function AjaxClass(){
	var testStatus, testText, http_request;
	var thisObject = this;

	this.defaults = {
		contentType: 'application/x-www-form-urlencoded; charset=ISO-8859-1',
		url: '',
		data: '',
		beforeSend: function(){},
		success: function(){},
		errorDeBugging: true,
		onError: function(msg){alert('An error occurred, please try again later.\nError Code: '+msg);},
		ajaxMimeType: 'text/xml'
	}

	this.init = function(options){
		var optionsArray = new Array('contentType', 'url', 'data', 'beforeSend', 'success', 'errorDeBugging', 'onError');
		var max = optionsArray.length;
		for (var h = 0; h < max; h++){
			var name = optionsArray[h];
			this[name] = (options !== undefined && options[name] !== undefined) ? options[name] : thisObject.defaults[name];
		}
		http_request = getReqObj();
		http_request.open('POST', thisObject.url, true);
		http_request.onreadystatechange = function(){
			if(http_request.readyState == 1){
				thisObject.beforeSend();
			}else if(http_request.readyState == 4){
				if (http_request.status == 200) {
					thisObject.success(http_request.responseText);
				} else {
					if(thisObject.errorDeBugging){thisObject.onError(http_request.status);}
				}
			}
		}
		http_request.setRequestHeader('Content-Type', thisObject.contentType);
		http_request.send(thisObject.data);
		//openPop(thisObject.url+'?'+thisObject.data, 500, 500, 'yes', 'test');
	}

	getReqObj = function(){
		var ajaxRequest = null;

		if (window.XMLHttpRequest){ // Mozilla, Safari,...
			ajaxRequest = new XMLHttpRequest();
			if (ajaxRequest.overrideMimeType) ajaxRequest.overrideMimeType(thisObject.ajaxMimeType);
		}else if(window.ActiveXObject){ // IE
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				}catch(e){}
			}
		}
		return ajaxRequest;
	}
}