

(function(a){function b(b,c,d){var e,f,g=b.width,h=b.width,i,j;j=a(b.parentNode);this.element=e=j.append("<canvas class='reflection' style='position:absolute'/>").find(":last")[0];if(!e.getContext&&a.browser.msie){this.element=e=j.append("<img class='reflection' style='position:absolute'/>").find(":last")[0];e.src=b.src;e.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+d*100+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+c/h*100+")"}else{f=e.getContext("2d");try{a(e).attr({width:g,height:c});f.save();f.translate(0,h-1);f.scale(1,-1);f.drawImage(b,0,0,g,h);f.restore();f.globalCompositeOperation="destination-out";i=f.createLinearGradient(0,0,0,c);i.addColorStop(0,"rgba(255, 255, 255, "+(1-d)+")");i.addColorStop(1,"rgba(255, 255, 255, 1.0)");f.fillStyle=i;f.fillRect(0,0,g,c)}catch(k){return}}a(e).attr({alt:a(b).attr("alt"),title:a(b).attr("title")})}var c=function(c,d){this.orgWidth=c.width;this.orgHeight=c.height;this.image=c;this.reflection=null;this.alt=c.alt;this.title=c.title;this.imageOK=false;this.options=d;this.imageOK=true;if(this.options.reflHeight>0){this.reflection=new b(this.image,this.options.reflHeight,this.options.reflOpacity)}a(this.image).css("position","absolute")};var d=function(b,d,e){var f=[],g=Math.sin,h=Math.cos,i=this;this.controlTimer=0;this.stopped=false;this.container=b;this.xRadius=e.xRadius;this.yRadius=e.yRadius;this.showFrontTextTimer=0;this.autoRotateTimer=0;if(e.xRadius===0){this.xRadius=a(b).width()/2.3}if(e.yRadius===0){this.yRadius=a(b).height()/6}this.xCentre=e.xPos;this.yCentre=e.yPos;this.frontIndex=0;this.rotation=this.destRotation=Math.PI/2;this.timeDelay=1e3/e.FPS;if(e.altBox!==null){a(e.altBox).css("display","block");a(e.titleBox).css("display","block")}a(b).css({position:"relative",overflow:"hidden"});a(e.buttonLeft).css("display","inline");a(e.buttonRight).css("display","inline");a(e.buttonLeft).bind("mouseup",this,function(a){a.data.rotate(-1);return false});a(e.buttonRight).bind("mouseup",this,function(a){a.data.rotate(1);return false});if(e.mouseWheel){a(b).bind("mousewheel",this,function(a,b){a.data.rotate(b);return false})}a(b).bind("mouseenter click",this,function(b){clearInterval(b.data.autoRotateTimer);var c=a(b.target).attr("alt");if(c!==undefined&&c!==null){clearTimeout(b.data.showFrontTextTimer);a(e.altBox).html(a(b.target).attr("alt"));a(e.titleBox).html(a(b.target).attr("title"));if(e.bringToFront&&b.type=="click"){var f=a(b.target).data("itemIndex");var g=b.data.frontIndex;var h=(f-g)%d.length;if(Math.abs(h)>d.length/2){h+=h>0?-d.length:d.length}b.data.rotate(-h)}}});a(b).bind("mouseleave",this,function(a){var b=a.data;clearTimeout(b.showFrontTextTimer);b.showFrontTextTimer=setTimeout(function(){b.showFrontText()},1e3);b.autoRotate()});a(b).bind("mousedown",this,function(a){a.data.container.focus();return false});b.onselectstart=function(){return false};this.innerWrapper=a(b).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];this.showFrontText=function(){var b=this.frontIndex;if(this.frontIndex<0){b=f.length+this.frontIndex}if(f[b]===undefined){return}a(e.titleBox).html(a(f[b].image).attr("title"));a(e.altBox).html(a(f[b].image).attr("alt"))};this.go=function(){if(this.controlTimer!==0){return}var a=this;this.controlTimer=setTimeout(function(){a.updateAll()},this.timeDelay)};this.stop=function(){clearTimeout(this.controlTimer);this.controlTimer=0};this.rotate=function(a){this.frontIndex-=a;this.frontIndex%=f.length;this.destRotation+=Math.PI/f.length*2*a;this.showFrontText();this.go()};this.autoRotate=function(){if(e.autoRotate!=="no"){var a=e.autoRotate==="right"?1:-1;this.autoRotateTimer=setInterval(function(){i.rotate(a)},e.autoRotateDelay)}};this.updateAll=function(){var b=e.minScale;var c=(1-b)*.5;var d,i,j,k,l,m,n;var o=this.destRotation-this.rotation;var p=Math.abs(o);this.rotation+=o*e.speed;if(p<.001){this.rotation=this.destRotation}var q=f.length;var r=Math.PI/q*2;var s=this.rotation;var t=a.browser.msie;this.innerWrapper.style.display="none";var u;var v="px",w;var x=this;for(var y=0;y<q;y++){m=f[y];n=g(s);l=(n+1)*c+b;j=this.xCentre+(h(s)*this.xRadius-m.orgWidth*.5)*l;k=this.yCentre+n*this.yRadius*l;if(m.imageOK){var z=m.image;d=z.width=m.orgWidth*l;i=z.height=m.orgHeight*l;z.style.left=j+v;z.style.top=k+v;z.style.zIndex=""+l*100*2>>0;if(m.reflection!==null){w=e.reflHeight*l;u=m.reflection.element.style;u.left=j+v;u.top=k+i+e.reflGap*l+v;u.width=d+v;if(t){u.filter.finishy=w/i*100}else{u.height=w+v}}}s+=r}this.innerWrapper.style.display="block";if(p>=.001){this.controlTimer=setTimeout(function(){x.updateAll()},this.timeDelay)}else{this.stop()}};this.checkImagesLoaded=function(){var b;for(b=0;b<d.length;b++){if(d[b].width===undefined||d[b].complete!==undefined&&!d[b].complete){return}}for(b=0;b<d.length;b++){f.push(new c(d[b],e));a(d[b]).data("itemIndex",b)}clearInterval(this.tt);this.showFrontText();this.autoRotate();this.updateAll()};this.tt=setInterval(function(){i.checkImagesLoaded()},50)};a.fn.CloudCarousel=function(b){this.each(function(){b=a.extend({},{reflHeight:0,reflOpacity:.5,reflGap:0,minScale:.5,xPos:0,yPos:0,xRadius:0,yRadius:0,altBox:null,titleBox:null,FPS:30,autoRotate:"no",autoRotateDelay:1500,speed:.2,mouseWheel:false,bringToFront:false},b);a(this).data("cloudcarousel",new d(this,a(".cloudcarousel",a(this)),b))});return this}})(jQuery);$(window).ready(function(){$("#carousel2 a").hide();$("#carousel2").removeClass("noscript");$("#carousel2 #preloader").show()});$(window).load(function(){$("#carousel2 #preloader").hide();$("#carousel2 a").each(function(a){$(this).children("img").attr("title",$(this).find("p").text())});$("#carousel2 .description").remove();$("#carousel2").append('<div id="abdeckung"></div><a id="leftbutton" class="button">Nach links blättern</a><p id="alt-text"></p><a id="rightbutton" class="button">Nach rechts blättern</a>');$("#carousel2").CloudCarousel({xPos:365,yPos:52,yRadius:-40,xRadius:460,buttonRight:$("#rightbutton"),buttonLeft:$("#leftbutton"),FPS:30,autoRotate:"left",autoRotateDelay:5200,speed:.12,mouseWheel:true,bringToFront:true,minScale:.35,titleBox:$("#alt-text")});$("#carousel2 a").show()})
