$(document).ready(function(){
	$("div.stage div.scrollable").scrollable({
		activeClass: 'active',
		circular: true,
		clonedClass: 'cloned',
		disabledClass: 'disabled',
		easing: 'swing',
		initialIndex: 0,
		item: null,
		items: '.items',
		keyboard: true,
		mousewheel: false,
		next: '.next',   
		prev: '.prev', 
		speed: 400,
		vertical: false,
		wheelSpeed: 0
	}).autoscroll({
		autoplay: true,
		interval: 5000,
		autopause: true
	});
	$('div.accordion > ul').accordion({
		header: 'h3',
		autoHeight: false,
		fillSpace: false,
		event: "click",
		animate: "slide",
		collapsible: true
	});
	$('div.accordion > ul').bind('accordionchange', function(event, ui) {
		ui.newHeader.blur();
		ui.oldHeader.blur();
	});
	$('div.accordion div.images').tabs({ 
		fx: { 
			opacity: 'toggle', 
			duration: 'fast'
		}
	});
	$('div.filmBox div.films').tabs({ 
		fx: { 
			opacity: 'toggle', 
			duration: 'fast'
		}
	});
	
	$('div.historyblock div.history').tabs({ 
		fx: { 
			opacity: 'toggle', 
			duration: 'fast'
		},
		selected: 5
	});
	
	$("a[href^=#hidden]").each(
		function(i) {
			this.setAttribute("href", this.getAttribute("href").replace("#hidden:","#TB_inline?z&width=600&height=300&inlineId="));
			this.setAttribute("target","popup");
		}
	);
	
	tb_init('a[target="popup"]');
	imgLoader = new Image();
	imgLoader.src = tb_pathToImage;
	
  	/* lowres/highres ausblenden */
	if ($("html").innerWidth() > 995 && $("html").innerHeight() > 780) {
		$(".lowres").remove();
		highres = true;
	}
	else {
		$(".highres").remove();
		$(".lowres").css("visibility","visible");
		highres = false;
	}
	

	
})
var tb_pathToImage = "/media/loadingAnimation.gif";
var tb_closeText = messages.getLocalString("close");
