(function(J){function V(b,d){d=d==="x"?R.width():R.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function z(b){b=J.isFunction(b)?b.call(N):b;return I.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function aa(){for(var b in I){if(J.isFunction(I[b])&&b.substring(0,2)!=="on"){I[b]=I[b].call(N)}}I.rel=I.rel||N.rel;I.href=I.href||N.href;I.title=I.title||N.title}function ab(b){N=b;I=J(N).data(U);aa();if(I.rel&&I.rel!=="nofollow"){M=J(".cboxElement").filter(function(){return(J(this).data(U).rel||this.rel)===I.rel});O=M.index(N);if(O<0){M=M.add(N);O=M.length-1}}else{M=J(N);O=0}if(!n){p=n=S;B=N;B.blur();J(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();K.close()}}).bind("keydown.cbox_arrows",function(d){if(M.length>1){if(d.keyCode===37){d.preventDefault();q.click()}else{if(d.keyCode===39){d.preventDefault();r.click()}}}});I.overlayClose&&W.css({cursor:"pointer"}).one("click",K.close);J.event.trigger(m);I.onOpen&&I.onOpen.call(N);W.css({opacity:I.opacity}).show();I.w=V(I.initialWidth,"x");I.h=V(I.initialHeight,"y");K.position(0);C&&R.bind("resize.cboxie6 scroll.cboxie6",function(){W.css({width:R.width(),height:R.height(),top:R.scrollTop(),left:R.scrollLeft()})}).trigger("scroll.cboxie6")}D.add(q).add(r).add(a).add(E).hide();F.html(I.close).show();K.slideshow();K.load()}var U="colorbox",t="hover",S=true,K,i=!J.support.opacity,C=i&&!window.XMLHttpRequest,m="cbox_open",u="cbox_load",s="cbox_complete",y="resize.cbox_resize",W,P,c,T,H,X,Y,Z,M,R,Q,v,w,x,E,D,a,r,q,F,j,k,e,g,N,B,O,I,n,p,l={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:S,scrolling:S,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:S,current:"Bild {current} von {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:S,slideshow:false,slideshowAuto:S,slideshowSpeed:2500,slideshowStart:"Bilderwechsel starten",slideshowStop:"Bilderwechsel stoppen",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};K=J.fn.colorbox=function(b,d){var f=this;if(!f.length){if(f.selector===""){f=J("<a/>");b.open=S}else{return this}}f.each(function(){var h=J.extend({},J(this).data(U)?J(this).data(U):l,b);J(this).data(U,h).addClass("cboxElement");if(d){J(this).data(U).onComplete=d}});b&&b.open&&ab(f);return this};K.init=function(){function b(d){return J('<div id="cbox'+d+'"/>')}R=J(window);P=J('<div id="colorbox"/>');W=b("Overlay").hide();c=b("Wrapper");T=b("Content").append(Q=b("LoadedContent").css({width:0,height:0}),w=b("LoadingOverlay"),x=b("LoadingGraphic"),E=b("Title"),D=b("Current"),a=b("Slideshow"),r=b("Next"),q=b("Previous"),F=b("Close"));c.append(J("<div/>").append(b("TopLeft"),H=b("TopCenter"),b("TopRight")),J("<div/>").append(X=b("MiddleLeft"),T,Y=b("MiddleRight")),J("<div/>").append(b("BottomLeft"),Z=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});v=J("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");J("body").prepend(W,P.append(c,v));if(i){P.addClass("cboxIE");C&&W.css("position","absolute")}T.children().bind("mouseover mouseout",function(){J(this).toggleClass(t)}).addClass(t);j=H.height()+Z.height()+T.outerHeight(S)-T.height();k=X.width()+Y.width()+T.outerWidth(S)-T.width();e=Q.outerHeight(S);g=Q.outerWidth(S);P.css({"padding-bottom":j,"padding-right":k}).hide();r.click(K.next);q.click(K.prev);F.click(K.close);T.children().removeClass(t);J(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined"){return S}else{ab(this);return false}})};K.position=function(b,d){function o(A){H[0].style.width=Z[0].style.width=T[0].style.width=A.style.width;x[0].style.height=w[0].style.height=T[0].style.height=X[0].style.height=Y[0].style.height=A.style.height}var h=R.height();h=Math.max(h-I.h-e-j,0)/2+R.scrollTop();var f=Math.max(document.documentElement.clientWidth-I.w-g-k,0)/2+R.scrollLeft();b=P.width()===I.w+g&&P.height()===I.h+e?0:b;c[0].style.width=c[0].style.height="9999px";P.dequeue().animate({width:I.w+g,height:I.h+e,top:h,left:f},{duration:b,complete:function(){o(this);p=false;c[0].style.width=I.w+g+k+"px";c[0].style.height=I.h+e+j+"px";d&&d()},step:function(){o(this)}})};K.resize=function(A){function d(){I.w=I.w||Q.width();I.w=I.mw&&I.mw<I.w?I.mw:I.w;return I.w}function o(){I.h=I.h||Q.height();I.h=I.mh&&I.mh<I.h?I.mh:I.h;return I.h}function h(L){K.position(L,function(){if(n){if(i){G&&Q.fadeIn(100);P[0].style.removeAttribute("filter")}if(I.iframe){Q.append("<iframe id='cboxIframe'"+(I.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+I.href+"' "+(i?"allowtransparency='true'":"")+" />")}Q.show();E.show().html(I.title);if(M.length>1){D.html(I.current.replace(/\{current\}/,O+1).replace(/\{total\}/,M.length)).show();r.html(I.next).show();q.html(I.previous).show();I.slideshow&&a.show()}w.hide();x.hide();J.event.trigger(s);I.onComplete&&I.onComplete.call(N);I.transition==="fade"&&P.fadeTo(b,1,function(){i&&P[0].style.removeAttribute("filter")});R.bind(y,function(){K.position(0)})}})}if(n){var f,G,b=I.transition==="none"?0:I.speed;R.unbind(y);if(A){Q.remove();Q=J('<div id="cboxLoadedContent"/>').html(A);Q.hide().appendTo(v).css({width:d(),overflow:I.scrolling?"auto":"hidden"}).css({height:o()}).prependTo(T);J("#cboxPhoto").css({cssFloat:"none"});C&&J("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});I.transition==="fade"&&P.fadeTo(b,0,function(){h(0)})||h(b);if(I.preloading&&M.length>1){A=O>0?M[O-1]:M[M.length-1];f=O<M.length-1?M[O+1]:M[0];f=J(f).data(U).href||f.href;A=J(A).data(U).href||A.href;z(f)&&J("<img />").attr("src",f);z(A)&&J("<img />").attr("src",A)}}else{setTimeout(function(){var L=Q.wrapInner("<div style='overflow:auto'></div>").children();I.h=L.height();Q.css({height:I.h});L.replaceWith(L.children());K.position(b)},1)}}};K.load=function(){var b,d,h,f=K.resize;p=S;N=M[O];I=J(N).data(U);aa();J.event.trigger(u);I.onLoad&&I.onLoad.call(N);I.h=I.height?V(I.height,"y")-e-j:I.innerHeight?V(I.innerHeight,"y"):false;I.w=I.width?V(I.width,"x")-g-k:I.innerWidth?V(I.innerWidth,"x"):false;I.mw=I.w;I.mh=I.h;if(I.maxWidth){I.mw=V(I.maxWidth,"x")-g-k;I.mw=I.w&&I.w<I.mw?I.w:I.mw}if(I.maxHeight){I.mh=V(I.maxHeight,"y")-e-j;I.mh=I.h&&I.h<I.mh?I.h:I.mh}b=I.href;w.show();x.show();if(I.inline){J('<div id="cboxInlineTemp" />').hide().insertBefore(J(b)[0]).bind(u+" cbox_cleanup",function(){J(this).replaceWith(Q.children())});f(J(b))}else{if(I.iframe){f(" ")}else{if(I.html){f(I.html)}else{if(z(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";J(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(I.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(I.mw&&d.width>I.mw){o=(d.width-I.mw)/d.width;h()}if(I.mh&&d.height>I.mh){o=(d.height-I.mh)/d.height;h()}}if(I.h){d.style.marginTop=Math.max(I.h-d.height,0)/2+"px"}f(d);M.length>1&&J(d).css({cursor:"pointer"}).click(K.next);if(i){d.style.msInterpolationMode="bicubic"}};d.src=b}else{J("<div />").appendTo(v).load(b,function(o,A){A==="success"?f(this):f(J("<p>Request unsuccessful.</p>"))})}}}}};K.next=function(){if(!p){O=O<M.length-1?O+1:0;K.load()}};K.prev=function(){if(!p){O=O>0?O-1:M.length-1;K.load()}};K.slideshow=function(){function b(){a.text(I.slideshowStop).bind(s,function(){h=setTimeout(K.next,I.slideshowSpeed)}).bind(u,function(){clearTimeout(h)}).one("click",function(){d();J(this).removeClass(t)});P.removeClass(f+"off").addClass(f+"on")}var d,h,f="cboxSlideshow_";a.bind("cbox_closed",function(){a.unbind();clearTimeout(h);P.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);a.text(I.slideshowStart).unbind(s+" "+u).one("click",function(){b();
h=setTimeout(K.next,I.slideshowSpeed);J(this).removeClass(t)});P.removeClass(f+"on").addClass(f+"off")};if(I.slideshow&&M.length>1){I.slideshowAuto?b():d()}};K.close=function(){J.event.trigger("cbox_cleanup");I.onCleanup&&I.onCleanup.call(N);n=false;J(document).unbind("keydown.cbox_close keydown.cbox_arrows");R.unbind(y+" resize.cboxie6 scroll.cboxie6");W.css({cursor:"auto"}).fadeOut("fast");P.stop(S,false).fadeOut("fast",function(){J("#colorbox iframe").attr("src","about:blank");Q.remove();P.css({opacity:1});try{B.focus()}catch(b){}J.event.trigger("cbox_closed");I.onClosed&&I.onClosed.call(N)})};K.element=function(){return J(N)};K.settings=l;J(K.init)})(jQuery);
