//= require <mootools-core-1.3-full-nocompat>
//= require <puremvc-mootools-port>
//= require <findsalons/ApplicationFacade>
//= require <findsalons/AsyncProxy>
var BottomCenterColumnMediator = function()
{
	this.Extends = Mediator;

	/**
	 * The BottomCenterColumn instance.
	 * 
	 * @type BottomCenterColumn
	 */
	this.bottomCenterColumn = null;

	this.initialize = function(viewComponent /* BottomCenterColumn */)
	{
		this.parent(BottomCenterColumn.NAME, viewComponent);
		this.bottomCenterColumn = viewComponent;
	};

	this.listNotificationInterests = function()
	{
		return [ AsyncProxy.CONTENT_RECEIVED, ApplicationFacade.HASH_RETRIEVED ];
	};

	this.onRegister = function()
	{
		this.bottomCenterColumn.addEventListener("registerMediator", this.bottomCenterColumn_registerMediatorHandler, false, 0, this);
		this.facade.sendNotification(ApplicationFacade.RETRIEVE_CURRENT_HASH, null, BottomCenterColumnMediator.NAME);
	};

	this.handleNotification = function(note /* Notification */)
	{
		switch (note.getName())
		{
			case ApplicationFacade.HASH_RETRIEVED:
				if (note.getType() == BottomCenterColumnMediator.NAME)
					this.bottomCenterColumn.setInitializationState(note.getBody());
				break;

			case AsyncProxy.CONTENT_RECEIVED:
				this.bottomCenterColumn.setContent(note.getBody());
				break;
		}
	};

	this.bottomCenterColumn_registerMediatorHandler = function(event)
	{
		var mediatorClass = event.data[0];
		var view = event.data[1];
		this.facade.registerMediator(new mediatorClass(view));
	};
};
BottomCenterColumnMediator = new Class(new BottomCenterColumnMediator());
BottomCenterColumnMediator.NAME = "BottomCenterColumnMediator";
