$(document).ready(function(){
	/* liest die breite des footer ul aus weist diese fix zu, damit der footer eingemittet werden kann.*/
	footerwidth = $("div#footer ul").width();
	$("#footer ul").width(footerwidth);
	submitbutton = $("button.submit span").width();
	$("button.submit").width(submitbutton+29);
	$('#newstickerlist').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'sequence'
	});
	$('#saisonProjectList').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'sequence'
	});

});
$(window).load(function() {

    // dieser Code wird ausgeführt, wenn das komplette Dokument im Browser geladen ist.
	// liest die benötigte dokomuent höhe aus
	docHeight = $(document).height();
	/*alert(docHeight);*/
	$("#bgSeasonContent").height(docHeight);
	$("#bgSeasonBig").height(docHeight);
	$("#folge div#contentWrapper div#contentLeft #payload").height(docHeight-205);
	function doResize() {
		docHeight='100%';
		$("#folge div#contentWrapper div#contentLeft #payload").height(docHeight);
		$("#bgSeasonContent").height(docHeight);
		docHeight = $(document).height();
		window.setTimeout(function(){$("#bgSeasonContent").height(docHeight);}, 0);
		window.setTimeout(function(){$("#bgSeasonBig").height(docHeight);}, 0);
		window.setTimeout(function(){$("#folge div#contentWrapper div#contentLeft #payload").height(docHeight-205);}, 0);
	};
	 var resizeTimer = null;
	 $(window).bind('resize', function() {
	 	if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(doResize, 100);
	});

});

$(document).ready(function(){
	var api = $("#overlay_home").overlay({
		api: true,
		expose: "#fff",
		start:  {
        	top: 0,
			left: 0,
			width:0,
			absolute: false
		}
	});
	if(api) {
		api.load();
	}
});
