$( function(){
	if($('#Zitat').length === 1){
	var cites = $('#Zitat p'),
		show = Math.floor(Math.random()*cites.length),
		slength = cites.eq(show).text().length;
	if(slength > 80) $('#Zitat p').css('font-size', '50px');
	cites.eq(show).show();
	}

	function mycarousel_initCallback(carousel) {
		$('.jcarousel-control a').bind('click', function () {
			carousel.scroll($.jcarousel.intval($(this).attr('title')));
			return false;
		});

		$('#RightButton').bind('click', function () {
			carousel.next();
			return false;
		});

		$('#LeftButton').bind('click', function () {
			carousel.prev();
			return false;
		});
	};

	// Ride the carousel...
	$(document).ready(function() {
		if($("#mycarousel").length>0) {
			$("#mycarousel").jcarousel({
				scroll: 1,
				easing: 'swing',
				initCallback: mycarousel_initCallback,
				// This tells jCarousel NOT to autobuild prev/next buttons
				buttonNextHTML: null,
				buttonPrevHTML: null
			});
			setTimeout(function(){$('#slideshow').css({opacity:0,visibility:'visible'}).animate({opacity:1},200)},250);
		}
	});
});

