var activeMenu;
var curMenu;

function startShow(b) {
    curMenu = b;
    if (activeMenu) {
        findByID(activeMenu).style.visibility = "hidden";
    }
    selectsIE6("hidden");
    showMenus();
}

function selectsIE6(visibility) {
    if( navigator.appVersion.indexOf("MSIE 6") == -1
            && navigator.appVersion.indexOf("MSIE 5") == -1) {
        return;
    }
    var selects = document.getElementsByTagName("select");
    for (var i = 0; i < selects.length; i++) {
        if(selects[i].id && selects[i].id.indexOf("hide") > -1) {
            selects[i].style.visibility = visibility;
        }
    }
}

function selectItem(i) {
    findByID("navTabLeft" + i).className = "item_left_selected";
    findByID("navTabMiddle" + i).className = "item_fill_selected";
    findByID("navTabRight" + i).className = "item_right_selected";
}

function deSelectItem(i) {
    findByID("navTabLeft" + i).className = "item_left";
    findByID("navTabMiddle" + i).className = "item_fill";
    findByID("navTabRight" + i).className = "item_right";
}

function findByID(b) {
    var a;
    if (document.getElementById) {
        a = document.getElementById(b);
    } else {
        if (document.all) {
            a = document.all[b];
        }
    }
    return a;
}

function showMenus() {
    activeMenu = "navMenu" + curMenu;
    var a = findByID(activeMenu);
    a.style.visibility = "visible";
}

function hideNavigatorMenus(menusSize) {
    for (var b = 1; b <= menusSize; b++) {
        var a = findByID('navMenu' + b);
        a.style.visibility = "hidden";
    }
    selectsIE6("visible");
}

function bookmark() {
    var _1f = window.location.href;
    var _20 = document.title;
    if (window.sidebar) {
        window.sidebar.addPanel(_20, _1f, "");
    } else {
        if (document.all) {
            window.external.AddFavorite(_1f, _20);
        } else {
            if (window.opera && window.print) {
                var _21 = document.createElement("a");
                _21.setAttribute("href", _1f);
                _21.setAttribute("title", _20);
                _21.setAttribute("rel", "sidebar");
                _21.click();
            }
        }
    }
}

var USER_DATA = {

    Browser: {
        KHTML: /Konqueror|KHTML/.test(navigator.userAgent) &&
               !/Apple/.test(navigator.userAgent),
        Safari: /KHTML/.test(navigator.userAgent) &&
                /Apple/.test(navigator.userAgent),
        Opera: !!window.opera,
        MSIE: !!(window.attachEvent && !window.opera),
        Gecko: /Gecko/.test(navigator.userAgent) &&
               !/Konqueror|KHTML/.test(navigator.userAgent)
    },

    OS: {
        Windows: navigator.platform.indexOf("Win") > -1,
        Mac: navigator.platform.indexOf("Mac") > -1,
        Linux: navigator.platform.indexOf("Linux") > -1
    }
};
