(function() {
    YAHOO.util.Event.onContentReady("OnlineRadio", function() {
        var listenNowHyperLink = YAHOO.util.Dom.getElementsByClassName("listenNowLink", "a", "OnlineRadio");

        //For each listen now link for a radio show, get the GUID used to identify the latest show for a radio show.
        //This value was stored in the name tag due to Asp.net "feature" which renames id's of controls running at server to a special id.
        var i;
        for (i = 0; i < listenNowHyperLink.length; i++) {
            var showGuid = listenNowHyperLink[i].name;
            listenNowHyperLink[i].href = 'javascript:launchAudioWindow("/MediaPlayer/AudioPlayer.aspx?ContentGuid=' + showGuid + '")';
        }
    });
})();
