
NaosHandler =
{
	_customOperationHandler: new Array(),
	
	customOperation: function(module, type, data)
	{
		for(var i=0; i<NaosHandler._customOperationHandler.length; ++i)
		{
			if(NaosHandler._customOperationHandler[i].module == module
				&& NaosHandler._customOperationHandler[i].type == type)
			{
				NaosHandler._customOperationHandler[i].callback(data);
			}
		}
	},
	
	registerCustomOperationHandler: function(module, type, callback)
	{
		NaosHandler._customOperationHandler.push(
			{module: module, type: type, callback: callback});
	},
	
	
	_viewUpdateNotifier: new Array(),
	
	viewUpdateNotifier: function(view, output)
	{
		for(var i=0; i<NaosHandler._viewUpdateNotifier.length; ++i)
		{
			if(NaosHandler._viewUpdateNotifier[i].view == view)
			{
				NaosHandler._viewUpdateNotifier[i].callback(output);
			}
		}
	},
	
	registerViewUpdateNotifier: function(view, callback)
	{
		NaosHandler._viewUpdateNotifier.push(
			{view: view, callback: callback});
	},
	
	
	_documentOnLoadNotifier: new Array(),
	
	documentOnLoadNotifier: function()
	{
		for(var i=0; i<NaosHandler._documentOnLoadNotifier.length; ++i)
		{
			NaosHandler._documentOnLoadNotifier[i].callback();
		}
	},
	
	registerDocumentOnLoadNotifier: function(callback)
	{
		NaosHandler._documentOnLoadNotifier.push(
			{callback: callback});
	}
	
}
