if(typeof AjaxUpdater == "undefined") { var AjaxUpdater = {}; }

AjaxUpdater.init = function() {
	this.isUpdating = false;
};

AjaxUpdater.init();

AjaxUpdater.update = function( method, service, callback ) {
	if ( callback === undefined || callback === '' ) {
		callback = this.onResponse;
	}
	if (method.toUpperCase() == "GET") {
		Ajax.makeRequest( method, service, callback );
	} else if (method.toUpperCase() == "POST") {
		var temp = service.split("?");
		this.updateWithPost(temp[0], temp[1], callback);
	}
	
	this.isUpdating = true;
};

AjaxUpdater.updateWithPost = function( service, param, callback ) {
	if ( callback === undefined || callback === '' ) {
		callback = this.onResponse;
	}
	Ajax.makePostRequest( service, param, callback );
	this.isUpdating = true;
};

AjaxUpdater.onResponse = function() {
	if ( Ajax.checkReadyState() == 200 ) {
		this.isUpdating = false;
	}
};

