﻿// JScript File

sfHover = function () {
    try {

        var sfEls = document.getElementById("nav").getElementsByTagName("LI");

        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function () {
                this.className += " sfhover";
            }
            sfEls[i].onmouseout = function () {
                this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
        sfEls = document.getElementById("lm").getElementsByTagName("LI");

        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function () {
                this.className += " sfhover";
            }
            sfEls[i].onmouseout = function () {
                this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
    } catch (e) { }
}
clearTextBox = function (obj) {
    if (obj.value == "mailbox") {
        obj.value = ""
    }
    if (obj.value == "pass") {
        obj.value = ""
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
window.addEvent('domready', function () {

    $$('#lm li a').addEvent('click', function (e) { ShowPB(e) });
    $$('div.PB').addEvent('click', function (e) { ShowPB(e) });

    $('right').addEvent('click', function (e) {
        e.stop();
        $('right').tween('margin-top', '-200px');
    });
    $('center').addEvent('click', function (e) {
        e.stop()
        $('right').tween('margin-top', '0px');
    });
});
function ShowPB(e) {
    e.stop();
    var id
    if (e.target.href) {
        id = e.target.href.split("#")[1].replace(/\s+/g, "_");
    } else {
        id = e.target.getParent().id;   
    }
    var PB = $(id).getElement(".PB_detail");
    if (PB.getStyle('margin-top') == '-800px') {
        PB.tween('margin-top', '0px');
    } else {
        PB.tween('margin-top', '-800px');
    }
}
