$(document).ready(function(){
	if($("ul#kategorie")) {
		$("ul#kategorie").hide();
		$("#bilder").css({ overflow: "hidden", height: "415px" });
		$("#bildermalanders").css({ overflow: "hidden", height: "415px" });
		$("#blockbildauswahl ul").css({ position: "absolute"});
		
		$("#kategorie_aktiv").hover(function(){
		  $("ul#kategorie").slideDown("fast");
		},function(){
		  $("ul#kategorie").slideUp("medium");
		});
		
		$('#bilder a').each(function() {		
			$(this).click( function() {
				$('#bilder a').removeClass();
				$(this).addClass('selected');
				$("#inhalt img").attr({ src:$(this).attr("rel"), alt: "Gro&szlig;ansicht - Bildagentur Kr&auml;ling" });
				return false;
			});
		}); 
	
		$('#bilder').serialScroll({
			items:'a', //selector to the items ( relative to the matched elements, '#sections' in this case )
			prev:'#nachoben',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
			next:'#nachunten',//selector to the 'next' button (absolute too)
			axis:'y',//the default is 'y'
			event:'click',//on which event to react (click is the default, you probably won't need to specify it)
			stop:false,//each click will stop any previous animations of the target. (false by default)
			lock:false, //ignore events if already animating (true by default)
			duration:700,//length of the animation
			start:0, //on which element (index) to begin ( 0 is the default, redundant in this case )
			force:true, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
			cycle:false,//cycle endlessly ( constant velocity, true is the default )
			step:2, //how many items to scroll each time ( 1 is the default, no need to specify )
			jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
			onBefore:function( e, elem, $pane ){
				/**
				 * 'this' is the clicked element 
				 * e is the event object
				 * elem is the element we'll be scrolling to
				 * $pane is the element being scrolled
				 */
			},
			onAfter:function( elem ){
				//'this' is the element being scrolled
			}
		});
		
		$('#bildermalanders').serialScroll({
			items:'a', //selector to the items ( relative to the matched elements, '#sections' in this case )
			prev:'#nachoben',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
			next:'#nachunten',//selector to the 'next' button (absolute too)
			axis:'y',//the default is 'y'
			event:'click',//on which event to react (click is the default, you probably won't need to specify it)
			stop:false,//each click will stop any previous animations of the target. (false by default)
			lock:false, //ignore events if already animating (true by default)
			duration:700,//length of the animation
			start:0, //on which element (index) to begin ( 0 is the default, redundant in this case )
			force:true, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
			cycle:false,//cycle endlessly ( constant velocity, true is the default )
			step:2, //how many items to scroll each time ( 1 is the default, no need to specify )
			jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
			onBefore:function( e, elem, $pane ){
				/**
				 * 'this' is the clicked element 
				 * e is the event object
				 * elem is the element we'll be scrolling to
				 * $pane is the element being scrolled
				 */
			},
			onAfter:function( elem ){
				//'this' is the element being scrolled
			}
		});

	};

});