function AjaxHandler(file, parentClass, callBack, method, returnType)
{
	// alert(arguments.callee.caller);
	// alert("Data type: " + this.dataType);
	if(!returnType) returnType = this.dataType;
	if(!method) method = "GET";
	if(callBack) this.callBack = callBack; // Had to make the callback function optional in case you had scripts that didn't want to process the result.
	this.parentClass = parentClass;
	
	var thisObject = this; // jQuery seems to glom onto the this variable once you start calling its functions.
	$.ajax({
		url: file,
		type: method,
		dataType: "xml",
		processData: false,
		dataFilter: function(data, type){ thisObject.ajaxFilter(data, type) },
		complete: function(request, status){ thisObject.ajaxComplete(request, status) }
	});
}

AjaxHandler.prototype.response = null;
AjaxHandler.prototype.status = "init";
AjaxHandler.prototype.dataType = "html";
AjaxHandler.prototype.callBack = null;
AjaxHandler.prototype.parentClass = null;

// NOTE: jQuery documentation about these events doesn't seem to match in a couple of places.
AjaxHandler.prototype.ajaxComplete = function(request, status)
{
	this.response = request;
	this.status = status;
	
	// alert("ajaxComplete...");
	
	// if(this.callBack) this.callBack(this.parentClass, request, status);
	// alert("Parent: " + this.parentClass[this.callBack]);
	
	if(this.callBack) this.parentClass[this.callBack](request, status);
	// if(this.callBack){ var a = this.parentClass["ajaxCallBack"]; a(this.parentClass, request, status);}
}

AjaxHandler.prototype.ajaxFilter = function(data, type)
{
	// alert("Filter called, data type: " + type);
}

AjaxHandler.prototype.getXML = function()
{
	// if(!this.response){ alert("returning null in case 1"); return null; }
	// if(!this.response.responseXML){ alert("returning null in case 2"); return null; }
	
	// if(typeof(this.response.responseXML) != "object"){ alert("returning null in case 3"); return null; }
	
	return this.response.responseXML;
}