var teaserWidth=535;var tempHint=null;var carouselZero=0;var moveOver=true;function prepareTeasers(b,a){var c=(teaserWidth*a.length);(2).times(function(){a.each(function(d){d.clone().inject(b)})});b.setStyles({width:c*3,left:-c});carouselZero=(-c)}function rotateImgs(){var a=$("main").getElement(".main .vis .controls");var b=new Fx.Tween(a,{property:"opacity",duration:200}).set(0);var c=$("main").getElement(".main .vis .imgs");prepareTeasers(c,c.getElements("img"));$("main").getElement(".main .vis").addEvent("mouseenter",function(){b.start(0,1)});$("main").getElement(".main .vis").addEvent("mouseleave",function(){b.start(1,0)});a.getElement(".next").addEvent("click",function(d){d.stop();carouselTeasers("next")});a.getElement(".previos").addEvent("click",function(d){d.stop();carouselTeasers("previos")})}function carouselTeasers(f){var e=$("main").getElement(".main .vis .imgs");var d=e.getStyle("left").toInt();var c=teaserWidth;var b=new Fx.Transition(Fx.Transitions.Expo);var g=new Fx.Tween(e,{property:"opacity",duration:200});var a=new Fx.Tween(e,{property:"left",duration:500,transition:b.easeInOut,onStart:function(){moveOver=false;g.start.delay(100,null,[1,0.5])},onComplete:function(){moveOver=true;g.start.delay(100,null,[0.5,1])}});if(f=="previos"){if((d+c)!=0){if(moveOver){a.start([d,(d+c)])}}else{if(moveOver){a.start(carouselZero-c,carouselZero)}}}if(f=="next"){if((d-c)!=(carouselZero*2)){if(moveOver){a.start(d,(d-c))}}else{if(moveOver){a.start(carouselZero+c,carouselZero)}}}}window.addEvent("domready",function(){rotateImgs()});
