// JScript source code


function OpenClose(titleID, listID)
{
    var list = document.getElementById(listID);
    var title = document.getElementById(titleID);
    
    if (list.style.display == 'none')
    {
        list.style.display = 'inline';
        title.className = 'LeftNavOn';
    }
    else
    {
        list.style.display = 'none';
        title.className = 'LeftNavOff';
    }
}

function CarouselTrack(pindex)
{
    stepcarousel.stepTo('mygallery',pindex);
    
    CarouselSquareReset();

    var clicked = document.getElementById("CarouselP" + pindex);
    clicked.style.background = 'url(http://im.morningstar.com/im/store/image_on.gif) 0px 2px no-repeat';
}

function CarouselSquareReset()
{
    var page1 = document.getElementById("CarouselP1");
    var page2 = document.getElementById("CarouselP2");
    var page3 = document.getElementById("CarouselP3");
    var page4 = document.getElementById("CarouselP4");
    
    page1.style.background = 'url(http://im.morningstar.com/im/store/image_off.gif) 0px 2px no-repeat';
    page2.style.background = 'url(http://im.morningstar.com/im/store/image_off.gif) 0px 2px no-repeat';
    page3.style.background = 'url(http://im.morningstar.com/im/store/image_off.gif) 0px 2px no-repeat';
    if (page4 != null)
    {
    page4.style.background = 'url(http://im.morningstar.com/im/store/image_off.gif) 0px 2px no-repeat';
    }
}

function CarouselArrowControl(galleryid, steps)
{
    stepcarousel.stepBy(galleryid,steps);
    var config=stepcarousel.configholder[galleryid];
    var pindex=config.currentpanel+1;
    
    CarouselSquareReset();
    
    var clicked = document.getElementById("CarouselP" + pindex);
    clicked.style.background = 'url(http://im.morningstar.com/im/store/image_on.gif) 0px 2px no-repeat';
}


function FlipTab(tabID)
{
    var tab1 = document.getElementById("Tab1");
    var tab2 = document.getElementById("Tab2");
    var tab3 = document.getElementById("Tab3");
    var tab4 = document.getElementById("Tab4");
    var tab5 = document.getElementById("Tab5");
    
    if (tab1 != null) tab1.style.display = 'none';
    if (tab2 != null) tab2.style.display = 'none';
    if (tab3 != null) tab3.style.display = 'none';
    if (tab4 != null) tab4.style.display = 'none';
    if (tab5 != null) tab5.style.display = 'none';
    
    var onTab = document.getElementById(tabID);
    onTab.style.display = 'inline';
}
