// LAST.FM RSS //
jQuery(function() {

    jQuery.getFeed({
        url: '/proxy.php?url=http://ws.audioscrobbler.com/1.0/user/planetperki/recenttracks.rss',
        success: function(feed) {
        
            var html = '';
            
            for(var i = 0; i < feed.items.length && i < 1; i++) {
            
                var item = feed.items[i];
                
                html += '<aside id="recently_played">'
                + '<a href="'
                + item.link
                + '">'
                + item.title
                + '</a>'
                + '</aside>';
            }
            
            jQuery('#lastfm').append(html);
        }    
    });
});








// IMAGE SLIDESHOW //
function slideSwitch() {
    var $active = $('.slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('.slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('.slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});











// FORM SUBMIT //
function submitForm()
{
document.contact.submit();
}
