var bgimguri="img/backgrounds/chocolate.jpg";function createCookie(d,e,b){if(b){var c=new Date();c.setTime(c.getTime()+(b*60*60*1000));var a="; expires="+c.toGMTString()}else{var a=""}document.cookie=d+"="+e+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}$(document).ready(function(){$(function(){$.each($("ul#navigation li a, h1#logo, div#content h2"),function(){$(this).attr("title",$(this).html())})});$(function(){$("body").append('<div id="bgimgholder" />');if(readCookie("bg_suess_speisen_fade_in")==null){$("#bgimgholder").append('<img src="'+bgimguri+'" />');$("div#header, div#content").css("z-index","10");$("#bgimgholder").css("z-index","-10");var d=$("body").width();var b=$("body").height();var c=d/b;if(c>=1.5){$("#bgimgholder img").css("width","100%").css("height","auto")}else{$("#bgimgholder img").css("width","auto").css("height","100%")}$("#bgimgholder img").css("min-width",d+"px").css("min-height",b+"px");$("#bgimgholder").show()}else{$("<img />").attr("src",bgimguri).load(function(){$("div#header, div#content").css("z-index","10");$("#bgimgholder").append($(this)).css("z-index","-10");var g=$("body").width();var e=$("body").height();var f=g/e;if(f>=1.5){$("#bgimgholder img").css("width","100%").css("height","auto")}else{$("#bgimgholder img").css("width","auto").css("height","100%")}$("#bgimgholder img").css("min-width",g+"px").css("min-height",e+"px");$("#bgimgholder").fadeIn(3000,function(){})})}});$(function(){if($("#content .text").height()>300||$("#content .text80_l").height()>300){$("#content .text, #content .text80_l").css("overflow-y","scroll").css("overflow-x","hidden").css("height","260px").css("padding-right","15px")}else{$("#content .text, #content .text80_l").css("overflow-y","").css("overflow-x","").css("height","").css("padding-right","")}});$(function(){var b=parseInt($("#content").height(),10)+parseInt($("#header").height(),10)+50;$("body").css("min-height",b+"px");a()});function a(){$("div#content").css("bottom","0");var d=$("body").width();var b=$("body").height();var c=d/b;if($(window).height()!=$(document).height()){var e=parseInt($("#content").height(),10)+parseInt($("#header").height(),10)+50;$("body").css("min-height",e+"px");$("#bgimgholder,#bgimgholder>img").css("height",$(document).height()+"px");$("div#content").css("bottom","-"+($(document).height()-$(window).height())+"px");if(c>=1.5){$("#bgimgholder>img").css("width","100%").css("height","auto")}else{$("#bgimgholder>img").css("width","auto").css("height","100%")}}else{$("div#content").css("bottom","-"+($(document).height()-$(window).height())+"px");$("#bgimgholder,#bgimgholder>img").css("height","")}if($(window).width()<1200){$("#bgimgholder,#bgimgholder>img").css("width","1200px");$("body").css("min-width","1200px");$("#content").css("margin","0").css("left","0")}else{if(c>=1.5){$("#bgimgholder,#bgimgholder>img").css("width","100%")}else{$("#bgimgholder,#bgimgholder>img").css("width","auto")}$("body").css("min-width","");$("#content").css("margin","").css("left","")}}$(function(){$("form#form_kontakt").submit(function(c){var b=false;$("form#form_kontakt *").removeClass("form_error");$("form#form_kontakt p#errordescription").css("display","");if($("form#form_kontakt #form_name").val().length<5){$("form#form_kontakt #form_name").parent().addClass("form_error");b=true}if($("form#form_kontakt #form_email").val().length<5){$("form#form_kontakt #form_email").parent().addClass("form_error");b=true}if($("form#form_kontakt #form_betreff").val().length<5){$("form#form_kontakt #form_betreff").parent().addClass("form_error");b=true}if($("form#form_kontakt #form_text").val().length<5){$("form#form_kontakt #form_text").parent().addClass("form_error");b=true}if(b===true){$("form#form_kontakt p#errordescription").css("display","block");c.preventDefault();return false}else{return}})});$(function(){if($("p.menulink").length!=0){var b;b=$.ajax({type:"HEAD",url:$("p.menulink>a").attr("href"),success:function(){var d=Math.round((parseInt(b.getResponseHeader("Content-Length"),10)/1024)*100)/100;var c=$("p.menulink>a").attr("title")+" ("+d+" kB)";$("p.menulink>a").attr("title",c)}})}});$(window).resize(function(){a()})});
