﻿// JScript File
init = function() {    
    var objVideos = $('body').getElements("a.video");
    if (objVideos) {
        objVideos.removeEvents('click');
        objVideos.addEvent('click', function(event) { initVideos(event); event.stop(); } );
    }
}
initVideos = function(e) {
    if (e && e.target) { linkC = e.target; }
    if (window.event && window.event.srcElement) { linkC = window.event.srcElement }
    if (!linkC) { return; }
    if (linkC.tagName == 'IMG') { linkC = linkC.parentNode; }
    if (linkC.tagName == 'SPAN') { linkC = linkC.parentNode; }

    linkC = "watchvideo.aspx?DBVideo=" + escape(linkC.href);

    var blankoutbg = new Element("div", { id: 'blankoutbg', html: '<A id="blankoutClose" href="#close" style="width: 350px;background-color: White;position: absolute; top: 18px; left:30%;"><IMG alt="close the message" src="images/icons/close.gif"><BR>Close</A>', styles: { 'position': 'absolute', 'left': '0px', 'width': '10', 'height': '10', 'background': 'transparent url(../images/backgrounds/blankoutbg.png)'} });
    var iframe = new Element("iframe", { id: 'playvideoframe', src: linkC, styles: { 'position': 'absolute', 'left': '30%', 'width': '350', 'height': '300', 'top': '50px' }, scrolling: 'no', frameborder: '0' });
    iframe.inject(blankoutbg);

    var windowScrollSize = $(window).getScrollSize();
    blankoutbg.setStyles({ width: windowScrollSize.x, height: windowScrollSize.y, top: '0px' });

    blankoutbg.inject($('body'));
    $('blankoutClose').addEvent('click', function() { $('blankoutbg').destroy(); });
    

    e.stop();
    e.stopPropagation();
    e.preventDefault();
}
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 (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('load', init);