
function slideSwitch() {
    var $activeimg = $('#slideshowTop img.active-img');

    if ( $activeimg.length == 0 ) $activeimg = $('#slideshowTop IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $activeimg.next().length ? $activeimg.next()
        : $('#slideshowTop IMG:first');

    var $sibs  = $activeimg.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );

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

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

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


