﻿function openExternalLink(link) {
    var newWindow = window.open('popup/NowLeaving.aspx?link=' + link, '_blank', 'menubar=1,resizable=1,toolbar=1,location=1,status=1,scrollbars=1,width=600,height=300');
    newWindow.focus();
}
function openExternalLinkSubFolder(link) {
    var newWindow = window.open('../popup/NowLeaving.aspx?link=' + link, '_blank', 'menubar=1,resizable=1,toolbar=1,location=1,status=1,scrollbars=1,width=600,height=300');
    newWindow.focus();
}

var Browser = {  
    Version: function() {
        var version = 999; 
        // we assume a sane browser
        if (navigator.appVersion.indexOf("MSIE") != -1)
        // bah, IE again, lets downgrade version number
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);

        return version;
    }
}

function addClickEventHandler(func) {
    var previous_handler = document.onclick;
    if (typeof document.onclick != "function")
        document.onclick = func;
    else document.onclick = function(e) {
        previous_handler(e);
        func(e);
    }
}

// Calendar control functions
function showCalendar(cal, top, left) {
    var t = document.getElementById(cal)
    t.style.marginTop = top + "px";
    t.style.marginLeft = left + "px";    
    t.style.display = 'block';
}

function hideCalendar(cal) {
    if (document.getElementById(cal))
        document.getElementById(cal).style.display = 'none';
}
