var CL=CL||{};CL.Views.SimpleGallerySlide=CL.Views.GallerySubobjectItem.extend({initialize:function(){var view=this;this.state=this.options.state;this.options.animationDuration=400;this.options.animationDistance=400;},enter:function(direction){var view=this,before={"z-index":1,'opacity':0},after={'opacity':1,},afterAnimate;if(direction=="next"){_.extend(before,{'left':view.options.animationDistance,});_.extend(after,{"left":0,});}else if(direction=="prev"){_.extend(before,{"left":0-view.options.animationDistance,});_.extend(after,{"left":0,});} this.$el.show().css(before);if(this.state.get('state','uninitialized')){this.reportSlideHeight();} afterAnimate=function(){view.reportSlideHeight();} if(CL.vars.isFirefox||CL.vars.isIE9){this.$el.stop().animate(after,this.options.animationDuration,afterAnimate);}else{this.$el.transitionStop().transition(after,this.options.animationDuration);} this.$el.addClass('active');},exit:function(direction,success){var view=this,before={"z-index":1,'opacity':1},after={'opacity':0,},afterAnimate;if(direction=="next"){_.extend(before,{'left':0,});_.extend(after,{"left":view.options.animationDistance,});}else if(direction=="prev"){_.extend(before,{"left":0,});_.extend(after,{"left":0-view.options.animationDistance,});} this.$el.show().css(before);if(CL.vars.isFirefox||CL.vars.isIE9){this.$el.css(before).show().stop().delay(1).animate(after,this.options.animationDuration,function(){view.$el.hide();});}else{this.$el.css(before).show().transitionStop().delay(1).transition(after,this.options.animationDuration,function(){view.$el.hide();});} success&&success();this.$el.removeClass('active');},reportSlideHeight:function(){var slideHeight=this.$el.outerHeight();this.state.set("activeSlideHeight",slideHeight);},});CL.Views.SimpleGallerySlides=CL.Views.GallerySubobject.extend({subObj:CL.Views.SimpleGallerySlide,goToCurrentIndex:function(){this.goToIndex(this.state.get("index"),this.state.get("direction"));},goToIndex:function(index,direction){var newObj=this.objects[index],oldObjDirection=direction&&(direction=="backward"?"next":"prev"),newObjDirection=direction&&(direction=="backward"?"prev":"next");if(newObj){if(this.activeObj){this.activeObj.exit(oldObjDirection,function(){newObj.enter(newObjDirection);});}else{newObj.enter(newObjDirection);} this.activeObj=newObj;}},});CL.Views.SimpleGallery=CL.Views.Gallery.extend({slidesObj:CL.Views.SimpleGallerySlides,swipeEnabled:true,autoRotate:false,afterInit:function(){var view=this;this.state.set('state','ready');},});