

/*
*
*	19.08.08, Ali "Ximath" Çevik, Ankara.
*	cevik.ali@gmail.com
*
*	This class is built to prepare standard async. callbacks when needed.
*   This is important to have a unity in a web site. For instance, for an ajax call,
*	whatever the call does, for the sake of consistency, all preload callbacks (e.g loading..) should be
*	the same. 
*
*
*
*
*/
function CallbackStandardization()
{
	
	this.preloadController = new PreloadController();

	this.getStandardPreload = function()
	{
		var instance = this;
		var preloadCallback = function()
		{
			instance.preloadController.preload();
		};

		return preloadCallback;
	}

	this.getStandardFailure = function()
	{
		var failureCallback = function(reason)
		{
		
		};

		return failureCallback;

	}

	/*
		This one returns RPCallbackGroup which consists of successCallback, failureCallback and preLoadCallback 
	*/
	this.getStandardGroup = function(successCallback)
	{
		var instance = this;
		return new RPCallbackGroup(function(mo, mr) { instance.preloadController.afterload(); successCallback(mo, mr); }, this.getStandardPreload(), this.getStandardFailure());
	}

	CallbackStandardization.singleton = this;
}

