	function mycarousel_initCallback(carousel)
	{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
	};
	$(document).ready(function() {
		$('#wrap').show('slow', function() { $('#mycarousel').jcarousel({
			start: 22,
			scroll: 5,
        	auto: 2,
        	wrap: 'last',
        	initCallback: mycarousel_initCallback
    	}); });
		$('#mycarousel a').click(function() {
				xx=$(this).attr('span');
				$.get('ajax/'+xx+'.txt', function(data) {
					$("#main_overlay").html(data);
					$('#mainpic').jqGalScroll({width:604,height:300,speed:500});
					$('#main_overlay').css('display','block');
					$('#uebersicht').click(function() {
						$('#main_overlay').css('display','none');
							});
					});
				});
		$('#mycarousel a').hover(function() {
				pp=$(this).find('img').eq(0).attr('src');
				ppn = pp.replace('.jpg', '_on.jpg');
				$(this).find('img').eq(0).attr('src', ppn);
				}, function() {
				$(this).find('img').eq(0).attr('src', pp);
				});
	});


