!function(a,b,c){var d,e=b.event;e.special.smartresize={setup:function(){b(this).bind("resize",e.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",e.special.smartresize.handler)},handler:function(a,b){var c=this,e=arguments;a.type="smartresize",d&&cleartimeout(d),d=settimeout(function(){jquery.event.handle.apply(c,e)},"execasap"===b?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execasap"])},b.slideshow=function(a,c){this.$el=b(c),this.$list=this.$el.find("ul.ei-slider-large"),this.$imgitems=this.$list.children("li"),this.itemscount=this.$imgitems.length,this.$images=this.$imgitems.find("img:first"),this.$sliderthumbs=this.$el.find("ul.ei-slider-thumbs").hide(),this.$sliderelems=this.$sliderthumbs.children("li"),this.$sliderelem=this.$sliderthumbs.children("li.ei-slider-element"),this.$thumbs=this.$sliderelems.not(".ei-slider-element"),this._init(a)},b.slideshow.defaults={animation:"sides",autoplay:!1,slideshow_interval:3e3,speed:800,easing:"",titlesfactor:.6,titlespeed:800,titleeasing:"",thumbmaxwidth:150},b.slideshow.prototype={_init:function(a){this.options=b.extend(!0,{},b.slideshow.defaults,a),this.$imgitems.css("opacity",0),this.$imgitems.find("div.ei-title > *").css("opacity",0),this.current=0;var c=this;this.$loading=b('
loading
').prependto(c.$el),b.when(this._preloadimages()).done(function(){c.$loading.hide(),c._setimagessize(),c._initthumbs(),c.$imgitems.eq(c.current).css({opacity:1,"z-index":10}).show().find("div.ei-title > *").css("opacity",1),c.options.autoplay&&c._startslideshow(),c._initevents()})},_preloadimages:function(){var a=this,c=0;return b.deferred(function(d){a.$images.each(function(e){b("").load(function(){++c===a.itemscount&&d.resolve()}).attr("src",b(this).attr("src"))})}).promise()},_setimagessize:function(){this.elwidth=this.$el.width();var a=this;this.$images.each(function(c){var d=b(this);imgdim=a._getimagedim(d.attr("src")),d.css({width:imgdim.width,height:imgdim.height,marginleft:imgdim.left,margintop:imgdim.top})})},_getimagedim:function(a){var b=new image;b.src=a;var c,d,e=this.elwidth,f=this.$el.height(),g=f/e,h=b.width,i=b.height,j=i/h;return g>j?(d=f,c=f/j):(d=e*j,c=e),{width:c,height:d,left:(e-c)/2,top:(f-d)/2}},_initthumbs:function(){this.$sliderelems.css({"max-width":this.options.thumbmaxwidth+"px",width:100/this.itemscount+"%"}),this.$sliderthumbs.css("max-width",this.options.thumbmaxwidth*this.itemscount+"px").show()},_startslideshow:function(){var a=this;this.slideshow=settimeout(function(){var b;b=a.current===a.itemscount-1?0:a.current+1,a._slideto(b),a.options.autoplay&&a._startslideshow()},this.options.slideshow_interval)},_slideto:function(a){if(a===this.current||this.isanimating)return!1;this.isanimating=!0;var c=this.$imgitems.eq(this.current),d=this.$imgitems.eq(a),e=this,f={zindex:10},g={opacity:1};"sides"===this.options.animation&&(f.left=a>this.current?-1*this.elwidth:this.elwidth,g.left=0),d.find("div.ei-title > h2").css("margin-right","50px").stop().delay(this.options.speed*this.options.titlesfactor).animate({marginright:"0px",opacity:1},this.options.titlespeed,this.options.titleeasing).end().find("div.ei-title > h3").css("margin-right","-50px").stop().delay(this.options.speed*this.options.titlesfactor).animate({marginright:"0px",opacity:1},this.options.titlespeed,this.options.titleeasing),b.when(c.css("z-index",1).find("div.ei-title > *").stop().fadeout(this.options.speed/2,function(){b(this).show().css("opacity",0)}),d.css(f).stop().animate(g,this.options.speed,this.options.easing),this.$sliderelem.stop().animate({left:this.$thumbs.eq(a).position().left},this.options.speed)).done(function(){c.css("opacity",0).find("div.ei-title > *").css("opacity",0),e.current=a,e.isanimating=!1})},_initevents:function(){var c=this;b(a).on("smartresize.eislideshow",function(a){c._setimagessize(),c.$sliderelem.css("left",c.$thumbs.eq(c.current).position().left)}),this.$thumbs.on("click.eislideshow",function(a){c.options.autoplay&&(cleartimeout(c.slideshow),c.options.autoplay=!1);var d=b(this),e=d.index()-1;return c._slideto(e),!1})}};var f=function(a){this.console};b.fn.eislideshow=function(a){if("string"==typeof a){var c=array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"eislideshow");return d&&b.isfunction(d[a])&&"_"!==a.charat(0)?void d[a].apply(d,c):void f()})}else this.each(function(){b.data(this,"eislideshow")||b.data(this,"eislideshow",new b.slideshow(a,this))});return this}}(window,jquery);