
	
	var slidewhow_bucle;
	var slidewhow_playing = false;
	var slidewhow_fading;
	
	function slideSwitch(prev, nobucle) {
		clearTimeout(slidewhow_bucle);
		
		if(!slidewhow_fading){
		
			var $active = $('#slideshow a.active');
		
			if ( $active.length == 0 ) $active = $('#slideshow a:last');
		
		
			if(prev){
				var $next =  $active.prev().length ? $active.prev() : $('#slideshow a:last');
			}else{
				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');
			
			slidewhow_fading = true;
			
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 2000, function() {
					$active.removeClass('active last-active');
					slidewhow_fading = false;
				});
			
			if(!nobucle){
				slidewhow_bucle = setTimeout( "slideSwitch()", 4000 );
			}
		}
		
	}
	
	
