Event.observe(window, 'load', function(e) {
    InitPlayer();
});
function ReceiveRealStageHeight(h, w) {
    if (w == undefined) w = 277;
    if(!Prototype.Browser.IE) h+= 10;
    try {
        window.resizeTo(w, h+40);
    }
    catch (ex) {
        //alert(ex);
    }
}
function InitPlayer() {
    var Config = $F('Player_1_Config');
    var CountryCode = $F('Player_1_CountryCode');
    if (Config == '') {
        alert("No config specified.");
        $('RadioPlayerGoesHere').update('<p>No config was specified in the querystring.<br/>Proper usage is player.aspx?config=MaiFm<br/><a href="javascript:window.close()">Close this window</a></p><br/>');
        return;
    }
    var Url = '/radio.swf?config=' + Config + '&countrycode=' + CountryCode;
    var params = {};
    params.background = 'transparent';
    $('RadioPlayerGoesHere').focus();
    swfobject.embedSWF(Url, "RadioPlayerGoesHere", "265", "400", "10.0.0", "/expressInstall.swf", null, params, null);
    window.setTimeout(function() {
        ResizeExpressInstall();
    }, 1000);
}

function ResizeExpressInstall() {
    var obj = $$('object').find(function(obj){
        return (obj.readAttribute('data').toLowerCase() == '/expressinstall.swf');
    }); 
    if(obj) {
        obj.insert({ before: '<div style="color:#333333;font-size:20px;font-family:Arial;text-align:center;background-color:#B3B3B3">Flash Player Upgrade Required</div><div style="color:#333333;font-size:11px;font-family:Arial;text-align:center;background-color:#B3B3B3">We need to upgrade your flash player. Please click yes below, and when it completes, close all your browsers and restart the radio player.</div>' });
        ReceiveRealStageHeight(400, 320);
    }
}


