//	Based on Mootools and morphlist
//	(c) François Bianco, MIT-style license.

function addHoverEffect()
{
	// Add effect on all the menu boxes, and the ajax request
	$$('#fbi_menucontainer a').each( function(el)
	{
		el.addEvents(
		{
			'mouseover': function()
			{
				el.morph({ 'border-color': '#fff', 'background-color': '#ff6600' });
			},
		
			'mouseout': function()
			{
				el.morph({ 'border-color': '#4d4d4d', 'background-color': '#000' });
			} /*,
			
			'click': function(event)
			{
				//prevent the page from changing
				event.stop();
	
				var content = $('body');
				var myFx = new Fx( content );

				myFx.start(1,0).chain
				( // in this context this. refer to myFx
					function() { content.fade(0); this.start(); },
					function() { $('content').load( el.getElement('a').get('href') ); this.start(); },
					function() { content.fade(1); this.start(); }
				);
			} */
		});
	});
}

window.addEvent('domready', function()
{
	// Navbar effect
	new MorphList( $('fbi_navbar').getElement('ul'), { onClick: function(ev, item) { ev.stop(); }} );
	
	addHoverEffect() ;
});