// Slideshow script

/***
4 Simple jQuery Slideshow Script
5 Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :)
6***/

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

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

 // use this to pull the images in the order they appear in the markup
 var $next = $active.next().length ? $active.next()
 : $('#slideshow a:first');
 
 // uncomment the 3 lines below to pull the images in random order

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


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

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

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



/***
Slideshow Instance 2
***/

function slideSwitch2() {
 var $active = $('#slideshow2 a.active2');

 if ( $active.length == 0 ) $active = $('#slideshow2 a:last');

 // use this to pull the images in the order they appear in the markup
 var $next = $active.next().length ? $active.next()
 : $('#slideshow2 a:first');
 
 // uncomment the 3 lines below to pull the images in random order

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


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

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

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

/***
Slideshow Instance 3
***/

function slideSwitch3() {
 var $active = $('#slideshow3 a.active3');

 if ( $active.length == 0 ) $active = $('#slideshow3 a:last');

 // use this to pull the images in the order they appear in the markup
 var $next = $active.next().length ? $active.next()
 : $('#slideshow3 a:first');
 
 // uncomment the 3 lines below to pull the images in random order

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


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

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

$(function() {
 setInterval( "slideSwitch3()", 7400 );
});
/***
Slideshow Instance 4
***/

function slideSwitch4() {
 var $active = $('#slideshow4 a.active4');

 if ( $active.length == 0 ) $active = $('#slideshow4 a:last');

 // use this to pull the images in the order they appear in the markup
 var $next = $active.next().length ? $active.next()
 : $('#slideshow4 a:first');
 
 // uncomment the 3 lines below to pull the images in random order

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


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

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

$(function() {
 setInterval( "slideSwitch4()", 7500 );
});
/***
Slideshow Instance 4
***/

function slideSwitch5() {
 var $active = $('#slideshow5 a.active5');

 if ( $active.length == 0 ) $active = $('#slideshow5 a:last');

 // use this to pull the images in the order they appear in the markup
 var $next = $active.next().length ? $active.next()
 : $('#slideshow5 a:first');
 
 // uncomment the 3 lines below to pull the images in random order

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


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

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

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