function CarouselHelper(a){this.carouselId=a.carouselId;this.metadata=a.metadata;this.template=a.template;this.cacheLength=a.cacheLength||2;this.addImageHeight=a.addImageHeight===undefined?true:false;this.imageHeight=[]}CarouselHelper.prototype.buildHtml=function(a){return this.template.replace(/\{([^}]+)\}/g,function(c,b){if(a[b]||a[b]===""){return a[b]}})};CarouselHelper.prototype.getCache=function(){var c={},d=/(\d+)/g,f=navigator.userAgent.toLowerCase().indexOf("chrome")>-1,e=this;$.each(this.metadata,function(h,k){for(var m=0;m<e.cacheLength;m++){var j=null,g=[],l=[];if(k.dimensions){while(g=d.exec(k.dimensions)){l.push(g[0])}if(typeof Image==="undefined"){j=document.createElement("img")}else{j=new Image(l[0],l[1])}if(f){j.height=l[1];j.width=l[0]}j.src=k.imageURL;j.alt=k.imageAltText;if(typeof Image==="undefined"){j.height=l[1];j.width=l[0]}}else{j=document.createElement("img")}e.imageHeight.push(j.height);if(!c["a"+m]){c["a"+m]=[]}c["a"+m].push(j)}});if(this.cacheLength===1){return c.a0}else{var b=[];for(var a=0;a<e.cacheLength;a++){b=b.concat(c["a"+a])}return b}};CarouselHelper.prototype.getMaxHeight=function(){var a=this,b=[];$("#"+this.carouselId+" li").each(function(c){var d=$(this).height();if(a.addImageHeight){d+=a.imageHeight[c]}b.push(d)});return Math.max.apply(Math,b)};CarouselHelper.prototype.setPlaceholders=function(){var a=this;$.each(this.metadata,function(b,c){$("#"+a.carouselId).append("<li class='jcarousel-item'>"+a.buildHtml(c)+"</li>")})};CarouselHelper.getCacheLength=function(b){var a=b.length;switch(true){case a===1:return 12;case a<4:return 7;case a===4:return 4;default:return 2}};