﻿
function calculateSize() {
    if (document.getElementById) {
        var myWidth = 0, myHeight = 0;
        if (typeof (window.innerWidth) == 'number') {
            myHeight = window.innerHeight;
        } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            myHeight = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
            myHeight = document.body.clientHeight;
        }
        var list = myHeight;
        var header = document.getElementById('header');
        if (header != null) {
            list = list - header.clientHeight;
        }
        var tabsControl = document.getElementById('TabsControl');
        if (tabsControl != null) {
            list = list - tabsControl.clientHeight;
        }

        list = list - 90;
        
        if (list < 355)
            list = 355;
        elm = document.getElementById('leftColumn');
        if (elm != null) {
            elm.style.height = list + 'px';
        }
    }
}

function doAttachEvents() {
    //
    // Create event listeners in IE
    //
    if (document.attachEvent) {
        window.attachEvent("onresize", calculateSize);
    }
    //
    // Create event listeners in Gecko browsers
    //
    else if (document.addEventListener) {
        window.addEventListener("resize", calculateSize, false);
    }
}

function doClear(inputField) {
    if (inputField.value == inputField.defaultValue) {
        inputField.value = "";
        inputField.style.color = "black";
    }
}