﻿Popup = {
    open: function(url, width, height, name, toolbar, scroll, x, y) {
        if (name == null) {
            var name = new Date();
            name = name.getTime();
            name = name.toString();
        }

        toolbar = toolbar ? 'yes' : 'no';
        scroll = scroll ? 'yes' : 'no';
        var features = 'toolbar=' + toolbar + ',menubar=' + toolbar + ',location=' + toolbar + ',status=' + toolbar + ',scrollbars=' + scroll + ',resizable=' + scroll;
        if (width) features += ',width=' + width;
        if (height) features += ',height=' + height;
        if (x) features += ',screenX=' + x + ',left=' + x;
        if (y) features += ',screenY=' + y + ',top=' + y;
        this.reference = window.open(url, name, features);

        if (this.reference != null && !this.reference.closed) {
            this.reference.focus();
        }
    },

    openCenter: function(url, width, height, name, toolbar, scroll) {
        var x = (width && window.screen.availWidth) ? Math.round((window.screen.availWidth - parseInt(width)) / 2) : 0;
        var y = (height && window.screen.availHeight) ? Math.round((window.screen.availHeight - parseInt(height)) / 2) : 0;
        this.open(url, width, height, name, toolbar, scroll, x, y);
    }
}

function openWebRadio(url) {
    Popup.openCenter(url, 510, 240, 'webradio', false, false);
    return false;
}

function showBanner(whichone) {
    switch (whichone) {
        case "blues":
            //do something
            break;
        default:
            document.write('<a href="http://www.concordmusicgroup.com/albums/Place-To-Be/"> <embed src="/images/newbanner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="666" height="60"></embed></a>');
    }
}