TzLinker.js 845 Bytes
TzLinker = function() {
    var Changer;
    var Disp;

    var domain;

    var hardSwitch = function() {
        Disp.firstChild.nodeValue = '';
        parent.mainFrame.location.href = '/home.html';
    }

    var Switch = function(e) {
        if (e.target.options.selectedIndex == 0) {
            return hardSwitch();
        }

        Disp.firstChild.nodeValue = '?id=' + e.target.value;

        parent.mainFrame.location.href = '/' + e.target.options[e.target.options.selectedIndex].text + '/publish/';
    }

    return {
        init: function() {
            Changer = document.getElementById('menu');
            addEvent(Changer, 'change', Switch);

            Disp = document.getElementById('TzURL').getElementsByTagName('dd')[0].getElementsByTagName('span')[0];
        }
    }
}();

addEvent(window, 'load', TzLinker.init);