function slideSwitch() {
    var $active = $('#slideshow img.active');

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch2() {
    var $active = $('#slideshow2 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow2 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow2 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch3() {
    var $active = $('#slideshow3 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow3 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow3 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch4() {
    var $active = $('#slideshow4 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow4 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow4 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch5() {
    var $active = $('#slideshow5 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow5 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow5 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch6() {
    var $active = $('#slideshow6 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow6 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow6 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch7() {
    var $active = $('#slideshow7 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow7 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow7 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch8() {
    var $active = $('#slideshow8 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow8 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow8 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch9() {
    var $active = $('#slideshow9 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow9 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow9 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch10() {
    var $active = $('#slideshow10 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow10 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow10 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitch11() {
    var $active = $('#slideshow11 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow11 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow11 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch12() {
    var $active = $('#slideshow12 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow12 img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow12 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 3000 );
	setInterval( "slideSwitch2()", 3500 );
	setInterval( "slideSwitch3()", 3000 );
	setInterval( "slideSwitch4()", 3500 );
	setInterval( "slideSwitch5()", 3000 );
	setInterval( "slideSwitch6()", 3500 );
	setInterval( "slideSwitch7()", 3500 );
	setInterval( "slideSwitch8()", 3200 );
	setInterval( "slideSwitch9()", 3500 );
	setInterval( "slideSwitch10()", 3200 );
	setInterval( "slideSwitch11()", 3000 );
	setInterval( "slideSwitch12()", 3500 );	
});
