/**
 * @author alban
 */
UIView = Object.extend(function(){}, Notifier);
UIView.NAME = UIView.prototype.NAME = "UIView";

UIView.prototype.init = function( )
{
	// Map search location
	$("#searchForm").submit( Delegate.create(this, this.searchAddress) );

	// futaribun stuff
	$("#futaribun").change( Delegate.create(this, this.swapFutari) );

	// slider
	$('#headerMore').hide();
	$('#showHideInfos').click(
		function () {
			$("#headerMore").slideToggle();
			return false;
		}
	);
	
	// Flash
  	var flashvars = false;
	var params = {
		menu: "false",
		wmode: "transparent"
	};
	swfobject.embedSWF("swf/head.swf", "flashHead", "900", "220", "9.0.0", "swf/expressInstall.swf", flashvars, params);
}

UIView.prototype.searchAddress = function( )
{
	var address = $("#search_adress").val();
	this.sendNotification( Notifications.SEARCH_ADDRESS, address );
	return false;
}

UIView.prototype.swapFutari = function()
{
	var val = $("#futaribun").attr("checked");
	
	BimboFacade.getInstance().getModel(ListModel.NAME).setFutaribun(val)
	BimboFacade.getInstance().getView(MapView.NAME).reload()
	BimboFacade.getInstance().getView(ListView.NAME).updateBudget( BimboFacade.getInstance().getModel(ListModel.NAME).getTotalBudget() );
	

	
	return false;
}
