function AjaxRequest(url, callback) {
	this.xmlhttp = this.initializeAjax();
	this.sendAndLoad(url, callback);
}

AjaxRequest.prototype.initializeAjax = function() {
	if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject) { // code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}

AjaxRequest.prototype.sendAndLoad = function(url, callback) { 
	try  {
		var xmlhttp = this.xmlhttp;
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) { //xmlhttp has received response
				var response = xmlhttp.responseText;
				callback(response);
			}
		};
		xmlhttp.open("GET", url+"&sid="+Math.random(), true); //NOTE: add on the Math.random() to the end as a variable to prevent caching
		//xmlhttp.open("GET", url, true); //NOTE: add on the Math.random() to the end as a variable to prevent caching
		xmlhttp.send(null);
	} catch(e) {
		this.reportAjaxError(e, url, "populating");
	}
}

AjaxRequest.prototype.reportAjaxError = function(err, url, action) {
	window.alert(err + " -- " + action);
}
