/**
 * Tab component - javascript file
 *
 * @package nova
 * @subpackage javascript
 * @author Liquid Edge Solutions
 * @copyright Copyright Liquid Edge Solutions. All rights reserved.
 *///--------------------------------------------------------------------------------
var com_tab = new Class({
	//--------------------------------------------------------------------------------

	// properties

	//--------------------------------------------------------------------------------
	Extends: com_panel,

	selectedButton: false,
	selectedButtonMouseover: false,
	//--------------------------------------------------------------------------------

    // methods

	//--------------------------------------------------------------------------------
    select: function(tabIndex, options) {
        // change selected button
        var newButton = $(this.id + 'btn' + tabIndex);
        if ($defined(newButton)) {
            // unselected current selected button
            if (this.selectedButton) {
                this.selectedButton.removeClass('tab-button-selected');
                this.selectedButton.onmouseover = this.selectedButtonMouseover;
            }

            // selected new button
            newButton.addClass('tab-button-selected');
            newButton.removeClass('input-button-hover');
            this.selectedButtonMouseover = newButton.onmouseover;
            newButton.onmouseover = null;
            this.selectedButton = newButton;
        }

        // view selected tab
    	this.refresh(tabIndex, options);
    }
    //--------------------------------------------------------------------------------
});
