function slideSwitch(switchSpeed) {
    var $active = jQuery('#slideShow img.active');
    
    if ( $active.length == 0 ) $active = jQuery('#slideShow img:last');

    var $next =  $active.next('img').length ? $active.next('img')
       : jQuery('#slideShow img:first');

    $active.addClass('last-active').fadeOut(switchSpeed);
    
	$next.addClass('active').fadeIn(switchSpeed);
	$active.removeClass('active last-active');
}

jQuery(document).ready(function() { 	

interval = "";

jQuery('#slideShow img:first').css("display", "block").addClass('active');


// Die Next Function haben wir in der eigentlichen Funktion ja schon drin, 
// also rufen wir die Funktion auf und stoppen das Intervall, damit die Slideshow nicht weiterlaeuft
jQuery(".next").click(function() {
	clearInterval(interval);
	slideSwitch(1000);
});

//Nun die Zurueck-Funktion
jQuery(".prev").click(function() {
	clearInterval(interval);
	var $active = jQuery('#slideShow img.active');
	
	if ( $active.length == 0 ) $active = jQuery('#slideShow img:first');
	
	var $next =  $active.prev('img').length ? $active.prev('img')
       : jQuery('#slideShow img:last');
	   
	$active.addClass('last-active').fadeOut(1000);
    
	$next.addClass('active').fadeIn(1000);
	$active.removeClass('active last-active');
});

interval = setInterval ( "slideSwitch(1000)", 4000 );    


});
