// getWindowHeight() - get the available window height
function getWindowHeight() {
    var height;
    if (document.all) {     // IE
        height = document.body.clientHeight;
    } else if (document.getElementById) {     // NS 6+
        height = window.innerHeight;
    }
    return height;
}

// resizeHeight() - to resize any DOM element with a style.height attribute.
function resizeHeight(elementRef, height) {
    if (elementRef) {
        elementRef.style.height = height;
    }
}