var thePlayerWin=null;

function launchPlayer(doc)
{
    if (doc==null) {
        doc = '?type=audio&id=bogus';
    }
    // check if player open
    if (thePlayerWin!=null && !thePlayerWin.closed)
        {
            //setTimeout(thePlayerWin.addPlaylistItem(doc), 2000);
            thePlayerWin.addPlaylistItem(doc);
            thePlayerWin.focus();
        }
    else
        {
            thePlayerWin=window.open("http://www.kcrw.com/media-player/mediaPlayer2.html"+doc,
                                     "_player",
                                     "height=640,width=880,status=yes,toolbar=no,menubar=no,location=no");
        }
    return false;
}

function bookmarkProgram(id) {
    if (thePlayerWin == null || thePlayerWin.closed) {
        launchPlayer();
    }
    thePlayerWin.bookmarkProgramItem(id);
    return false;
}
function bookmarkShow(id) {
    if (thePlayerWin == null || thePlayerWin.closed) {
        launchPlayer();
    }
    thePlayerWin.bookmarkShowItem(id);
    return false;
}
    