var Controller_System_Banner = Class.create(
{
	elements: {disconnect:'#banner_disconnectDialog'},

	initialize: function ()
	{
		document.observe('dom:loaded', function()
		{
			if($J(this.elements.disconnect).dialog)
			{
				$J(this.elements.disconnect).dialog({
						autoOpen: false,
						modal: true,
						resizable: false,
						buttons:
						{
							Cancel: function() {
								$J(this).dialog('close');
							},
							Disconnect: function()
							{
								$J(this).dialog('close');
								window.location.replace('/authentication/logout/');
							}
						}
				});
			}
		}.bindAsEventListener(this));
	},

	connect: function ()
	{
		window.location.href = '/authentication/';
	},

	disconnect: function ()
	{
		$J(this.elements.disconnect).dialog('open');
	}
}
);

var controllerSystemBanner = new Controller_System_Banner();
