﻿var viewportWidth;
var viewportHeight;
    
function GetViewportDimensions()
{
    if (typeof window.innerWidth != 'undefined')
    {
        // // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
        viewportWidth = window.innerWidth;
        viewportHeight = window.innerHeight;
    }
    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)
        viewportWidth = document.documentElement.clientWidth;
        viewportHeight = document.documentElement.clientHeight;
    }   
    else
    {
        // older versions of IE
        viewportWidth = document.getElementsByTagName('body')[0].clientWidth;
        viewportHeight = document.getElementsByTagName('body')[0].clientHeight;
    }
}

function OpenDialog(msg, title)
{
    if (title == undefined || title == "")
        Dialog.alert(msg, {width:405, height:80, okLabel: "OK", dialogTitle: title});
    else
        Dialog.alert(msg, {width:405, height:140, okLabel: "OK", dialogTitle: title});
        
    WindowCloseKey.init();
}

function SetFocusToControl(controlID)
{
    document.getElementById(controlID).focus();
}

function RemoveFocusFromControl(controlID)
{
    document.getElementById(controlID).blur();
}