function rotateImage( slideshowSelector ) {
    var $active = $( slideshowSelector + ' .slide.active');

    if ( $active.length == 0 ) $active = $(slideshowSelector + ' .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $(slideshowSelector + ' .slide:first');

    $active.addClass('last-active').removeClass('active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function rotateBanner() {
	rotateImage( '.banner' );
}

setInterval( rotateBanner, 5000 );
