﻿function bookmarksite(title, url) {
    if (document.all) { window.external.AddFavorite(url, title); }
    else if (window.sidebar) { window.sidebar.addPanel(title, url, "") }
}

function activateFascia_old(tab, id) {
    var mapBodyID = $('#' + id + ' .MapBody').attr("id");
    meteoLibManager.Add(mapBodyID, eval("mapDefinition_" + mapBodyID));
    meteoLibManager.Init();
    $('.fasce-map').each(function(i) {
        if ($(this).css('display') == 'block') {
            if (!$.browser.msie) { $(this).fadeOut(600); }
            else { $(this).css('display', 'none'); }
        }
    });
    if (!$.browser.msie) { $('#' + id).fadeIn(600); }
    else { $('#' + id).css('display', 'block'); }
    $('.menu-fasce input').each(function(i) {
        $(this).attr('src', $(this).attr('src').replace('-hover.png', '.png'));
    });
    $(tab).attr('src', $(tab).attr('src').replace('.png', '-hover.png'));
    return false;
}

function ShowMap(num) {
    var tabs = $('.commands-panel div.label');
    var maps = $('.fasce-map');
    var tab = tabs[num];
    var map = maps[num];
    var mapBodyID = $('#' + maps[num].id + ' .MapBody').attr("id");
    meteoLibManager.Add(mapBodyID, eval("mapDefinition_" + mapBodyID));
    meteoLibManager.Init();
    $(maps).each(function(i) {
        if ($(this).css('display') == 'block') {
            if (!$.browser.msie) { $(this).fadeOut(600); }
            else { $(this).css('display', 'none'); }
        }
    });
    if (!$.browser.msie) { $(map).fadeIn(600); }
    else { $(map).css('display', 'block'); }
    $(tabs).each(function(i) {
        $(this).removeClass('selected');
        $(this).animate({ paddingTop: 6 }, 400);
    });
    $(tab).addClass('selected');
    $(tab).animate({ paddingTop: 20 }, 400);
    return false;
}

var PopUp = new Array();
function openPopUp(name, path, width, height) {
    if (PopUp[name] != null) { PopUp[name].close(); }
    var top = (screen.height - height) / 2;
    var left = (screen.width - width) / 2;
    PopUp[name] = window.open(path, name, 'left=' + left + ', top=' + top + ', status=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height);
    //if (PopUp.opener == null) PopUp.opener = self;
    return false;
}
