jQuery(function(){
	setTimeout( "slideSwitch()", 6000 );
});

function slideSwitch() {
	var $timeout = 6000;
	var $next = null;
	var $active = jQuery('#motiv img.active');
	if ( $active.length == 0 ) $active = jQuery('#motiv img:last');
	if ($active.next().length) $next = $active.next();
	else 
	{
		$next = jQuery('#motiv img:first');
		$timeout = 1000;
	}
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
	.addClass('active')
	.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
	setTimeout( "slideSwitch()", $timeout );
}
