﻿function isKeyDate(evt) {
    if (window.event)
        kc = evt.keyCode;
    else
        kc = evt.which;
    return (kc >= '0'.charCodeAt() && kc <= '9'.charCodeAt()) || (kc == 0) || (kc == 8) || (kc == 13) || (kc == 32) || (kc == 47);
}

function isKeyNumber(evt) {
    if (window.event)
        kc = evt.keyCode;
    else
        kc = evt.which;
    return (kc >= '0'.charCodeAt() && kc <= '9'.charCodeAt()) || (kc == 0) || (kc == 8) || (kc == 13) || (kc == 32);
}

function openWindow(page, w, h)
{
    window.open(page, 'newWin', 'width=' + w + ',height=' + h + ',toolbar=no,location=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes');
}

function preparePage()
{
    
}

function setBoxHeight(i1, i2) {
    try {
        b1 = document.getElementById(i1);
        b2 = document.getElementById(i2);
        h = Math.max(b1.offsetHeight, b2.offsetHeight);
        b2.style.height = h;
        b1.style.height = h;
    }
    catch (e) { }
}

function sizeContent()
{
    t = document.getElementById('Header');
    f = document.getElementById('Footer');
    n = document.getElementById('Navigation');
    m = document.getElementById('Main');
    b = document.getElementById('ctl00_BreadCrumb');
    var bh;
    
    if (b)
        bh = b.offsetHeight;
    else
        bh = 0;
        
    //-15 accounts for margin/padding of elements, needs adjusted if those attributes are changed
    if (m.scrollHeight < (document.documentElement.clientHeight - t.offsetHeight - f.offsetHeight - n.offsetHeight - bh - 15))
        m.style.minHeight = document.documentElement.clientHeight - t.offsetHeight - f.offsetHeight - n.offsetHeight - bh - 15;
}