﻿
function e(id) {return document.getElementById(id);}

function getWinHeight() {if (window.self && self.innerHeight) {return self.innerHeight;}if (document.documentElement && document.documentElement.clientHeight) {return document.documentElement.clientHeight;}return 0;}

function getWinWidth() {if (window.self && self.innerWidth) {return self.innerWidth;}if (document.documentElement && document.documentElement.clientWidth) {return document.documentElement.clientWidth;}return 0;}

function popup(url, name, height, width, scrollbars)
{
    var popwin;
    var opts = "toolbar=no,status=no,location=no,menubar=no,resizable=yes,height=" + height + ",width=" + width + ",scrollbars=" + scrollbars;
    popwin = window.open("", name, opts);
    popwin.focus();
    popwin.location = url;
    self.name = "opener";
    return false;
}

function closePopup() {timer = setTimeout('window.close();', 2);}

function process() {document.getElementById("processing").style.display = "inline";}

function clearSearch(fld, origValue) {
    if (fld) {
        if (fld.value) {
            if (fld.value == origValue) {
                fld.value = '';
            }
        }
    }
}

function toggleHelp(helpToggleLink) {
    var Dom = YAHOO.util.Dom;
    var helpNode = Dom.getFirstChildBy(Dom.getAncestorByClassName(helpToggleLink, "componentFrame"), function (el) {return Dom.hasClass(el, "componentHelp");});
    if (helpNode) {
        (Dom.hasClass(helpNode, "vis")) ? Dom.replaceClass(helpNode, "vis", "invis") : Dom.replaceClass(helpNode, "invis", "vis");
    }
}

