﻿// JScript File

function selectedtab()
{
    var tabIndex = document.getElementById("hfldTabIndex").value;
    var tabId = "lefttabs";
    if (tabIndex == "100") 
    {
        tabId = "righttabs";
        tabIndex = "0";
    }
    var tabs = document.getElementById(tabId);
    var a = tabs.children[0].children[tabIndex].children[0];
    var span = a.children[0];
    a.style.background = "url( 'images/selectedtableft2.gif' ) no-repeat left top";
    span.style.background = "url( 'images/selectedtabright2.gif' ) no-repeat right top";
    
    hideDisplaySubMenus(tabIndex)
}

function hideDisplaySubMenus(tabIndex)
{
    var submenus = document.getElementById("submenus");
    submenus.children[0].style.display = "none";
    submenus.children[1].style.display = "none";
    //submenus.children[2].style.display = "none";
    var ulIndex = -1;
    if(tabIndex == "2") ulIndex = 0;
    if(tabIndex == "3") ulIndex = 1;
    if(tabIndex == "4") ulIndex = 2;
    if(ulIndex > -1)
    {   
        var ul = submenus.children[ulIndex];
        ul.style.display = "block";
        var liIndex = document.getElementById("hfldSubMenu").value;
        ul.children[liIndex].children[0].style.background = "url( 'images/indentbg4.gif' ) center center repeat-x";
    }
}

