var resizeTimeoutId;
window.onresize = function(event) {
    window_resize(event);
}
function window_resize(e) {
    window.clearTimeout(resizeTimeoutId);
    resizeTimeoutId = window.setTimeout('sizeContent();', 10);
}
function submitPostLink() {
    document.postlink.submit();
}
var orgHeight = -1;
var minHeight;
function sizeContent() {
    var t = document.getElementById("topmenu");
    var b = document.getElementById("bottmenu");
    var d = document.getElementById("main_content");
    var f = document.getElementById("footer");

    minHeight = getH() - b.offsetHeight - t.offsetHeight - f.offsetHeight;
    if (orgHeight == -1) {
        orgHeight = d.offsetHeight;
    }
    if (orgHeight < minHeight) {
        d.style["height"] = minHeight.toString() + "px";
    }
    else {
        d.style["height"] = orgHeight.toString() + "px";
    }
}
function isIE() { return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent); }
function getH() {
    var h;
    var b_version = getInternetExplorerVersion();
    if (document.innerHeight) {
        h = document.innerHeight;
    } else if (document.documentElement.clientHeight) {
        h = document.documentElement.clientHeight;
    } else if (document.body) { h = document.body.clientHeight; }
    if (!isIE() || (isIE() && b_version >= 8)) h = h - 35;
    return h;
}
function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}

