function ajaxWrapper(successCallBack, errorCallBack) {

	this.ajax_obj;
	this.ajax_timer;
	this.onSuccess=successCallBack;
	this.onError=errorCallBack;

	var that=this;

	this.ajax_load=function() {
		if(window.XMLHttpRequest) {
				this.ajax_obj=new XMLHttpRequest();
		}
		else if (window.ActiveXObject) {
			this.ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");
			if (!this.ajax_obj) {
				this.ajax_obj=new ActiveXObject("Msxml2.XMLHTTP");
			}
		}
	}

	this.ajax_doGet=function(url, params) {
		this.ajax_load();

		url+=(params==undefined) ? "?timestamp=" + new Date().getTime() : "?timestamp=" + new Date().getTime() + "&" + params;

		this.ajax_obj.onreadystatechange=this.ajax_response;
		this.ajax_obj.open("GET", url, true);
		this.ajax_obj.send(null);
	}

	this.ajax_doPost=function(url, params) {
		this.ajax_load();

		params=(params==undefined) ? null : params;

		this.ajax_obj.onreadystatechange=this.ajax_response;
		this.ajax_obj.open("POST", url, true);
		this.ajax_obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		this.ajax_obj.send(params);
	}

	this.ajax_response=function() {
		try {
			if(that.ajax_obj.readyState == 4) {
				if(that.ajax_obj.status == 200) {
					that.onSuccess(that.ajax_obj.responseText);
				}
				else {
					that.onError("A problem occurred with communicating between " +
						"the XMLHttpRequest object and the Server program.");
				}
			 }
		}
		catch(err) {
			that.onError(err);
		}
	}

	this.ajax_doGetXML=function(url, params) {
		this.ajax_load();

		url+=(params==undefined) ? "?timestamp=" + new Date().getTime() : "?timestamp=" + new Date().getTime() + "&" + params;
		
		this.ajax_obj.onreadystatechange=this.ajax_responseXML;
		this.ajax_obj.open("GET", url, true);
		this.ajax_obj.send(null);
	}

	this.ajax_doPostXML=function(url, params) {
		this.ajax_load();

		params=(params==undefined) ? null : params;

		this.ajax_obj.onreadystatechange=this.ajax_responseXML;
		this.ajax_obj.open("POST", url, true);
		this.ajax_obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		this.ajax_obj.send(params);
	}

	this.ajax_responseXML=function() {
		try {
			if(that.ajax_obj.readyState == 4) {
				if(that.ajax_obj.status == 200) {
					var objDom = new XMLDoc(that.ajax_obj.responseText); // Requires xmldom.js (XML for <script> Parser)
					var objDomTree = objDom.docNode;
					that.onSuccess(objDomTree);
				}
				else {
					that.onError("A problem occurred with communicating between " +
						"the XMLHttpRequest object and the Server program.");
				}
			 }
		}
		catch(err) {
			that.onError(err);
		}
	}
}