﻿function SetSize()
{
    var lngBodyHeight = GetViewportHeight();
    var lngTopHeight = 112;
    var lngHeight = lngBodyHeight - lngTopHeight;
    var lngLeftFiller = lngHeight - 490;

    if (lngHeight > 498)
    {
        document.getElementById('fraMain').style.height = lngHeight;
        if (lngLeftFiller < 1)
        {
            lngLeftFiller = 0;
        }
        document.getElementById('tdLeftFiller').height = lngLeftFiller;
    }
}

function GetViewportHeight()
{
    if (typeof window.innerHeight != 'undefined')
    {// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
      return window.innerHeight
    }
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientHeight != 'undefined' && document.documentElement.clientHeight != 0)
    {// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
       return document.documentElement.clientHeight - 5
    }
    else
    {// older versions of IE
       return document.getElementsByTagName('body')[0].clientHeight
    }
}

function GetViewportWidth()
{
    if (typeof window.innerWidth != 'undefined')
    {// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
      return window.innerWidth
    }
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
    {// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
       return document.documentElement.clientWidth
    }
    else
    {// older versions of IE
       return document.getElementsByTagName('body')[0].clientWidth
    }
}

