﻿// JScript File

function calculateSizes() {

    var catchError = "" /*  Just a dummy - used to catch exceptions rather than crashing because the target 
                            elements may be legitimately missing at the time of rendering*/

    var NavBarHeight = document.getElementById('NavBar').offsetHeight +
        document.getElementById('NavBar').offsetTop;

    var MainPaneHeight = document.getElementById('mainPane').offsetHeight +
        document.getElementById('mainPane').offsetTop;

    var ContainerHeight = NavBarHeight;

    if (NavBarHeight < MainPaneHeight) {
        ContainerHeight = MainPaneHeight;
        document.getElementById('NavBar').style.height = MainPaneHeight - 10 + 'px';
    }
    else {
        document.getElementById('mainPane').style.height = NavBarHeight - 10 + 'px';
    }

    document.getElementById('outerContainer').style.height = ContainerHeight - 20 + 'px';
  
    
}
