﻿function setHeight()
{
    var main = document.getElementById("PageContent");
    var height = main.offsetHeight; //this is the size of the content
    
    // LeftContent is only on the homepage
    // this is a kludge to deal with an absolute positioned div on the homepage that is undetermined in height
    var leftContent = document.getElementById("LeftContent");
    if (leftContent != null)
    {
        if (leftContent.offsetHeight > 350)
        {
            height = main.offsetHeight + leftContent.offsetHeight - 350;
            
            main.style.height = height + "px";
        }
    }
    var windowHeight = height;

    var left = document.getElementById("LeftSide");
    left.style.height = (windowHeight-25) + "px";
    var right = document.getElementById("RightSide");
    right.style.height = (windowHeight-25) + "px";
}

function getWindowHeight() {
    var windowHeight = 0;
    if (typeof(window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
	        windowHeight = document.documentElement.clientHeight;
        }
        else {
	        if (document.body && document.body.clientHeight) {
		        windowHeight = document.body.clientHeight;
	        }
        }
    }
    return windowHeight;
}
