// JavaScript Document
//This file contains the javascript for the slideshow
function slideSwitch() {
//Slideshow1
    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');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
	
//Slideshow2
	var $active2 = $('#slideshow2 a.active');

    if ( $active2.length == 0 ) $active2 = $('#slideshow2 a:last');

    // use this to pull the images in the order they appear in the markup
    var $next2 =  $active2.next().length ? $active2.next()
        : $('#slideshow2 a:first');

    $active2.addClass('last-active');

    $next2.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active2.removeClass('active last-active');
        });
		
//Slideshow3
    var $active3 = $('#slideshow3 a.active');

    if ( $active3.length == 0 ) $active3 = $('#slideshow3 a:last');

    // use this to pull the images in the order they appear in the markup
    var $next3 =  $active3.next().length ? $active3.next()
        : $('#slideshow3 a:first');

    $active3.addClass('last-active');

    $next3.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active3.removeClass('active last-active');
        });



}

$(function() {
    setInterval( "slideSwitch()", 7000 );
});
