var Fabtabs = Class.create({	initialize: function(element) 	{		this.element = $(element);				this.start();	},		start: function()	{		if (this.element)		{			if (this.eventsList)			{				this.eventsList.each(function(event)				{					event.element.stopObserving(event.event);				}.bind(this));			}						this.eventsList = new Array();						var options = Object.extend({}, arguments[1] || {});						this.menu = $A(this.element.getElementsByTagName('a'));			this.activate(this.getInitialTab());			this.menu.each(this.setupTab.bind(this));		}	},		setupTab: function(elm)	{		if (elm.observe)		{			var event = this.activate.bind(this);			elm.observe('click', event);			this.eventsList.push({element: elm, event: event});		}	},		activate: function(ev)	{		if (!ev.element)		{			elm = ev;		}		else		{			var elm = Event.findElement(ev, 'a');			//Event.stop(ev);		}				this.show(elm);		this.menu.without(elm).each(this.hide.bind(this));	},		activateLast: function()	{		this.activate(this.menu.last());	},		hide: function(elm) 	{		$(elm).removeClassName('active');		$(this.tabID(elm)).removeClassName('active-tab-body');		$(this.tabID(elm)).hide();	},		show: function(elm) 	{		$(this.tabID(elm)).show();		$(elm).addClassName('active');		$(this.tabID(elm)).addClassName('active-tab-body');		$(this.tabID(elm)).removeClassName('hidden');	},		tabID: function(elm) 	{		return elm.href.match(/#(\w.+)/)[1];	},		getInitialTab: function() 	{		if (document.location.href.match(/#(\w.+)/))		{			var loc = RegExp.$1;						var elm = this.menu.find(function(value) 			{				return value.href.match(/#(\w.+)/)[1] == loc; 			});						return elm ? elm : this.menu.first();		}		else		{			return this.menu.first();		}	}});document.observe('dom:loaded',function(){	new Fabtabs('tabs');});