jQuery(document).ready(function(e){e(window).scroll(function(){position=e(window).scrollTop();});sldSpeed=750;e("#btnSitemap").toggle(function(){e(this).addClass("current");e("div.sitemap nav").slideDown(sldSpeed);e("html, body").animate({scrollTop:e(document).height()},sldSpeed);return false;},function(){e(this).removeClass("current");e("div.sitemap nav").slideUp(sldSpeed);e("html, body").animate({scrollTop:position},sldSpeed);return false;});var i=e("#impressions");if(i.length>0){var g=i.clone();e("nav#globalnavi ul.level0").after(g);i.css("left",-9999);if(e("#home").length>0){e(document).ready(function(){e(".slideshow").cycle({fx:"fade",speed:3500,random:1,timeout:7000});});}}function c(o,n){this.naviItems=new Array();this.openItem=null;}c.prototype.registerItem=function(q,p,o,n){this.naviItems.push(new b(q,p,o,n,this));};c.prototype.registerOpenItem=function(n){if(this.openItem){this.openItem.close();}this.openItem=n;};function b(u,r,q,n,p){this.navi=p;this.active=r;this.opened=r;this.liLevel0=u;this.ulLevel1=u.find("ul.level1");this.ulHeight=q;this.liHeight=n;if(this.active){this.navi.registerOpenItem(this);this.liLevel0.css({height:this.liHeight});this.ulLevel1.css({height:this.ulHeight});}var s=this;this.liLevel0.mouseenter(function(){if(s.active){return;}s.open();});this.liLevel0.mouseleave(function(){if(s.active){return;}s.close();});var o=this.liLevel0.children("a").Touchable();o.bind("tap",function(t,v){if(s.opened){window.location=e(this).attr("href");return;}s.open();});}b.prototype.open=function(){this.navi.registerOpenItem(this);this.opened=true;var n=this;this.liLevel0.stop().animate({height:45},{queue:false,duration:100,easing:"easeInOutQuint",complete:function(){setTimeout(function(){if(!n.opened){return;}n.ulLevel1.stop().animate({height:n.ulHeight},{queue:false,duration:500,easing:"easeInOutQuint"});},40);}});};b.prototype.close=function(){this.opened=false;this.active=false;var n=this;if(this.ulLevel1.length>0){this.ulLevel1.stop().animate({height:0},{queue:false,duration:500,easing:"easeInOutQuint",complete:function(){if(n.opened){return;}n.liLevel0.stop().animate({height:35},{queue:true,duration:100,easing:"easeInOutQuint"});}});}else{this.liLevel0.stop().animate({height:35},{queue:true,duration:100,easing:"easeInOutQuint"});}};var j=new c();var m=5;var f=120;var k=180;var l=e("nav#globalnavi").width();var h=e("nav#globalnavi ul.level0 > li");var a=0;var d=null;h.each(function(n,o){currentLiLevel0=e(o);var p=0;currentLiLevel0.find("ul.level1").each(function(r,s){var t=e(s);var q=0;var u=0;t.children("li").each(function(w,x){var y=e(x);var v=y.height();if(q+v>k){q=0;u+=f+m;}y.css({position:"absolute",top:q,left:u});q+=v;if(p<q){p=q;}t.css({width:u+f,overflow:"hidden"});});});j.registerItem(currentLiLevel0,(currentLiLevel0.hasClass("active")||currentLiLevel0.hasClass("open")),p,45);});});
