var xmlHttpReq = false;
function doAjax(url, data, clientFunction) {
	var self = this;
	if (self.xmlHttpReq) self.xmlHttpReq.abort();
	// Mozilla/Safari
	if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
	}
	// IE
	else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}
	self.xmlHttpReq.open('POST', url, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function() {
		if (self.xmlHttpReq.readyState == 4) {
			var args = [];
			args.push(self.xmlHttpReq.responseText);
			clientFunction.apply(this, args);
		}
	}
	self.xmlHttpReq.send(data);
}
