(function($) {
$(document).ready(function() {

	if($(".slideshow1_img").length>1){
		$("#slidetabs1").tabs("#images1 > div", {
		
			// enable "cross-fading" effect
			effect: 'fade',
			fadeOutSpeed: 'slow',
			fadeInSpeed: 'slow',			
			rotate: true
		}).slideshow({
	                next: "div.control_buttons1 a.forward", 
	                prev: "div.control_buttons1 a.backward" 
	        });
	}else{
        	$('.slideshow1_img').show(); 
        }

	if($(".slideshow2_img").length>1){
		$("#slidetabs2").tabs("#images2 > div", {
			effect: 'fade',
			fadeOutSpeed: 'slow',
			fadeInSpeed: 'slow',						
			rotate: true
		}).slideshow({
	                next: "div.control_buttons2 a.forward", 
	                prev: "div.control_buttons2 a.backward" 	                
	        });
        }else{
        	$('.slideshow2_img').show(); 
        }



	$("#accordion_Ortsliste").tabs("#accordion_Ortsliste div.pane", {tabs: 'table', effect: 'slide', initialIndex: 0});
	
	$("li:first-child,tr:first-child").addClass("first");
	$("li:even,table:even").addClass("even");
	$("li:odd,table:odd").addClass("odd");
	$("li:last-child,tr:last-child").addClass("last");

	if ($(".slidetabs").length && $(".slideshow1_img").length>1) 
		$(".slidetabs").data("slideshow").play();
	//if ($(".slidetabs2").length && $(".slideshow2_img").length>1)
	//	$(".slidetabs2").data("slideshow").play();	
		
	$(".current").click(function(){
		$(".pane").each(function(){
			$(this).removeClass("aktiv");
		});	
	});
	$(".pane").click(function(){
		$(".pane").each(function(){
			$(this).removeClass("aktiv");
		});
		$(this).addClass("aktiv");
	});
});	
})(jQuery);
