function SetDefaultState()
{
    var searchbar = $get('searchbar');
    var leftcontent  = $get('leftcontent');
    var lightboxcontent = $get('lightboxContent');
    
    if (searchbar && leftcontent)
    {
        leftcontent.style.display = '';
        searchbar.style.width = '940px';
    }
}

function SetTabImageDirection(direction)
{
    var el1 = getElementsByClassName(document, "div", "capminmax");
    for (var ii=0; ii < el1.length; ii++)
    {
        var el2 = getElementsByClassName(el1[ii], "img", "minmaximage");
        for (var jj=0; jj < el2.length; jj++)
        {
            var image = el2[jj];
            
            if (direction == "EXPAND")
                image.src = image.src.replace(/Maximize/i,"Minimize");
            else
                image.src = image.src.replace(/Minimize/i,"Maximize");
                
            var t = 0;
            t++;
        }
    }
}

function ExpandContractLightBox(doexpand, save)
{
    var searchbar = $get('searchbar');
    var leftcontent  = $get('leftcontent');
    var lightboxcontent = $get('lightboxContent');
    
    if (searchbar && leftcontent && lightboxcontent)
    {
        if (doexpand != 'Y' && doexpand !='N')
            if (lightboxcontent.style.display == 'none')
                doexpand = 'Y';
            else
                doexpand = 'N';
            
        if (doexpand == 'Y')
        {
            leftcontent.style.display = 'none';
            searchbar.style.width = '750px';
            lightboxcontent.style.display = 'block';
            if (save)
                PageMethods.SetUserState("LBS", "M");
            SetTabImageDirection('EXPAND');
        }
        
        if (doexpand == 'N')
        {
            leftcontent.style.display = '';
            searchbar.style.width = '940px';
            lightboxcontent.style.display = 'none';    
            if (save)
                PageMethods.SetUserState("LBS", "-");    
            SetTabImageDirection('CONTRACT');    
        }
    }
}
