function slideSwitch() {
    
    //first do the images
    
    var $active = $('#gallery-image-container div.gallery-image.active');

    if ( $active.length == 0 ) $active = $('#gallery-image-container div.gallery-image:last');

    var $next =  $active.next().length ? $active.next()
        : $('#gallery-image-container div.gallery-image:first');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
        
    
    //now do the text
    
    var $active2 = $('#gallery-text-container div.gallery-text.active');
    
    $active2.removeClass('active');
    $next2 = $active2.next().length ? $active2.next()
        : $('#gallery-text-container div.gallery-text:first');
    setTimeout("$next2.addClass('active')",1000);
     
}

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