﻿function changeSecondaryNavBkg(style)
{   
    var secondaryBar = document.getElementById("secondaryNavBar");
    
    if( style == "Default" )
    {
        secondaryBar.className = "secondaryNavBarSB";
    }
    else
    {
        if( style == "NoSB" )
        {
            secondaryBar.className = "secondaryNavBarNoSB";
        }
        else
        {
            if( style == "DkSB" )
            {
                secondaryBar.className = "secondaryNavBarDrkSB";
            }
        }
    }
}

function setHeight(style)
{   
    changeSecondaryNavBkg(style);
    
    // Sets up all of the three different divs which need their height set dynamically
    
    var mainCont = document.getElementById("mainContainer");
    var leftSpan = document.getElementById("leftShadowRepeater");
    var rightSpan = document.getElementById("rightShadowRepeater");
    var contentBar = document.getElementById("contentBar");
    var wideContentBar = document.getElementById("wideContentBar");
	
    //if(contentBar.offsetHeight > 447)
	//if(contentBar.offsetHeight > 384)
	if(contentBar.offsetHeight < 396)
    {
        mainCont.style.height = (contentBar.offsetHeight + 246) + "px";
    }
    
	mainCont.style.height = (mainCont.offsetHeight+9) + 'px';
    leftSpan.style.height = (mainCont.offsetHeight - 565) + "px";
    rightSpan.style.height = (mainCont.offsetHeight - 565) + "px";
}

function setHeightB(style)
{
    changeSecondaryNavBkg(style);
    
    // Sets up all of the three different divs which need their height set dynamically
    
    var mainCont = document.getElementById("mainContainer");
    var leftSpan = document.getElementById("leftShadowRepeater");
    var rightSpan = document.getElementById("rightShadowRepeater");
    var contentBar = document.getElementById("contentBar");
    var wideContentBar = document.getElementById("wideContentBar");
    
    if(contentBar.offsetHeight > 447)
    {
        //mainCont.style.height = (contentBar.offsetHeight + 222) + "px";
    }
    
	mainCont.style.height = (mainCont.offsetHeight+9) + 'px';
    leftSpan.style.height = (mainCont.offsetHeight - 565) + "px";
    rightSpan.style.height = (mainCont.offsetHeight - 565) + "px";
}

function setHeightWide(style)
{   
         changeSecondaryNavBkg(style);
        
        // Sets up all of the three different divs which need their height set dynamically
        
        var mainCont = document.getElementById("mainContainer");
        var leftSpan = document.getElementById("leftShadowRepeater");
        var rightSpan = document.getElementById("rightShadowRepeater");
        var wideContentBar = document.getElementById("wideContentBar");
            
        if(wideContentBar.offsetHeight > 447)
        {
           // mainCont.style.height = (wideContentBar.offsetHeight + 222) + "px";
        }
        
        //leftSpan.style.height = (mainCont.offsetHeight - 621) + "px";
		mainCont.style.height = (mainCont.offsetHeight+9) + 'px';
		leftSpan.style.height = (mainCont.offsetHeight - 565) + "px";
        rightSpan.style.height = (mainCont.offsetHeight - 565) + "px";
}

function setHeightWideD2(style)
{   
    changeSecondaryNavBkg(style);
    
    // Sets up all of the three different divs which need their height set dynamically
    
    var mainCont = document.getElementById("mainContainer");
    var leftSpan = document.getElementById("leftShadowRepeater");
    var rightSpan = document.getElementById("rightShadowRepeater");
    var wideContentBar = document.getElementById("wideContentBar");
  
    if(wideContentBar.offsetHeight > 447)
    {
        //mainCont.style.height = (wideContentBar.offsetHeight + 222) + "px";
    }
    
	mainCont.style.height = (mainCont.offsetHeight+9) + 'px';
    leftSpan.style.height = (mainCont.offsetHeight - 565) + "px";
    rightSpan.style.height = (mainCont.offsetHeight - 565) + "px";
}

function setHeightWideD(style)
{   
    changeSecondaryNavBkg(style);
    
    // Sets up all of the three different divs which need their height set dynamically
    
    var mainCont = document.getElementById("mainContainer");
    var leftSpan = document.getElementById("leftShadowRepeater");
    var rightSpan = document.getElementById("rightShadowRepeater");
    var wideContentBar = document.getElementById("wideContentBar");
  
    if(wideContentBar.offsetHeight > 447)
    {
        //mainCont.style.height = (wideContentBar.offsetHeight + 222) + "px";
    }
    
	mainCont.style.height = (mainCont.offsetHeight+9) + 'px';
    leftSpan.style.height = (mainCont.offsetHeight - 565) + "px";
    rightSpan.style.height = (mainCont.offsetHeight - 565) + "px";
}