/*
 * (C) 2008 ep@acm.org
 */
 
function radio_update() {
    deck = $(".radio_deck").attr('deck');
    if (deck == undefined) {
        deck = '5';
    }
    $.getJSON('http://radio.slice.corp.it/otto/info?deck=' + deck + '&version=1&c=?',
        function(data) {
            $(".radio_current").html(data.current);
            $(".radio_deck").html('');
            deck_html = '';
            $.each(data.deck, function(i, item) {
                line = item.start + " - " + item.name
                $("<li/>").append(line).appendTo($(".radio_deck"));
            });
        });
}
 
$(document).ready(function() {
    radio_update();
    setInterval(radio_update, 30000);
});
