function slideShow() {
    var $active = $('#slideshow div.active');

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

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

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function formhelper() {
	$("#basketRemove").hide();
	$(".editcol input[type='checkbox']").hide();
	
	var $checkboxes = $( "#basketcontent .editcol input[type='checkbox']" );
	$checkboxes.parent().append('<a class="removeitem" title="entfernen"></a>');
	
	$(".removeitem").click(
		function(event) {
			event.preventDefault();
			$(this).parent().find("input[type='checkbox']").attr("checked","checked");
			$('#basketRemove').click();
		}
	);
}	

$(function() {
	if ($('#slideshow div.active').length != 0) {
	    setInterval( "slideShow()", 3000 );
	}
	
	formhelper();		$("a[rel=lightbox]").fancybox({	'transitionIn' : 'fade',	'transitionOut' : 'fade',	'cyclic' : true,	'titleShow' : false	}); 
});

