function slideSwitch() {
    var $active = $('#slideshow .slide.active');

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

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

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

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

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

function slideSwitch2() {
    var $active = $('#photos1 .slide.active');

    if ( $active.length == 0 ) $active = $('#photos1 .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $('#photos1 .slide:first');

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

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

$(function() {
    setInterval( "slideSwitch2()", 9000 );
});

function slideSwitch3() {
    var $active = $('#photos2 .slide.active');

    if ( $active.length == 0 ) $active = $('#photos2 .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $('#photos2 .slide:first');

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

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

$(function() {
    setInterval( "slideSwitch3()", 11000 );
});

function slideSwitch4() {
    var $active = $('#photos3 .slide.active');

    if ( $active.length == 0 ) $active = $('#photos3 .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $('#photos3 .slide:first');

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

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

$(function() {
    setInterval( "slideSwitch4()", 10000 );
});

function slideSwitch5() {
    var $active = $('#photos4 .slide.active');

    if ( $active.length == 0 ) $active = $('#photos4 .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $('#photos4 .slide:first');

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

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

$(function() {
    setInterval( "slideSwitch5()", 9000 );
});

function slideSwitch6() {
    var $active = $('#photos5 .slide.active');

    if ( $active.length == 0 ) $active = $('#photos5 .slide:last');

    var $next =  $active.next().length ? $active.next()
        : $('#photos5 .slide:first');

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

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

$(function() {
    setInterval( "slideSwitch6()", 11000 );
});

$(function() {
	// Use this example, or...
	$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
});
