(function(w){var E=w(window),u,f,F=-1,n,x,D,v,y,L,r,m=!window.XMLHttpRequest,s=[],l=document.documentElement,k={},t=new Image(),J=new Image(),H,a,g,p,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('<div id="lbOverlay" />')[0],a=w('<div id="lbCenter" />')[0],G=w('<div id="lbBottomContainer" />')[0]]).css("display","none"));g=w('<div id="lbImage" />').appendTo(a).append(p=w('<div style="position: relative;" />').append([I=w('<a id="lbPrevLink" href="#" />').click(B)[0],d=w('<a id="lbNextLink" href="#" />').click(e)[0]])[0])[0];c=w('<div id="lbBottom" />').appendTo(G).append([w('<a id="lbCloseLink" href="#">X</a>').add(H).click(C)[0],A=w('<div id="lbCaption" />')[0],K=w('<div id="lbNumber" />')[0],w('<div style="clear: both;" />')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"{x}/{y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+(E.height()/2);L=u.initialWidth;r=u.initialHeight;w(a).css({top:Math.max(0,y-(r/2)),width:L,height:r,marginLeft:-L/2}).show();v=m||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();j(1);f=O;u.loop=u.loop&&(f.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q<R;++Q){if(T[Q]==S){U=Q}T[Q]=P(T[Q],Q)}return w.slimbox(T,U,M)})};function z(){var N=E.scrollLeft(),M=E.width();w([a,G]).css("left",N+(M/2));if(v){w(H).css({left:N,top:E.scrollTop(),width:M,height:E.height()})}}function j(M){if(M){w("object").add(m?"select":"embed").each(function(O,P){s[O]=[P,P.style.visibility];P.style.visibility="hidden"})}else{w.each(s,function(O,P){P[0].style.visibility=P[1]});s=[]}var N=M?"bind":"unbind";E[N]("scroll resize",z);w(document)[N]("keydown",o)}function o(O){var N=O.keyCode,M=w.inArray;return(M(N,u.closeKeys)>=0)?C():(M(N,u.nextKeys)>=0)?e():(M(N,u.previousKeys)>=0)?B():false}function B(){return b(x)}function e(){return b(D)}function b(M){if(M>=0){F=M;n=f[F][0];x=(F||(u.loop?f.length:0))-1;D=((F+1)%f.length)||(u.loop?0:-1);q();a.className="lbLoading";k=new Image();k.onload=i;k.src=n}return false}function i(){a.className="";w(g).css({backgroundImage:"url("+n+")",visibility:"hidden",display:""});w(p).width(k.width);w([p,I,d]).height(k.height);w(A).html(f[F][1]||"");w(K).html((((f.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,f.length));if(x>=0){t.src=f[x][0]}if(D>=0){J.src=f[D][0]}L=g.offsetWidth;r=g.offsetHeight;var M=Math.max(0,y-(r/2));if(a.offsetHeight!=r){w(a).animate({height:r,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+r,marginLeft:-L/2,visibility:"hidden",display:""});w(g).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,h)})}function h(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function q(){k.onload=null;k.src=t.src=J.src=n;w([a,g,c]).stop(true);w([I,d,g,G]).hide()}function C(){if(F>=0){q();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,j)}return false}})(jQuery);if(!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)){jQuery(function($){$("a[rel^='lightbox']").slimbox({},null,function(el){return(this==el)||((this.rel.length>8)&&(this.rel==el.rel));});});}try{reca=reca||{};}catch(e){reca={};}
reca.nothing=function(){};reca.commands={run:function(context){this.context=context||$(document);this.runCommand('layoutHelpers','ul');this.runCommand('fixHashLinks','a[href=#]');this.runCommand('sideGallery','.jsSideGallery');this.runCommand('bigGallery','.jsBigGallery');this.runCommand('titleLabels','.jsTitleLabel');this.runCommand('offerBox','.jsOfferBox');this.runCommand('mainNav','.mainNav > li');this.runCommand('lightboxOpeners','.jsLightboxOpener');this.runCommand('eye','.jsEye');},runCommand:function(command,selector){var set=$(selector,this.context);if(!set.length)return;if(typeof reca.commands[command]!="function"){console.error("unknown command",command,"for",set);return;}
set.each(function(){params=set.getNSParams('js');reca.commands[command]($(this),params);});},layoutHelpers:function(node,params){$('li:first',node).addClass('first');$('li:last',node).addClass('last');reca.layout.apply();},lightboxOpeners:function(context){context.bind('click',function(event){event.preventDefault();var set=$(this).attr('href').match(/^#(.*)$/)[1];$('a[rel='+set+']').eq(0).click();});},fixHashLinks:function(node,params){node.attr('href','javascript:reca.nothing();');},sideGallery:function(node,params){var gallery=new zipf.ImageGallery();var images=node.find('div img');gallery.init(node,{images:images});reca.gallery=gallery;gallery.startAutoPlay(10000);var setImageSizes=function(){reca.setGalleryImageSizes($('#galleryContainer'),images);};setImageSizes();setInterval(setImageSizes,500);},bigGallery:function(node){var gallery=new zipf.ImageGallery();var images=node.find('ul.galerieBilder img');gallery.init(node,{images:images,direct:$('.galerieNav a',node),next:$('.pfeilRechts',node),prev:$('.pfeilLinks',node),fadeTime:1000});var setImageSizes;if(params.scale){setImageSizes=function(){reca.setGalleryImageSizesScaled($('.rightContainer'),images);};}else{setImageSizes=function(){reca.setGalleryImageSizes($('.rightContainer'),images);};}
setImageSizes();setInterval(setImageSizes,500);},mainNav:function(node){function setSubNavWidth(sn){var w=0;$('li',sn).each(function(){w=Math.max(w,$(this).width());});sn.width(w);}
reca.csn=null;reca.csi=null;reca.SNSPEED=200;node.hover(function(){clearTimeout(reca.csi);if(reca.csn)reca.csn.hide();reca.csn=$('ul.subNav',$(this));reca.csn.stop().show();setSubNavWidth(reca.csn);},function(){clearTimeout(reca.csi);reca.csi=setTimeout(function(){reca.csn.hide();reca.csn=null;},400);});},titleLabels:function(node){var focusField=function(){if(node.val()==node.attr('title'))node.val('');};var blurField=function(){if(!node.val())node.val(node.attr('title'));};blurField.call(node[0]);node.bind('focus',focusField);node.bind('blur',blurField);var form=node.closest('form');form.bind('submit',function(){focusField.call(node[0]);});},offerBox:function(node){var box=new zipf.ImageGallery();var config={images:node.find('.teaser a'),direct:node.find('.thumbs a')};box.init(node,config);box.startAutoPlay(8000);},eye:function(node,params){node.parent().css('background','none');swfobject.embedSWF(params.swf,"eye",43,23,'9.0.0',null,null,{wmode:'transparent'},null);}};reca.layout={apply:function(){if($('body').hasClass('galerie'))this.applyGallery();else if($('body').hasClass('standard'))this.applyDefault();else this.applyCatalog();},applyGallery:function(){var setMaxHeights=function(){reca.layout._setMaxHeights($('.leftContainer, .rightContainer'),$(window).height());};setInterval(setMaxHeights,500);setMaxHeights();var setMaxWidths=function(){reca.layout._setMaxWidth($('.rightContainer'),$('.leftContainer'));};setInterval(setMaxWidths,500);setMaxWidths();},applyCatalog:function(){var setMaxHeights=function(){reca.layout._setMaxHeights($('.leftContainer'),$(window).height());};setInterval(setMaxHeights,500);setMaxHeights();},applyDefault:function(){var setMaxHeights=function(){reca.layout._setMaxHeights($('.leftContainer'),$(document).height());};setInterval(setMaxHeights,500);setMaxHeights();var setGalleryWidth=function(){reca.layout._setMaxWidth($('#galleryContainer'),$('#mainContainer'));};setGalleryWidth();setInterval(setGalleryWidth,500);var setStreifenWidth=function(){var streifen=$('#streifen');var slogan=$('.slogan',streifen);streifen.width($(window).width());slogan.css("margin-left",streifen.width()
-Math.round($('#galleryContainer').width()/2)
-84);};setStreifenWidth();setInterval(setStreifenWidth,500);var setTableRowWidths=function(){$('.rightContainer .richtext table').each(function(){var table=$(this);var headers=$('tr:first td',table);headers.css('width',Math.round(100/headers.length)+"%");});};setTableRowWidths();},_setMaxHeights:function(set,dh){set.each(function(){var node=$(this);node.height(dh
-node.offset().top
-parseInt(node.css('margin-top'),0)
-parseInt(node.css('margin-bottom'),0)
-parseInt(node.css('padding-top'),0)
-parseInt(node.css('padding-bottom'),0));});},_setMaxWidth:function(gal,main){var dw=$(window).width();gal.each(function(){var node=$(this);node.width(dw
-main.outerWidth()
-(gal.outerWidth()-gal.width()));});}};reca.initJQueryPlugins=function(){jQuery.fn.getNSParams=function(ns){var params={};this.each(function(){for(var i=0;i<this.attributes.length;i++){var attr=this.attributes[i];var name="";if(!ns){name=attr.name;}else if(attr.name.indexOf(ns+":")==0){name=attr.name.split(ns+":")[1];params[name]=attr.value;}}});return params;};};reca.setGalleryImageSizesScaled=function(gal,images){images.each(function(){var img=$(this);img.css('width','100%');});}
reca.setGalleryImageSizes=function(gal,images){images.each(function(){var f=null;var img=$(this);var gw=gal.width();var gh=gal.height();var w=img.width();var h=img.height();if(w&&h){if(f===null)f=w/h;var gf=gw/gh;if(f>gf){img.width(gal.height()*f);img.height(gal.height());if(!$("body").hasClass('ie-60')){img.css({top:0,left:gal.width()-img.width()});};}else{img.height(gal.width()/f);img.width(gal.width());if(!$("body").hasClass('ie-60')){img.css({top:gal.height()-img.height(),left:0});};}}});};$(function(){reca.initJQueryPlugins();reca.commands.run();});try{zipf=zipf||{};}catch(e){zipf={};}
zipf.ImageGallery=function(){};zipf.ImageGallery.FADETIME=2000;zipf.ImageGallery.AUTOPLAY_INTERVAL=5000;zipf.ImageGallery.prototype.init=function(context,config){config=config||{};this.context=context;this.index=0;this.next=config.next||$('.jsNext',context);this.prev=config.prev||$('.jsPrev',context);this.direct=config.direct||$('.jsDirect',context);this.images=config.images||$('IMG',this.context);this.fadeTime=config.fadeTime||zipf.ImageGallery.FADETIME;if(this.images.length>1){var self=this;this.next.bind('click',function(event){event.preventDefault();self.stopAutoPlay();self.crossFade(1);}).css('cursor','pointer');this.prev.bind('click',function(event){event.preventDefault();self.stopAutoPlay();self.crossFade(-1);}).css('cursor','pointer');this.direct.bind('click',function(event){event.preventDefault();var node=$(this);self.stopAutoPlay();self.crossFadeTo(node.attr('js:index'));});this.showImageInfo(this.images.eq(0).attr('title'));}else{this.next.hide();this.prev.hide();}}
zipf.ImageGallery.prototype.startAutoPlay=function(interval){if(this.images.length<=1)return;var interval=interval||zipf.ImageGallery.AUTOPLAY_INTERVAL;clearInterval(this.autoplayInterval);var self=this;this.autoplayInterval=setInterval(function(){self.crossFade(+1);},interval);}
zipf.ImageGallery.prototype.stopAutoPlay=function(){clearInterval(this.autoplayInterval);}
zipf.ImageGallery.prototype.showImageInfo=function(title){}
zipf.ImageGallery.prototype.setIndex=function(change){this.index+=change;if(this.index>=this.images.length)this.index=0;if(this.index<0)this.index=this.images.length-1;}
zipf.ImageGallery.prototype.crossFadeTo=function(pos){this.crossFade(pos-this.index);}
zipf.ImageGallery.prototype.crossFade=function(direction){if(direction==0)return;if(this.isAnimating)return;var fout=this.images.eq(this.index);this.setIndex(direction);var fin=this.images.eq(this.index);this.isAnimating=true;var self=this;fout.fadeOut(this.fadeTime);fin.fadeIn(this.fadeTime,function(){self.isAnimating=false;});this.showImageInfo(fin.attr('title'));this.direct.removeClass('active');this.direct.eq(this.index).addClass('active');}
zipf.ImageGallery.prototype.swap=function(direction){var fout=this.images.eq(this.index);this.setIndex(direction);var fin=this.images.eq(this.index);fin.show();fout.hide();}
