// http://jonraasch.com/blog/a-simple-jquery-slideshow

function slideSwitch() {
	

	
    var $imgactive = $('#slideshow img.imgactive');



    if ( $imgactive.length == 0 ) $imgactive = $('#slideshow img:last');



    var $next =  $imgactive.next().is ('img') ? $imgactive.next()
        : $('#slideshow img:first');

		

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

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

function slideSwitch2() {
    var $imgactive = $('#slideshow2 img.imgactive');

    if ( $imgactive.length == 0 ) $imgactive = $('#slideshow2 img:last');

    var $next =  $imgactive.next().is ('img') ? $imgactive.next()
        : $('#slideshow2 img:first');

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

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

$(function() {
    setInterval("slideSwitch2()", 2900);
	setInterval( "slideSwitch()", 3700 );
});

