﻿var Browser = { Version: function() {
    var version = 999;
    if (navigator.appVersion.indexOf("MSIE") != -1)
        version = parseFloat(navigator.appVersion.split("MSIE")[1]); return version;
}
}
if (window.addEventListener) { // Mozilla, Netscape, Firefox
    window.addEventListener("load", InitScreen, false);
} else { // IE
    window.attachEvent("onload", InitScreen);
}

// IE6
if (!window.addEventListener)
{
    window.attachEvent("onresize", InitResize);
}


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 InitResize() {
    if (Browser.Version() < 7) {
        // IE6
        SetScroll();
    }
}
function SetScroll() {
    try {


        // IE6        
        if (divMsg.style.display == "block")
            divContents.style.height = getWindowHeight() - 115 - 20 + "px";
        else
            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;
}