//added by JosephKnight.com, a modification of Jon Raasch's Simple jQuery Slideshow
function slideSwitch(loop) {
	if (typeof loop == "undefined") {loop = true};
    var $active = $('#slideshow li.active');

	//stop at last slide or loop?
	if (!loop) {
		if ( $active.attr('id') == $('#slideshow li.slide:last').attr('id') ) {
			clearInterval(intervalID);
			return;
		};
	};

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

    var $next =  $active.next().length ? $active.next() : $('#slideshow li.slide:first');

    $active.addClass('last-active');
	$active.children(".caption").animate({opacity:0.0},800,function(){
		$active.animate({opacity: 0}, 500, function(){
			$next.children(".caption").css({opacity:0.0});
		    $next
		        .animate({opacity: 1.0}, 500, function() {
					$next.children(".caption").animate({opacity:1.0});
		            $active.removeClass('active last-active');
		        })
				.addClass('active');		
		});		
	})
}

