window.onload = function() {
	
	header_H = $("#logo_header").height();
	menu_H = $("#menu_container").height();
	poster_H = $("#poster_fix0").height();
	t_space = 144;
	b_space = 40;
	poster_space = 20;
	
	top1 = header_H+menu_H+t_space+b_space;
	top2 = header_H+menu_H+t_space+b_space+poster_space+poster_H;
	top3 = header_H+menu_H+t_space+b_space+(2*poster_space)+(2*poster_H);
	
	$("#poster_fix0").css({'top' : top1});
	$("#poster_fix1").css({'top' : top2});
	$("#poster_fix2").css({'top' : top3});
	//alert(menu_H); 	
	
	//$("#slideshow").css({'background-color' : '#000000'});
	$("#menu_container .menu li").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});
	$("#submenu li").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});		
	//$("#slideshow").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});	

	//$("#hechtplatz-logo").dropShadow({left: 4, top: 2, opacity: 0.5, blur: 5});	
	//$("#poster_fix0").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});
	//$("#poster_fix1").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});	
	//$("#poster_fix2").dropShadow({left: 4, top: 7, opacity: 0.5, blur: 5});		
	
				
	$("#theater_bgimg").height($(document).height());
	$("#theater_bgimg").width($(window).width());

					
	$(window).resize();

	$(".theater_play img").hover(
		function () {
			$(this).fadeTo('fast', 0.7);
			$('body').css('cursor', 'pointer'); 
		 }, 
		 function () {
			$(this).fadeTo('fast', 1);
			$('body').css('cursor', 'default'); 
		 }
	);
	
	$(".poster_fix").hover(
		function () {
			$(this).fadeTo('fast', 0.7);
		 }, 
		 function () {
			$(this).fadeTo('fast', 1);
		 }
	);
	
	$(".poster_slide").hover(
		function () {
			$(this).fadeTo('fast', 0.7);
		 }, 
		 function () {
			$(this).fadeTo('fast', 1);
		 }
	);
				
	$(".kalender_play").hover(
		function () {
			$(this).css({'background-color' : '#e8e8e8', 'cursor': 'pointer'});
		}, 
		 function () {
			$(this).css({'background-color' : '#ffffff', 'cursor': 'normal'});
	});	
	
	$(".menu li a").hover(
		function () {
			$(this).css({'background-color' : '#6fc809', 'color' : '#fafd62'});
		}, 
		function () {
			$(this).css({'background-color' : '#ffed00', 'color' : '#ff0000'});
		}
	);
				
	$(".theater_play").click(
		function () {
			window.open($(".stueck_link", this).attr("href"), "_self")
		});
	
	$(".dieses_stueck").click(
			function () {
				window.open($(".fix_link",this).attr("href"), "_self");
	});
	
	$(".poster_slide").corner("8px");
	$(".poster_fix").corner("4px");
	$(".s_poster").corner("8px tr bl");
	
	aniloki();
	
	// RODS NEUES PROGRAMM LAYOUT
	$(".play2").click(
			function () {
				window.open($(".stueck_link", this).attr("href"), "_self")
			});
	
	$(".play2 img").hover(
			function () {
				$(this).fadeTo('fast', 0.7);
				$('body').css('cursor', 'pointer'); 
			 }, 
			 function () {
				$(this).fadeTo('fast', 1);
				$('body').css('cursor', 'default'); 
			 }
		);

};

function aniloki () {
	  $('#content_border_bottom img').css("margin-left",-129);
	  $('#content_border_bottom img').animate({
	    marginLeft: '+=629'
	  }, 8000, function() {
	    aniloki();
	  });
}

function doSomething() {
	$("#theater_bgimg").height($(document).height());
	$("#theater_bgimg").width($(window).width());
};

var resizeTimer = null;
	$(window).bind('resize', function() {
		if (resizeTimer) clearTimeout(resizeTimer);
			resizeTimer = setTimeout(doSomething, 100);
		}
	);	
