﻿//<![CDATA[

TabbedPanel = function() { }

TabbedPanel.prototype.models_scroller = null;
TabbedPanel.prototype.why_buy_scroller = null;
TabbedPanel.prototype.spec_scroller = null;

TabbedPanel.prototype.currentPanel = null;
TabbedPanel.prototype.productsNo = 0;

TabbedPanel.prototype.init = function(panelSelector, productsNo) {
    this.currentPanel = panelSelector;
    this.productsNo = productsNo;
    
    this.switchPanel(null, this.currentPanel);

    $('div.tabbed-menu a:first').addClass('active');

    this.models_scroller = new Models_Scroller();
    this.models_scroller.init('#pnlModels', this.productsNo);
    
    this.why_buy_scroller = new WhyBuy_Scroller();
    this.why_buy_scroller.init('#pnlWhyBuy', this.productsNo);

    this.spec_scroller = new Spec_Scroller();
    this.spec_scroller.init('#pnlSpec', this.productsNo);
};

TabbedPanel.prototype.switchPanel = function(btn, panel) {
    this.currentPanel = panel;

    $('.product-panel').hide();
    $(this.currentPanel).fadeIn(250);

    $('div.tabbed-menu a').removeClass('active');
    $(btn).addClass('active');

    return false;
};

//]]>