﻿
var home_current_tab_0 = "journals";
var home_current_tab_1 = "photos";

function swapTabPanel(obj, group)
{
    if (obj == null)
        return;
    if (group == null)
        group = 0;
        
    var current_tab;
    if (group == 0)
        current_tab = home_current_tab_0;
    else
        current_tab = home_current_tab_1;
    
    var values = obj.id.split("_");
    var tabId = values[1];
    var tab = "tabActive_" + tabId;
    var panel = "tabPanel_" + tabId;
    
    var currentTab = "tabActive_" + current_tab;
    var currentPanel = "tabPanel_" + current_tab;
    
    if (current_tab != tabId)
    {
        hide(currentTab);
        hide(currentPanel);
        
        show(tab);
        show(panel);
        
        if (group == 0)
            home_current_tab_0 = tabId;
        else
            home_current_tab_1 = tabId;
    }
    
}