﻿var Browser = { Version: function() {
    var version = 999;
    if (navigator.appVersion.indexOf("MSIE") != -1)
        version = parseFloat(navigator.appVersion.split("MSIE")[1]); return version;
}
}

if (Browser.Version() < 7) {
    // IE6    
    SetScroll();
}

if (window.addEventListener) { // Mozilla, Netscape, Firefox
    window.addEventListener("load", InitScreen, false);
} else if (window.attachEvent) { // IE
    window.attachEvent("onload", InitScreen);
    window.attachEvent("onresize", InitScreen);
}

function InitScreen() {
    try {
        if (Browser.Version() < 7) {
            // IE6
            SetScroll();
        }
        else {
            document.getElementById('divContents').style.position = "fixed";
            document.getElementById('divBackHelp').style.position = "fixed";
            document.getElementById('divFooter').style.position = "fixed";
            document.getElementById('divHeader').style.position = "fixed";
            document.getElementById('divBar').style.position = "fixed";
            document.getElementById('divMsg').style.position = "fixed";
        }
    } catch (e) {}
}
function SetScroll() {
    try {


        // IE6
        if (document.getElementById('divMsg').style.display == "block")
            document.getElementById('divContents').style.height = getWindowHeight() - 115 - 20 + "px";
        else
            document.getElementById('divContents').style.height = getWindowHeight() - 95 - 20 + "px";
    }
    catch (e)
    {}
}
function getWindowHeight() { return f_filterResults(window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0); }
function f_filterResults(n_win, n_docel, n_body) {
    var n_result = n_win ? n_win : 0;
    if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel;
    return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}