function popWinOpen(winW, winH, sUrl, sName, iResize, iScroll, iStatus) {
    if (screen) {
        if ((screen.height - winH) < 150) {
            var winX = (screen.width - winW) / 2;
            var winY = 0;
        } else {
            var winX = (screen.width - winW) / 2;
            var winY = (screen.height - winH) / 2;
        }
        var popWindow = window.open(sUrl, sName, "resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH + ",top=" + winY + ",left=" + winX + "");
        if (popWindow) popWindow.focus();
    } else {
        window.open(sUrl, sName, "resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH);
    }
}

function getElementsByClass(searchClass, node, tag) {
    var classElements = new Array();
    if (node == null)
        node = document;
    if (tag == null)
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp('(^|\\s)' + searchClass + '(\\s|$)');
    for (var i = 0,j = 0; i < elsLen; i++) {
        if (pattern.test(els[i].className)) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}

function showGroup(group) {
    var hiddenGroup = getElementsByClass("lmLvl2", group, "div");
    for (var i = 0; i < hiddenGroup.length; i++) {
        hiddenGroup[i].style.display = 'block';
    }
}

function hideGroup(group) {
    var hiddenGroup = getElementsByClass("lmLvl2", group, "div");
    for (var i = 0; i < hiddenGroup.length; i++) {
        hiddenGroup[i].style.display = 'none';
    }
}