$(document).ready(function()
{
    $.lastFmCallback = function(data)
    {
        var html = [];
        var tracks = data.recenttracks.track;
        for (var i = 0; i < tracks.length; i++)
        {
            var artist = tracks[i].artist['#text'];
            var track =  tracks[i].name;
            var url = tracks[i].url;
            html.push('<li><a href="' + url + '" title="' + artist + ' on last.fm" target="_blank"><span class="lastfm-artist">' + artist + '</span> <span class="lastfm-sep">&ndash;</span> <span class="lastfm-track">' + track + '</span></a></li>');
        }
        document.getElementById('lastfm_update_list').innerHTML = html.join('\n');
    }

    $.getJSON("/ui/scripts/last.fm.php?api_key=b314ec0def0c5c8e47f6198aa6c4a185", $.lastFmCallback);
    $.getJSON("/ui/scripts/twitter.php", twitterCallback);

    $(".project").hover(
        function()
        {
            $(this).find(".hover").show();
        },
        function()
        {
            $(this).find(".hover").hide();
        }
    );
});

Cufon.replace('#nav ul li a', {
    fontFamily : 'gotham-medium',
    hover      : true
});

Cufon.replace(['h1','h2','h3'], {
    fontFamily : 'gotham-bold',
    hover      : true,
    textShadow : '0px 1px rgba(0, 0, 0, 0.5)'
});

Cufon.replace(['.btn', 'h4'], {
    fontFamily : 'gotham-bold',
    hover      : true
});

Cufon.replace('.categories', {
    fontFamily : 'gotham-bold',
    hover      : true,
    textShadow : '0px 1px rgba(0, 0, 0, 0.5)'
});

Cufon.replace('.featured-content .categories', {
    fontFamily : 'gotham-bold',
    hover      : true,
    textShadow : '0px 1px rgba(0, 0, 0, 0.5)'
});

Cufon.replace(['.date *'], {
   fontFamily : 'Chaparral Pro'
});
