	function slideSwitch() {
	    var $active = $('#slideshow span.active');
	    if ( $active.length == 0 ) 	
		{ $active = $('#slideshow span:last');}

	var $next =  $active.next().length;

	if ($next==1) {	
		$next=$active.next();	
	} else { $next=$('#slideshow span:first');
	clearInterval(intervalID);	
 	        return;
	}

	    $active.addClass('last-active');
	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0},25, function() {
	            $active.removeClass('active last-active');
	        });
	}

	function slideSwitch_out() {
	    var $active = $('#slideshow span.active');
	    if ( $active.length == 0 ) 	
		{ $active = $('#slideshow span:last');}

	var $prev =  $active.prev().length;

	if ($prev==1) {
		$prev=$active.prev();
	} else { 
		$next=$('#slideshow span:first');
		clearInterval(intervalID2);
 	        return;
	}

	    $active.addClass('last-active');
	    $prev.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 25, function() {
	            $active.removeClass('active last-active');
	        });
	}

        var intervalID=setInterval("slideSwitch()", 50 );
	clearInterval(intervalID);	
        var intervalID2=setInterval("slideSwitch_out()", 50 );
	clearInterval(intervalID2);	

	$(function() {
		$('.linky').hover(function(){ 
			clearInterval(intervalID2);	
			intervalID=setInterval("slideSwitch()", 50 );
		}, function(){ 
			clearInterval(intervalID);	
			intervalID2=setInterval("slideSwitch_out()", 50 );

		});
	});

