/* v 3.12.1
author http://codecanyon.net/user/creativeinteractivemedia/portfolio?ref=creativeinteractivemedia
*/
var FLIPBOOK=FLIPBOOK||{};FLIPBOOK.BookSwipe=function(i,e,s,t){this.options=t,this.singlePage=t.singlePageMode,this.pageWidth=this.options.pageWidth,this.pageHeight=this.options.pageHeight,this.slides=[],this.pagesArr=[],this.leftPage=0,this.rightPage=0,this.rotation=0,this.prevPageEnabled=!1,this.setRightIndex(t.rightToLeft?t.pages.length:0),this.currentSlide=0,this.flipping=!1,this.wrapper=e,this.$wrapper=jQuery(e),this.scroller=i,this.$scroller=jQuery(this.scroller).removeClass("book").addClass("flipbook-carousel-scroller"),this.iscroll=new IScroll(this.wrapper,{snap:!0,snapSpeed:200*this.options.pageFlipDuration,freeScroll:!0,scrollX:!0,scrollY:!1,preventDefault:!1,eventPassthrough:"vertical"});for(var o=0;o<3;o++){var h=jQuery('
"').appendTo(this.$scroller);this.slides.push(h)}this.slides[0].iscroll=new IScroll(this.slides[0][0],{zoom:!0,scrollX:!0,scrollY:!0,freeScroll:!0,keepInCenterV:!0,keepInCenterH:!0,preventDefault:!1}),this.slides[2].iscroll=new IScroll(this.slides[2][0],{zoom:!0,scrollX:!0,scrollY:!0,freeScroll:!0,keepInCenterV:!0,keepInCenterH:!0,preventDefault:!1}),this.slides[1].iscroll=new IScroll(this.slides[1][0],{zoom:!0,scrollX:!0,scrollY:!0,freeScroll:!0,keepInCenterV:!0,keepInCenterH:!0,preventDefault:!1});for(o=0;o<3;o++)this.slides[o].iscroll.on("zoomEnd",function(){var i=t.main.zoom;this.options.eventPassthrough=1l.currentSlide?l.setRightIndex(l.rightIndex+1):il.currentSlide?l.setRightIndex(l.rightIndex+2):ithis.options.pages.length&&(i=this.options.pages.length),!this.singlePage&&i%2==0||i--,(isNaN(i)||i<0)&&(i=0),this.resetZoom(),e)return this.setRightIndex(i),void this.updateVisiblePages();this.singlePage?(this.options.rightToLeft&&this.options.oddPages&&i<1&&(i=1),i>this.rightIndex?(this.setSlidePages(this.currentSlide+1,[i]),this.setRightIndex(i-1),this.nextPage(e)):ithis.rightIndex?i>=this.pagesArr.length?(this.setSlidePages(2,[i-1,i]),this.setRightIndex(i-2),this.goToSlide(2,e)):(this.setSlidePages(this.currentSlide+1,[i-1,i]),this.setRightIndex(i-2),this.nextPage(e)):ii/e,n=!this.options.singlePageMode&&(!this.options.responsiveView||i>this.options.responsiveViewTreshold||!h),l=n?2*t:t,a=o;this.bw=l,s=(this.bh=a)/l").addClass("flipbook-carousel-page"),this.wrapper=this.$wrapper[0],this.model=i,this.$inner=jQuery("").appendTo(this.$wrapper).addClass("flipbook-carousel-page-inner"),this.$bg=jQuery("
").appendTo(this.$inner).addClass("flipbook-carousel-page-bg"),this.$html=jQuery("
").appendTo(this.$inner).addClass("flipbook-page-htmlContent"),e.pagePreloader?this.$preloader=jQuery('
').appendTo(this.$inner):this.$preloader=jQuery('
').appendTo(this.$inner),this.setSize(this.pw,this.ph)},FLIPBOOK.PageSwipe.prototype={load:function(t){var i=this.options.rightToLeft?this.options.numPages-this.index-1:this.index,o=this;this.loaded?t&&t.call(this):(this.loaded=!0,this.options.main.loadPageHTML(i,function(i){o.htmlContent=i,o.updateHtmlContent()}),this.options.main.loadPage(i,this.options.pageTextureSize,function(i){if(i.image){var e=i.image;o.$img=jQuery(e).addClass("page-carousel-img");i.image.naturalHeight;var s=i.image.naturalHeight;o.options.pageWidth,o.options.pageHeight;o.$img.appendTo(o.$bg),o.options.doublePage&&0