
var streamURL = 'http://209.88.205.240:80';

//------------------------------------------------------------------------------
function LoadPlayerObject() {

    if(streamURL=='' || streamURL==null) {
        return;
    };

    if(canDetectPlugins()) {

        if(detectWindowsMedia()) {
            LoadWindowsMediaPlayer();

        } else if(detectReal()){
            LoadRealPlayer();

        } else {
            location.href="radio_nosup.html"
        };
    };
};

//------------------------------------------------------------------------------
function LoadRealPlayer() {

    var autoStart = "true";
    var wmpwidth = 280;
    var wmpheight = 70;

    // document.write('<div style="height:150px;">');
    document.write('<object ID="RPMediaPlayer" width="'+wmpwidth+'" height="'+wmpheight+'" ');
    document.write('    classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"');
    document.write('    codebase="http://www.apple.com/qtactivex/qtplugin.cab">');
    document.write('<param name="Filename" value="'+streamURL+'">');
    document.write('<param name="autoStart" value="'+autoStart+'">');
    document.write('<embed width="'+wmpwidth+'" height="'+wmpheight+'" ');
    document.write('    type="audio/x-pn-realaudio-plugin"');
    document.write('    src="'+streamURL+'"');
    document.write('    autoStart="'+autoStart+'"');
    document.write('    pluginspage="http://www.apple.com/quicktime/download/">');
    document.write('</embed>');
    document.write('</object>');

    // document.write('&nbsp;</div>');

};

//------------------------------------------------------------------------------
function LoadWindowsMediaPlayer() {

    var BufferingTime = 5;
    var SendOpenStateChangeEvents = 1;
    var SendPlayStateChangeEvents = 1;
    var SendStateChangeEvents = 1;

    var ShowCaptioning = 0;
    var ShowControls = 1;
    var ShowAudioControls = 1;
    var ShowDisplay = 0;
    var ShowGotoBar = 0;
    var ShowPositionControls = 1;
    var ShowStatusBar = 1;
    var ShowTracker = 0;
    var autoStart = 1;

    var wmpwidth = 300;
    var wmpheight = 51;

    document.write('<object ID="MediaPlayer" width="'+wmpwidth+'" height="'+wmpheight+'" ');
    document.write('    classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-mplayer2">');
    document.write('<param name="Filename" value="'+streamURL+'">');
    document.write('<param name="autoStart" value="'+autoStart+'">');
    document.write('<param name="BufferingTime" value="'+BufferingTime+'">');
    document.write('<param name="SendOpenStateChangeEvents" value="'+SendOpenStateChangeEvents+'">');
    document.write('<param name="SendPlayStateChangeEvents" value="'+SendPlayStateChangeEvents+'">');
    document.write('<param name="SendStateChangeEvents" value="'+SendStateChangeEvents+'">');
    document.write('<param name="ShowCaptioning" value="'+ShowCaptioning+'">');
    document.write('<param name="ShowControls" value="'+ShowControls+'">');
    document.write('<param name="ShowAudioControls" value="'+ShowAudioControls+'">');
    document.write('<param name="ShowDisplay" value="'+ShowDisplay+'">');
    document.write('<param name="ShowGotoBar" value="'+ShowGotoBar+'">');
    document.write('<param name="ShowPositionControls" value="'+ShowPositionControls+'">');
    document.write('<param name="ShowStatusBar" value="'+ShowStatusBar+'">');
    document.write('<param name="ShowTracker" value="'+ShowTracker+'">');

    document.write('<embed width="'+wmpwidth+'" height="'+wmpheight+'" type="application/x-mplayer2" ');
    document.write('    src="'+streamURL+'"');
    document.write('    autoStart="'+autoStart+'" ');
    document.write('    BufferingTime="'+BufferingTime+'" ');
    document.write('    SendOpenStateChangeEvents="'+SendOpenStateChangeEvents+'"');
    document.write('    SendPlayStateChangeEvents="'+SendPlayStateChangeEvents+'"');
    document.write('    SendStateChangeEvents="'+SendStateChangeEvents+'"');
    document.write('    ShowCaptioning="'+ShowCaptioning+'"');
    document.write('    ShowControls="'+ShowControls+'"');
    document.write('    ShowAudioControls="'+ShowAudioControls+'"');
    document.write('    ShowDisplay="'+ShowDisplay+'"');
    document.write('    ShowGotoBar="'+ShowGotoBar+'"');
    document.write('    ShowPositionControls="'+ShowPositionControls+'"');
    document.write('    ShowStatusBar="'+ShowStatusBar+'"');
    document.write('    ShowTracker="'+ShowTracker+'">');

    document.write('</embed>');
    document.write('</object>');
};


