// FIXME: handle tab changes during animation // FIXME: disable tabber for print version /* Tabber ----------------------------------------------------------------------------*/ var Tab = Class.create(); Tab.prototype = { initialize: function (tabber, number, container) { this.tabber = tabber; this.number = number; this.container = $(container); var heading = this.container.down("h2"); this.name = heading.innerHTML; heading.addClassName("hidden"); this.id = "tabber"+ this.number +"-trigger"+ this.tabCount; this.listItem = null; this.height = this.container.getHeight(); }, show: function (height) { if (height > 0) this.container.setStyle({height: height + "px"}); this.container.setOpacity(0.0).removeClassName("hidden"); this.selectorListItem().addClassName("tabbertab-active") this.container.morph("height: "+ this.height + "px", { duration: 0.8, afterFinish: (function () { Effect.Appear(this.container); }).bind(this) }); }, hide: function () { this.container.addClassName("hidden"); this.selectorListItem().removeClassName("tabbertab-active") }, selectorListItem: function () { if (!this.listItem) this.listItem = $(this.id).up("li"); return this.listItem; } }; var Tabber = Class.create(); Tabber.tabberCount = 0; Tabber.setup = function (container) { return new Tabber(container); }; Tabber.prototype = { initialize: function (container) { this.container = $(container); new Insertion.Top(this.container, '
') this.tabContainer = this.container.down(".tabbertab-container"); this.number = Tabber.tabberCount; Tabber.tabberCount++; this.tabCount = 0; this.tabs = $A(); this.container.getElementsBySelector(".tabbertab").each(this.setupTab.bind(this)); var html = '