function slideSwitch1() {
    var $active = $('#slideshow1 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow1 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow1 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch2() {
    var $active = $('#slideshow2 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow2 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow2 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch3() {
    var $active = $('#slideshow3 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow3 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow3 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch4() {
    var $active = $('#slideshow4 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow4 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow4 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch5() {
    var $active = $('#slideshow5 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow5 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow5 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch6() {
    var $active = $('#slideshow6 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow6 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow6 a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch7() {
    var $active = $('#slideshow7 a.active');
    if ( $active.length == 0 ) $active = $('#slideshow7 a:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow7 a: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( "slideSwitch1()", 2000 );
    setInterval( "slideSwitch2()", 6000 );
    setInterval( "slideSwitch3()", 8000 );
    setInterval( "slideSwitch4()", 4000 );
    setInterval( "slideSwitch5()", 8000 );
    setInterval( "slideSwitch6()", 8000 );
    setInterval( "slideSwitch7()", 8000 );
});
