﻿function initTabbedContent(maxTab) {
    var myTab = queryString('tab');

    if (myTab == "false") {
        ShowTab('1');
    }
    else if (myTab > maxTab) {
        ShowTab('1');
    }
    else {
        ShowTab(myTab);
    };
};

function initTabEvents() {
    $('#left_tab_controls div, #right_tab_controls div').click(function() {
        $('#tab_content div').attr('class', 'hide');
        $('#left_tab_controls div,  #right_tab_controls div').attr('class', 'off');
        $(this).attr('class', 'on');
        var max = $(this).attr('id').replace('toggle', 'tab');
        $("#" + max).attr('class', 'show');
    });
};


function ShowTab(tabID) {
    var toggle;
    var content;

    toggle = "toggle" + tabID;
    content = "tab" + tabID;

    $("#" + toggle).attr('class', 'on');
    $("#" + content).attr('class', 'show');

};
