var player    =  null;
      var playlist  =  null;
 function displayFirstItem()
      {
        playlist = player.getPlaylist();

        if((playlist != null) && (playlist.length > 0))
        {
          player.addControllerListener('ITEM', 'itemMonitor');
          itemMonitor({index:0});

        }
        else
        {

          setTimeout("displayFirstItem()", 100);
        }
      };

      function playerReady(obj)
      {
        player = gid(obj.id);

        displayFirstItem();
      };


     


function itemMonitor(obj)
{

gid('nowplaying').innerHTML = 'Now Playing: <span><div class=title>' + playlist[obj.index].title + '</div></span> Download at <a href=' + playlist[obj.index].author + '><img src=http://tastyspleen.tv/images/quakeunity.png></img></a>';
gid('foo').innerHTML = gid('nowplaying').innerHTML
.replace('(q3)', '<img src=http://tastyspleen.tv/img/archive_q3_grey.png class=logo></img>')
.replace('(qw)', '<img src=http://tastyspleen.tv/img/archive_qw_grey.png class=logo></img>')
.replace('(etqw)', '<img src=http://tastyspleen.tv/images/etqw_56.png class=logo></img>')
.replace('(q4)', '<img src=http://tastyspleen.tv/images/q4_56.png class=logo></img>')
.replace('(ql)', '<img src=http://tastyspleen.tv/images/ql_56.png class=logo></img>')
.replace('(wsw)', '<img src=http://tastyspleen.tv/img/archive_wsw_grey.png class=logo></img>')
.replace('(doom)', '<img src=http://tastyspleen.tv/img/archive_doom_grey.png class=logo></img>')
.replace('(q2)', '<img src=http://tastyspleen.tv/img/archive_q2_grey.png class=logo></img>');

};


      function gid(name)
      {
        ;
        return document.getElementById(name);
        
        
      };

