var carouselItems=new Array();var activeItemTargetHeight=70;var inActiveItemTargetHeight=45;var availableSpace=250;var framesPerSecond=200;var pixelsPerSecond=1;var opacityPerSecond=0.03;var backgroundColour="#7fc31c";var inactiveBackgroundColor="transparent";var currentActiveCarouselItem=1;var autoChanger;var autoChangerInterval=3000;function initializeCheifCarousel(){var a=1;jQuery(".carousel-item-container").each(function(){var b=jQuery(this);b.attr("index",a);carouselItems.push(b);b.targetHeight=inActiveItemTargetHeight;b.mouseleave(function(){activateAutoChanger()});b.mouseenter(function(){setCarouselItemActive(b.attr("index"));window.clearInterval(autoChanger)});a++});setCarouselItemActive(1);currentActiveCarouselItem++;update();setInterval(update,1000/framesPerSecond);activateAutoChanger()}function activateAutoChanger(){autoChanger=setInterval(function(){setCarouselItemActive(currentActiveCarouselItem);currentActiveCarouselItem++;if(currentActiveCarouselItem==carouselItems.length+1){currentActiveCarouselItem=1}},autoChangerInterval)}function setCarouselItemActive(a){currentActiveCarouselItem=a;deactivateAllCarouselItems();carouselItems[a-1].targetHeight=activeItemTargetHeight;carouselItems[a-1].targetOpacity=1;carouselItems[a-1].find(".block").css({backgroundColor:backgroundColour})}function deactivateAllCarouselItems(){for(var a=0;a<carouselItems.length;a++){carouselItems[a].targetHeight=inActiveItemTargetHeight;carouselItems[a].targetOpacity=0;carouselItems[a].find(".block").css({backgroundColor:inactiveBackgroundColor})}}function update(){var o=0;for(var f=0;f<carouselItems.length;f++){var b=carouselItems[f].height();var g=carouselItems[f].targetHeight;o+=b;if(b!=g){var h;var m;if(g<b){m=b-pixelsPerSecond;if(m>g){h=m}else{h=g}}else{m=b+pixelsPerSecond;if(m<g){h=m}else{h=g}}carouselItems[f].css("height",Math.round(h)+"px");carouselItems[f].find(".block").css("height",Math.round(h)+"px")}var c=parseFloat(jQuery("#carousel-image"+(f+1)).css("opacity"));var l=carouselItems[f].targetOpacity;if(c!=l){var j;var n;if(l<c){n=c-opacityPerSecond;if(n>l){j=n}else{j=l}}else{n=c+opacityPerSecond;if(n<l){j=n}else{j=l}}jQuery("#carousel-image"+(f+1)).css("opacity",j);if(j>=0.5){carouselItems[f].find(".block").css("opacity",j)}if(c>0){if(j<c){j=0}}carouselItems[f].find("p").css("opacity",j)}}var e=availableSpace-o;var k=e/(this.carouselItems.length+1);var a=jQuery(".carousel-container").position();var d=k;var p=0;for(var f=0;f<carouselItems.length;f++){carouselItems[f].css("top",Math.round(d)+"px");carouselItems[f].css("left",p+"px");d+=carouselItems[f].height();d+=k}};
