$(document).ready(function () {
	
	$("div#scrollbar").smoothDivScroll({
		autoScroll: "always", 
		autoScrollDirection: "endlessloopright", 
		autoScrollStep: 1, 
		autoScrollInterval: 3, 
		ajaxContentURL: "./scrollbar.php"
	});
  
  $("#carousel1").CloudCarousel({			
			xPos: 300,
			yPos: 150,
			mouseWheel:true,
			altBox: $("#alt-text"),
			titleBox: $("#title-text"),
			autoRotate: 'right',
			yRadius:40,
			speed: 0.2,
			FPS: 30,
			autoRotateDelay: 1500
	});
	
	$("#hefte").change(function() {
		$.ajax({
			type: "POST",
    	url: "./ordner.php",
    	dataType : 'html',
    	data: "ordner=" + $("#hefte").val(),
    	success: function(data){
				$("#carousel1").html(data);
				$("#carousel1").CloudCarousel({			
					xPos: 300,
					yPos: 150,
					altBox: $("#alt-text"),
					titleBox: $("#title-text"),
					autoRotate: 'right',
					yRadius:40,
					speed: 0.2,
					FPS: 30,
					autoRotateDelay: 1500
				});
			}
		});
	});
	$.ajax({
		type: "POST",
		url: "./news.php",
		dataType : 'html',
		success: function(data){
			$("div#news").html(data);
			autoScroller('news', 2);
		}
	});
});

