﻿function pageFormat() {
    var myHeights = new Array();
    myHeights[0] = "mainbody";
    myHeights[1] = "rightBar";
    myHeights[2] = "leftNav";
    myHeights[3] = "widebody";
    myHeights[4] = "demoForm";
    var i = 1;
    var maxHeight = 0;
    for (i = 0; i < myHeights.length; i++) {
        var temp = document.getElementById(myHeights[i])
        if (temp != null) {
            var theight = temp.offsetHeight;
            if (myHeights[i] == "demoForm") {
                theight = theight + 300;
            }
            maxHeight = Math.max(maxHeight, theight);
        }
        else {
            //document.getElementById('mainbody').style.border-right = "solid 1px #D3E4EA";
        }
    }
    if (document.getElementById('rightBar') == null && document.getElementById('mainbody') != null) {
        document.getElementById('mainbody').style.borderRight = "1px solid #D3E4EA";
    }
    if (maxHeight < 500) {
        maxHeight = 500
    }
    if (document.getElementById('heightDiv') != null) {
        document.getElementById('heightDiv').style.height = maxHeight + "px";
    }
    if (document.getElementById('mainbody') != null) {
        document.getElementById('mainbody').style.height = maxHeight + "px";
    }
    if (document.getElementById('leftNav') != null) {
        document.getElementById('leftNav').style.height = maxHeight + "px";
    }
    if (document.getElementById('widebody') != null) {
        document.getElementById('widebody').style.height = maxHeight + "px";
    }
    //alert(document.getElementById('demoForm').offsetHeight);
}