!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(c){function e(){}function d(e,t){m.ev.on(x+e+I,t)}function p(e,t,n,o){var i=document.createElement("div");return i.className="mfp-"+e,n&&(i.innerHTML=n),o?t&&t.appendChild(i):(i=c(i),t&&i.appendTo(t)),i}function u(e,t){m.ev.triggerHandler(x+e,t),m.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),m.st.callbacks[e])&&m.st.callbacks[e].apply(m,Array.isArray(t)?t:[t])}function f(e){return e===A&&m.currTemplate.closeBtn||(m.currTemplate.closeBtn=c(m.st.closeMarkup.replace("%title%",m.st.tClose)),A=e),m.currTemplate.closeBtn}function r(){c.magnificPopup.instance||((m=new e).init(),c.magnificPopup.instance=m)}function a(){y&&(v.after(y.addClass(l)).detach(),y=null)}function i(){n&&c(document.body).removeClass(n)}function t(){i(),m.req&&m.req.abort()}var m,o,g,s,h,A,l,v,y,n,w="Close",F="BeforeClose",C="MarkupParse",b="Open",j="Change",x="mfp",I="."+x,T="mfp-ready",N="mfp-removing",k="mfp-prevent-close",P=!!window.jQuery,_=c(window),S=(c.magnificPopup={instance:null,proto:e.prototype={constructor:e,init:function(){var e=navigator.appVersion;m.isLowIE=m.isIE8=document.all&&!document.addEventListener,m.isAndroid=/android/gi.test(e),m.isIOS=/iphone|ipad|ipod/gi.test(e),m.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),m.probablyMobile=m.isAndroid||m.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),g=c(document),m.popupsCache={}},open:function(e){if(!1===e.isObj){m.items=e.items.toArray(),m.index=0;for(var t,n=e.items,o=0;o(e||_.height())},_setFocus:function(){(m.st.focus?m.content.find(m.st.focus).eq(0):m.wrap).trigger("focus")},_onFocusIn:function(e){if(e.target!==m.wrap[0]&&!c.contains(m.wrap[0],e.target))return m._setFocus(),!1},_parseMarkup:function(i,e,t){var r;t.data&&(e=c.extend(t.data,e)),u(C,[i,e,t]),c.each(e,function(e,t){if(void 0===t||!1===t)return!0;var n,o;1<(r=e.split("_")).length?0<(n=i.find(I+"-"+r[0])).length&&("replaceWith"===(o=r[1])?n[0]!==t[0]&&n.replaceWith(t):"img"===o?n.is("img")?n.attr("src",t):n.replaceWith(c(" ").attr("src",t).attr("class",n.attr("class"))):n.attr(r[1],t)):m.st.allowHTMLInTemplate?i.find(I+"-"+e).html(t):i.find(I+"-"+e).text(t)})},_getScrollbarSize:function(){var e;return void 0===m.scrollbarSize&&((e=document.createElement("div")).style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),m.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),m.scrollbarSize}},modules:[],open:function(e,t){return r(),(e=e?c.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return c.magnificPopup.instance&&c.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(c.magnificPopup.defaults[e]=t.options),c.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'× ',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0,allowHTMLInStatusIndicator:!1,allowHTMLInTemplate:!1}},c.fn.magnificPopup=function(e){r();var t,n,o,i=c(this);return"string"==typeof e?"open"===e?(t=P?i.data("magnificPopup"):i[0].magnificPopup,n=parseInt(arguments[1],10)||0,o=t.items?t.items[n]:(o=i,(o=t.delegate?o.find(t.delegate):o).eq(n)),m._openClick({mfpEl:o},i,t)):m.isOpen&&m[e].apply(m,Array.prototype.slice.call(arguments,1)):(e=c.extend(!0,{},e),P?i.data("magnificPopup",e):i[0].magnificPopup=e,m.addGroup(i,e)),i},"inline"),E=(c.magnificPopup.registerModule(S,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){m.types.push(S),d(w+"."+S,function(){a()})},getInline:function(e,t){var n,o,i;return a(),e.src?(n=m.st.inline,(o=c(e.src)).length?((i=o[0].parentNode)&&i.tagName&&(v||(l=n.hiddenClass,v=p(l),l="mfp-"+l),y=o.after(v).detach().removeClass(l)),m.updateStatus("ready")):(m.updateStatus("error",n.tNotFound),o=c("")),e.inlineElement=o):(m.updateStatus("ready"),m._parseMarkup(t,{},e),t)}}}),"ajax");c.magnificPopup.registerModule(E,{options:{settings:null,cursor:"mfp-ajax-cur",tError:"The content could not be loaded."},proto:{initAjax:function(){m.types.push(E),n=m.st.ajax.cursor,d(w+"."+E,t),d("BeforeChange."+E,t)},getAjax:function(o){n&&c(document.body).addClass(n),m.updateStatus("loading");var e=c.extend({url:o.src,success:function(e,t,n){e={data:e,xhr:n};u("ParseAjax",e),m.appendContent(c(e.data),E),o.finished=!0,i(),m._setFocus(),setTimeout(function(){m.wrap.addClass(T)},16),m.updateStatus("ready"),u("AjaxContentAdded")},error:function(){i(),o.finished=o.loadError=!0,m.updateStatus("error",m.st.ajax.tError.replace("%url%",o.src))}},m.st.ajax.settings);return m.req=c.ajax(e),""}}});var z;c.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:"The image could not be loaded."},proto:{initImage:function(){var e=m.st.image,t=".image";m.types.push("image"),d(b+t,function(){"image"===m.currItem.type&&e.cursor&&c(document.body).addClass(e.cursor)}),d(w+t,function(){e.cursor&&c(document.body).removeClass(e.cursor),_.off("resize"+I)}),d("Resize"+t,m.resizeImage),m.isLowIE&&d("AfterChange",m.resizeImage)},resizeImage:function(){var e,t=m.currItem;t&&t.img&&m.st.image.verticalFit&&(e=0,m.isLowIE&&(e=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",m.wH-e))},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,z&&clearInterval(z),e.isCheckingImgSize=!1,u("ImageHasSize",e),e.imgHidden)&&(m.content&&m.content.removeClass("mfp-loading"),e.imgHidden=!1)},findImageSize:function(t){function n(e){z&&clearInterval(z),z=setInterval(function(){0
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){m.types.push(L),d("BeforeChange",function(e,t,n){t!==n&&(t===L?O():n===L&&O(!0))}),d(w+"."+L,function(){O()})},getIframe:function(e,t){var n=e.src,o=m.st.iframe,i=(c.each(o.patterns,function(){if(-1',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%",langDir:null,loop:!0},proto:{initGallery:function(){var r=m.st.gallery,e=".mfp-gallery";if(m.direction=!0,!r||!r.enabled)return!1;r.langDir||(r.langDir=document.dir||"ltr"),h+=" mfp-gallery",d(b+e,function(){r.navigateByImgClick&&m.wrap.on("click"+e,".mfp-img",function(){if(1=m.index,m.index=e,m.updateItemHTML()},preloadNearbyImages:function(){for(var e=m.st.gallery.preload,t=Math.min(e[0],m.items.length),n=Math.min(e[1],m.items.length),o=1;o<=(m.direction?n:t);o++)m._preloadItem(m.index+o);for(o=1;o<=(m.direction?t:n);o++)m._preloadItem(m.index-o)},_preloadItem:function(e){var t;e=M(e),m.items[e].preloaded||((t=m.items[e]).parsed||(t=m.parseEl(e)),u("LazyLoad",t),"image"===t.type&&(t.img=c(' ').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,u("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0)},updateGalleryButtons:function(){m.st.gallery.loop||"object"!=typeof m.arrowPrev||null===m.arrowPrev||(0===m.index?m.arrowPrev.hide():m.arrowPrev.show(),m.index===m.items.length-1?m.arrowNext.hide():m.arrowNext.show())}}}),"retina");c.magnificPopup.registerModule(H,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){var n,o;1":">",'"':""","'":"'","`":"`"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;et instanceof HTMLElement)).reduce(((t,e)=>{if(!i)return t.push(e),t;e.matches(i)&&t.push(e);let n=e.querySelectorAll(i);return t=t.concat(...n)}),[])},debounceMethod:function(t,e,i){i=i||100;let n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){clearTimeout(this[o]);let t=arguments;this[o]=setTimeout((()=>{n.apply(this,t),delete this[o]}),i)}},docReady:function(t){let e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,e,i){return e+"-"+i})).toLowerCase()}},i=t.console;return e.htmlInit=function(n,o){e.docReady((function(){let s="data-"+e.toDashed(o),r=document.querySelectorAll(`[${s}]`),l=t.jQuery;[...r].forEach((t=>{let e,r=t.getAttribute(s);try{e=r&&JSON.parse(r)}catch(e){return void(i&&i.error(`Error parsing ${s} on ${t.className}: ${e}`))}let h=new n(t,e);l&&l.data(t,o,h)}))}))},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("fizzy-ui-utils")):t.InfiniteScroll=e(t,t.EvEmitter,t.fizzyUIUtils)}(window,(function(t,e,i){let n=t.jQuery,o={};function s(t,e){let r=i.getQueryElement(t);if(r){if((t=r).infiniteScrollGUID){let i=o[t.infiniteScrollGUID];return i.option(e),i}this.element=t,this.options={...s.defaults},this.option(e),n&&(this.$element=n(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(r||t))}s.defaults={},s.create={},s.destroy={};let r=s.prototype;Object.assign(r,e.prototype);let l=0;r.create=function(){let t=this.guid=++l;if(this.element.infiniteScrollGUID=t,o[t]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath()){this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit();for(let t in s.create)s.create[t].call(this)}else console.error("Disabling InfiniteScroll")},r.option=function(t){Object.assign(this.options,t)},r.callOnInit=function(){let t=this.options.onInit;t&&t.call(this,this)},r.dispatchEvent=function(t,e,i){this.log(t,i);let o=e?[e].concat(i):i;if(this.emitEvent(t,o),!n||!this.$element)return;let s=t+=".infiniteScroll";if(e){let i=n.Event(e);i.type=t,s=i}this.$element.trigger(s,i)};let h={initialized:t=>`on ${t}`,request:t=>`URL: ${t}`,load:(t,e)=>`${t.title||""}. URL: ${e}`,error:(t,e)=>`${t}. URL: ${e}`,append:(t,e,i)=>`${i.length} items. URL: ${e}`,last:(t,e)=>`URL: ${e}`,history:(t,e)=>`URL: ${e}`,pageIndex:function(t,e){return`current page determined to be: ${t} from ${e}`}};r.log=function(t,e){if(!this.options.debug)return;let i=`[InfiniteScroll] ${t}`,n=h[t];n&&(i+=". "+n.apply(this,e)),console.log(i)},r.updateMeasurements=function(){this.windowHeight=t.innerHeight;let e=this.element.getBoundingClientRect();this.top=e.top+t.scrollY},r.updateScroller=function(){let e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:i.getQueryElement(e),!this.scroller)throw new Error(`Unable to find elementScroll: ${e}`)}else this.scroller=t},r.updateGetPath=function(){let t=this.options.path;if(!t)return void console.error(`InfiniteScroll path option required. Set as: ${t}`);let e=typeof t;"function"!=e?"string"==e&&t.match("{{#}}")?this.updateGetPathTemplate(t):this.updateGetPathSelector(t):this.getPath=t},r.updateGetPathTemplate=function(t){this.getPath=()=>{let e=this.pageIndex+1;return t.replace("{{#}}",e)};let e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};let a=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/],c=s.getPathParts=function(t){if(t)for(let e of a){let i=t.match(e);if(i){let[,t,e,n]=i;return{begin:t,index:e,end:n}}}};r.updateGetPathSelector=function(t){let e=document.querySelector(t);if(!e)return void console.error(`Bad InfiniteScroll path option. Next link not found: ${t}`);let i=e.getAttribute("href"),n=c(i);if(!n)return void console.error(`InfiniteScroll unable to parse next link href: ${i}`);let{begin:o,index:s,end:r}=n;this.isPathSelector=!0,this.getPath=()=>o+(this.pageIndex+1)+r,this.pageIndex=parseInt(s,10)-1,this.log("pageIndex",[this.pageIndex,"next link"])},r.updateGetAbsolutePath=function(){let t=this.getPath();if(t.match(/^http/)||t.match(/^\//))return void(this.getAbsolutePath=this.getPath);let{pathname:e}=location,i=t.match(/^\?/),n=e.substring(0,e.lastIndexOf("/")),o=i?e:n+"/";this.getAbsolutePath=()=>o+this.getPath()},s.create.hideNav=function(){let t=i.getQueryElement(this.options.hideNav);t&&(t.style.display="none",this.nav=t)},s.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},r.destroy=function(){this.allOff();for(let t in s.destroy)s.destroy[t].call(this);delete this.element.infiniteScrollGUID,delete o[this.guid],n&&this.$element&&n.removeData(this.element,"infiniteScroll")},s.throttle=function(t,e){let i,n;return e=e||200,function(){let o=+new Date,s=arguments,r=()=>{i=o,t.apply(this,s)};i&&o{if(!i.ok){let t=new Error(i.statusText);return this.onPageError(t,o,i),{response:i}}return i[t]().then((s=>("text"==t&&e&&(s=n.parseFromString(s,"text/html")),204==i.status?(this.lastPageReached(s,o),{body:s,response:i}):this.onPageLoad(s,o,i))))})).catch((t=>{this.onPageError(t,o)}));return this.dispatchEvent("request",null,[o,s]),s},i.onPageLoad=function(t,e,i){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[t,e,i]),this.appendNextPage(t,e,i)},i.appendNextPage=function(t,e,i){let{append:n,responseBody:s,domParseResponse:r}=this.options;if(!("text"==s&&r)||!n)return{body:t,response:i};let l=t.querySelectorAll(n),h={body:t,response:i,items:l};if(!l||!l.length)return this.lastPageReached(t,e),h;let a=o(l),c=()=>(this.appendItems(l,a),this.isLoading=!1,this.dispatchEvent("append",null,[t,e,l,i]),h);return this.options.outlayer?this.appendOutlayerItems(a,c):c()},i.appendItems=function(t,e){t&&t.length&&(function(t){let e=t.querySelectorAll("script");for(let t of e){let e=document.createElement("script"),i=t.attributes;for(let t of i)e.setAttribute(t.name,t.value);e.innerHTML=t.innerHTML,t.parentNode.replaceChild(e,t)}}(e=e||o(t)),this.element.appendChild(e))},i.appendOutlayerItems=function(i,n){let o=e.imagesLoaded||t.imagesLoaded;return o?new Promise((function(t){o(i,(function(){let e=n();t(e)}))})):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},i.onAppendOutlayer=function(t,e,i){this.options.outlayer.appended(i)},i.checkLastPage=function(t,e){let i,{checkLastPage:n,path:o}=this.options;if(n){if("function"==typeof o){if(!this.getPath())return void this.lastPageReached(t,e)}"string"==typeof n?i=n:this.isPathSelector&&(i=o),i&&t.querySelector&&(t.querySelector(i)||this.lastPageReached(t,e))}},i.lastPageReached=function(t,e){this.canLoad=!1,this.dispatchEvent("last",null,[t,e])},i.onPageError=function(t,e,i){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[t,e,i]),t},e.create.prefill=function(){if(!this.options.prefill)return;let t=this.options.append;t?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error(`append option required for prefill. Set as :${t}`)},i.prefill=function(){let t=this.getPrefillDistance();this.isPrefilling=t>=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},i.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},i.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;return Object.assign(e.defaults,{scrollThreshold:400}),e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);let t=this.options.scrollThreshold;(t||0===t)&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){let i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.pageScrollHandler),t[i]("resize",this.resizeHandler)},n.onPageScroll=e.throttle((function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")})),n.getBottomDistance=function(){let e,i;return this.options.elementScroll?(e=this.scroller.scrollHeight,i=this.scroller.scrollTop+this.scroller.clientHeight):(e=this.top+this.element.clientHeight,i=t.scrollY+this.windowHeight),e-i},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;Object.assign(e.defaults,{history:"replace"});let o=document.createElement("a");return e.create.history=function(){if(!this.options.history)return;o.href=this.getAbsolutePath(),(o.origin||o.protocol+"//"+o.host)==location.origin?this.options.append?this.createHistoryAppend():this.createHistoryPageLoad():console.error(`[InfiniteScroll] cannot set history with different origin: ${o.origin} on ${location.origin} . History behavior disabled.`)},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPage=this.scrollPages[0],this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){let i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.scrollHistoryHandler),t[i]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(t,e,i){if(!i||!i.length)return;let n=i[0],s=this.getElementScrollY(n);o.href=e,this.scrollPages.push({top:s,path:o.href,title:t.title})},n.getElementScrollY=function(e){if(this.options.elementScroll)return e.offsetTop-this.top;return e.getBoundingClientRect().top+t.scrollY},n.onScrollHistory=function(){let t=this.getClosestScrollPage();t!=this.scrollPage&&(this.scrollPage=t,this.setHistory(t.title,t.path))},i.debounceMethod(e,"onScrollHistory",150),n.getClosestScrollPage=function(){let e,i;e=this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.scrollY+this.windowHeight/2;for(let t of this.scrollPages){if(t.top>=e)break;i=t}return i},n.setHistory=function(t,e){let i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,t,e),this.options.historyTitle&&(document.title=t),this.dispatchEvent("history",null,[t,e]))},n.onUnload=function(){if(0===this.scrollPage.top)return;let e=t.scrollY-this.scrollPage.top+this.top;this.destroyHistory(),scrollTo(0,e)},n.onPageLoadHistory=function(t,e){this.setHistory(t.title,e)},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){class n{constructor(t,e){this.element=t,this.infScroll=e,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}onClick(t){t.preventDefault(),this.infScroll.loadNextPage()}enable(){this.element.removeAttribute("disabled")}disable(){this.element.disabled="disabled"}hide(){this.element.style.display="none"}destroy(){this.element.removeEventListener("click",this.clickHandler)}}return e.create.button=function(){let t=i.getQueryElement(this.options.button);t&&(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},e.Button=n,e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;function o(t){r(t,"none")}function s(t){r(t,"block")}function r(t,e){t&&(t.style.display=e)}return e.create.status=function(){let t=i.getQueryElement(this.options.status);t&&(this.statusElement=t,this.statusEventElements={request:t.querySelector(".infinite-scroll-request"),error:t.querySelector(".infinite-scroll-error"),last:t.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},n.bindHideStatus=function(t){let e=this.options.append?"append":"load";this[t](e,this.hideAllStatus)},n.showRequestStatus=function(){this.showStatus("request")},n.showErrorStatus=function(){this.showStatus("error")},n.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},n.showStatus=function(t){s(this.statusElement),this.hideStatusEventElements(),s(this.statusEventElements[t])},n.hideAllStatus=function(){o(this.statusElement),this.hideStatusEventElements()},n.hideStatusEventElements=function(){for(let t in this.statusEventElements){o(this.statusEventElements[t])}},e})),
/*!
* imagesLoaded v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){"use strict";var i=t.jQuery,n=t.console;function o(t,e){for(var i in e)t[i]=e[i];return t}var s=Array.prototype.slice;function r(t,e,l){if(!(this instanceof r))return new r(t,e,l);var h,a=t;("string"==typeof t&&(a=document.querySelectorAll(t)),a)?(this.elements=(h=a,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?s.call(h):[h]),this.options=o({},this.options),"function"==typeof e?l=e:o(this.options,e),l&&this.on("always",l),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):n.error("Bad element for imagesLoaded "+(a||t))}r.prototype=Object.create(e.prototype),r.prototype.options={},r.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},r.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&l[e]){for(var i=t.querySelectorAll("img"),n=0;n0){var infArgs=[];for(var i=0;i🔍');gallery.on('click','.woocommerce-product-gallery__trigger',function(e){e.preventDefault();e.stopPropagation();if(script==='lightgallery'){if(flex.length){var image=flex.find('.flex-active-slide a[data-rel] img');var linkId=flex.find('.flex-active-slide a[data-rel]').data('lg-id');image.trigger('click.lgcustom-item-'+linkId);}else{var link=gallery.find('a[data-rel]').first();var image=link.find('img');image.trigger('click.lgcustom-item-'+link.data('lg-id'));}}else if(script==='fancybox_pro'){if(flex.length){var index=flex.find('.flex-active-slide').index();var imageId=flex.find('.flex-active-slide a[data-rel]').data('fancybox');Fancybox.fromOpener('[data-fancybox="'+imageId+'"]',{startIndex:index});}else{var link=gallery.find('a[data-rel]').first();Fancybox.fromOpener('[data-fancybox="'+link.data('fancybox')+'"]',{startIndex:0});}}else{if(flex.length)
flex.find('.flex-active-slide a[data-rel]').trigger('click');else
gallery.find('a[data-rel]').first().trigger('click');}});}}},10);if(delayLightbox){setTimeout(function(){initLightbox(event);},0);}else
initLightbox(event);});function initLightbox(event){var script=event.script;var selector=event.selector;var args=event.args;switch(script){case'swipebox':var slide=$('#swipebox-overlay').find('.slide.current');var imageSource='';var allowHide=false;var closeExecuted=false;$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').swipebox({useCSS:args.animation,useSVG:args.useSVG,hideCloseButtonOnMobile:args.hideCloseButtonOnMobile,removeBarsOnMobile:args.removeBarsOnMobile,hideBarsDelay:args.hideBars?parseInt(args.hideBarsDelay):0,videoMaxWidth:parseInt(args.videoMaxWidth),loopAtEnd:args.loopAtEnd,afterOpen:function(){closeExecuted=false;slide=$('#swipebox-overlay').find('.slide.current');var image=slide.find('img').attr('src');if(typeof image!=='undefined'){imageSource=image;rl_view_image(script,imageSource);}else
imageSource='';observeContentChanges(document.getElementById('swipebox-slider'),false,function(){if(imageSource===''){var image=slide.find('img').attr('src');if(typeof image!=='undefined'){imageSource=image;rl_view_image(script,imageSource);}else
imageSource='';}});},nextSlide:function(){slide=$('#swipebox-overlay').find('.slide.current');var image=slide.find('img').attr('src');if(typeof image!=='undefined'){imageSource=image;rl_view_image(script,imageSource);}else
imageSource='';},prevSlide:function(){slide=$('#swipebox-overlay').find('.slide.current');var image=slide.find('img').attr('src');if(typeof image!=='undefined'){imageSource=image;rl_view_image(script,imageSource);}else
imageSource='';},afterClose:function(){closeExecuted=true;if(allowHide){rl_hide_image(script,imageSource);allowHide=false;}}});$(window).on('resize',function(){if(!closeExecuted){allowHide=true;}});break;case'prettyphoto':var viewDisabled=false;var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').each(function(){var el=$(this);var title=el.data('rl_title');var caption=el.data('rl_caption');if(!title)
title='';else{title=title.replace(/[^]/g,function(c){return''+c.charCodeAt(0)+';';});}
if(!caption)
caption='';else{caption=caption.replace(/[^]/g,function(c){return''+c.charCodeAt(0)+';';});}
el.attr('title',caption);el.find('img').attr('alt',title);});$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').prettyPhoto({hook:'data-rel',animation_speed:args.animationSpeed,slideshow:args.slideshow?parseInt(args.slideshowDelay):false,autoplay_slideshow:args.slideshowAutoplay,opacity:args.opacity,show_title:args.showTitle,allow_resize:args.allowResize,allow_expand:args.allowExpand,default_width:parseInt(args.width),default_height:parseInt(args.height),counter_separator_label:args.separator,theme:args.theme,horizontal_padding:parseInt(args.horizontalPadding),hideflash:args.hideFlash,wmode:args.wmode,autoplay:args.videoAutoplay,modal:args.modal,deeplinking:args.deeplinking,overlay_gallery:args.overlayGallery,keyboard_shortcuts:args.keyboardShortcuts,social_tools:args.social?'':'',ie6_fallback:true,changepicturecallback:function(){if(viewDisabled){viewDisabled=false;return;}
lastImage=$('#pp_full_res').find('img').attr('src');rl_view_image(script,lastImage);if(args.allowExpand){$('a.pp_expand').on('click',function(){viewDisabled=true;});}},callback:function(){rl_hide_image(script,lastImage);}});break;case'nivo':$.each($('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]'),function(){var attr=$(this).attr('data-rel');if(typeof attr==='undefined'||attr==false){attr=$(this).attr('rel');}
if(typeof attr!=='undefined'&&attr!==false){var match=attr.match(new RegExp(selector+'\\-(gallery\\-(?:[\\da-z]{1,4}))','ig'));if(match!==null)
$(this).attr('data-lightbox-gallery',match[0]);}});var observerInitialized=false;var changeAllowed=true;var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').nivoLightbox({effect:args.effect,clickOverlayToClose:args.clickOverlayToClose,keyboardNav:args.keyboardNav,errorMessage:args.errorMessage,afterShowLightbox:function(lightbox){var content=$(lightbox)[0].find('.nivo-lightbox-content');if(!observerInitialized){observerInitialized=true;observeContentChanges(document.getElementsByClassName('nivo-lightbox-content')[0],true,function(){if(changeAllowed){lastImage=content.find('.nivo-lightbox-image img').attr('src');rl_view_image(script,lastImage);changeAllowed=false;}});}},afterHideLightbox:function(){changeAllowed=true;rl_hide_image(script,lastImage);},onPrev:function(element){changeAllowed=false;lastImage=element[0].attr('href');rl_view_image(script,lastImage);},onNext:function(element){changeAllowed=false;lastImage=element[0].attr('href');rl_view_image(script,lastImage);}});break;case'imagelightbox':var selectors=[];var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').each(function(i,item){var attr=$(item).attr('data-rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);else{attr=$(item).attr('rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);}});if(selectors.length>0){selectors=_.uniq(selectors);$(selectors).each(function(i,item){if(typeof event.pagination_type!=='undefined'){$('a[data-rel="'+item+'"], a[rel="'+item+'"]').each(function(){$(this).off('click.imageLightbox');});}
$('a[data-rel="'+item+'"], a[rel="'+item+'"]').imageLightbox({animationSpeed:parseInt(args.animationSpeed),preloadNext:args.preloadNext,enableKeyboard:args.enableKeyboard,quitOnEnd:args.quitOnEnd,quitOnImgClick:args.quitOnImageClick,quitOnDocClick:args.quitOnDocumentClick,onLoadEnd:function(){lastImage=$('#imagelightbox').attr('src');rl_view_image(script,lastImage);},onEnd:function(){rl_hide_image(script,lastImage);}});});}
break;case'tosrus':var selectors=[];var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').each(function(i,item){var attr=$(item).attr('data-rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);else{attr=$(item).attr('rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);}});if(selectors.length>0){selectors=_.uniq(selectors);$(selectors).each(function(i,item){if(typeof event.pagination_type!=='undefined'){$('body').find('.tosrus-'+item).remove();$('a[data-rel="'+item+'"], a[rel="'+item+'"]').each(function(){$(this).off('click.tos');});}
var tos=$('a[data-rel="'+item+'"], a[rel="'+item+'"]').tosrus({infinite:args.infinite,autoplay:{play:args.autoplay,pauseOnHover:args.pauseOnHover,timeout:args.timeout},effect:args.effect,keys:{prev:args.keys,next:args.keys,close:args.keys},pagination:{add:args.pagination,type:args.paginationType},show:false,buttons:true,caption:{add:true,attributes:["title"]},wrapper:{classes:'tosrus-'+item,onClick:args.closeOnClick?'close':'toggleUI'}});tos.on('sliding.tos',function(event,number){lastImage=$($(event.target).find('.tos-slider .tos-slide')[number]).find('img').attr('src');rl_view_image(script,lastImage);});tos.on('closing.tos',function(){rl_hide_image(script,lastImage);});});}
break;case'featherlight':delete $.featherlight.contentFilters.jquery;$.extend($.featherlight.contentFilters,{html:{regex:/[^]/,process:function(html){return $('',{text:html});}}});var selectors=[];var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').each(function(i,item){var attr=$(item).attr('data-rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);else{attr=$(item).attr('rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);}});if(selectors.length>0){selectors=_.uniq(selectors);$.extend($.featherlight.defaults,{contentFilters:['image','html','ajax','iframe','text'],openSpeed:parseInt(args.openSpeed),closeSpeed:parseInt(args.closeSpeed),closeOnClick:args.closeOnClick,closeOnEsc:args.closeOnEsc,afterOpen:function(event){lastImage=event.currentTarget.href;rl_view_image(script,lastImage);},afterClose:function(){rl_hide_image(script,lastImage);}});$(selectors).each(function(i,item){if(typeof event.pagination_type!=='undefined'){$('a[data-rel="'+item+'"], a[rel="'+item+'"]').each(function(){$(this).off('click.featherlight');});}
if(/-gallery-/.test(item)){$('a[data-rel="'+item+'"], a[rel="'+item+'"]').featherlightGallery({galleryFadeIn:parseInt(args.galleryFadeIn),galleryFadeOut:parseInt(args.galleryFadeOut),previousIcon:'❮',nextIcon:'❯'});}else if(/-video-/.test(item)){$('a[data-rel="'+item+'"], a[rel="'+item+'"]').featherlight();}else{$('a[data-rel="'+item+'"], a[rel="'+item+'"]').featherlight();}});}
break;case'magnific':var selectors=[];var lastImage='';$('a[rel*="'+selector+'"], a[data-rel*="'+selector+'"]').each(function(i,item){var attr=$(item).attr('data-rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);else{attr=$(item).attr('rel');if(typeof attr!=='undefined'&&attr!==false&&attr!=='norl')
selectors.push(attr);}});if(selectors.length>0){selectors=_.uniq(selectors);$(selectors).each(function(i,item){var subselector=$('a[data-rel="'+item+'"], a[rel="'+item+'"]');var element=$(subselector[0]);var media_type=element.data('magnific_type');var content_type=element.data('rl_content');if(typeof content_type!=='undefined')
media_type=content_type;if(typeof media_type==='undefined')
media_type='image';var fixedContentPos='auto';var fixedBgPos='auto';if(args.fixedContentPos==='true')
fixedContentPos=true;else if(args.fixedContentPos==='false')
fixedContentPos=false;if(args.fixedBgPos==='true')
fixedBgPos=true;else if(args.fixedBgPos==='false')
fixedBgPos=false;subselector.magnificPopup({allowHTMLInStatusIndicator:false,allowHTMLInTemplate:true,type:media_type==='gallery'?'image':(media_type==='video'?'iframe':media_type),disableOn:args.disableOn,midClick:args.midClick,preloader:args.preloader,closeOnContentClick:args.closeOnContentClick,closeOnBgClick:args.closeOnBgClick,closeBtnInside:args.closeBtnInside,showCloseBtn:args.showCloseBtn,enableEscapeKey:args.enableEscapeKey,alignTop:args.alignTop,autoFocusLast:args.autoFocusLast,fixedContentPos:fixedContentPos,fixedBgPos:fixedBgPos,image:{titleSrc:function(item){var title=item.el.data('rl_title');var caption=item.el.data('rl_caption');if(!title)
title='';else{title=title.replace(/[^]/g,function(c){return''+c.charCodeAt(0)+';';});}
if(!caption)
caption='';else{caption=caption.replace(/[^]/g,function(c){return''+c.charCodeAt(0)+';';});}
return title+'
'+caption+' ';}},gallery:{enabled:subselector.length>1&&media_type==='gallery',navigateByImgClick:true,preload:[0,1]},callbacks:{close:function(){rl_hide_image(script,this.currItem.src);},imageLoadComplete:function(){rl_view_image(script,this.currItem.src);},elementParse:function(item){if(item.src.trim().includes('<')){if(item.type==='inline')
item.src='
HTML is disallowed.
';else if(item.type==='iframe'||item.type==='ajax')
item.src='';}}}});});}
break;}}})(jQuery);
;(function ($, document, window) {
var
defaults = {
label: 'MENU',
duplicate: true,
duration: 200,
easingOpen: 'swing',
easingClose: 'swing',
closedSymbol: '►',
openedSymbol: '▼',
prependTo: 'body',
appendTo: '',
parentTag: 'a',
closeOnClick: false,
allowParentLinks: false,
nestedParentLinks: true,
showChildren: false,
removeIds: false,
removeClasses: false,
removeStyles: false,
brand: '',
init: function () {},
beforeOpen: function () {},
beforeClose: function () {},
afterOpen: function () {},
afterClose: function () {}
},
mobileMenu = 'slicknav',
prefix = 'slicknav';
function Plugin(element, options) {
this.element = element;
this.settings = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = mobileMenu;
this.init();
}
Plugin.prototype.init = function () {
var $this = this,
menu = $(this.element),
settings = this.settings,
iconClass,
menuBar;
if (settings.duplicate) {
$this.mobileNav = menu.clone();
$this.mobileNav.removeAttr('id');
$this.mobileNav.find('ul').removeClass('desktopnav_nav');
$this.mobileNav.find('span').remove();
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('id');
});
} else {
$this.mobileNav = menu;
$this.mobileNav.removeAttr('id');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('id');
});
}
if (settings.removeClasses) {
$this.mobileNav.removeAttr('class');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('class');
});
}
if (settings.removeStyles) {
$this.mobileNav.removeAttr('style');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('style');
});
}
iconClass = prefix + '_icon';
if (settings.label === '') {
iconClass += ' ' + prefix + '_no-text';
}
if (settings.parentTag == 'a') {
settings.parentTag = 'a href="#"';
}
$this.mobileNav.attr('class', prefix + '_nav');
menuBar = $('');
if (settings.brand !== '') {
var brand = $('
'+settings.brand+'
');
$(menuBar).append(brand);
}
$this.btn = $(
['<' + settings.parentTag + ' aria-haspopup="true" tabindex="0" class="' + prefix + '_btn ' + prefix + '_collapsed">',
'',
'
',
' ',
' ',
' ',
' ',
' ',
'' + settings.parentTag + '>'
].join('')
);
$(menuBar).append($this.btn);
if(settings.appendTo !== '') {
$(settings.appendTo).append(menuBar);
} else {
$(settings.prependTo).prepend(menuBar);
}
menuBar.append($this.mobileNav);
var items = $this.mobileNav.find('li');
$(items).each(function () {
var item = $(this),
data = {};
data.children = item.children('ul').attr('role', 'menu');
item.data('menu', data);
if (data.children.length > 0) {
var a = item.contents(),
containsAnchor = false,
nodes = [];
$(a).each(function () {
if (!$(this).is('ul')) {
nodes.push(this);
} else {
return false;
}
if($(this).is("a")) {
containsAnchor = true;
}
});
var wrapElement = $(
'<' + settings.parentTag + ' role="menuitem" aria-haspopup="true" tabindex="-1" class="' + prefix + '_item"/>'
);
if ((!settings.allowParentLinks || settings.nestedParentLinks) || !containsAnchor) {
var $wrap = $(nodes).wrapAll(wrapElement).parent();
$wrap.addClass(prefix+'_row');
} else
$(nodes).wrapAll('
').parent();
if (!settings.showChildren) {
item.addClass(prefix+'_collapsed');
} else {
item.addClass(prefix+'_open');
}
item.addClass(prefix+'_parent');
var arrowElement = $('
'+(settings.showChildren?settings.openedSymbol:settings.closedSymbol)+' ');
if (settings.allowParentLinks && !settings.nestedParentLinks && containsAnchor)
arrowElement = arrowElement.wrap(wrapElement).parent();
$(nodes).last().after(arrowElement);
} else if ( item.children().length === 0) {
item.addClass(prefix+'_txtnode');
}
item.children('a').attr('role', 'menuitem').click(function(event){
if (settings.closeOnClick && !$(event.target).parent().closest('li').hasClass(prefix+'_parent')) {
$($this.btn).click();
}
});
if (settings.closeOnClick && settings.allowParentLinks) {
item.children('a').children('a').click(function (event) {
$($this.btn).click();
});
item.find('.'+prefix+'_parent-link a:not(.'+prefix+'_item)').click(function(event){
$($this.btn).click();
});
}
});
$(items).each(function () {
var data = $(this).data('menu');
if (!settings.showChildren){
$this._visibilityToggle(data.children, null, false, null, true);
}
});
$this._visibilityToggle($this.mobileNav, null, false, 'init', true);
$this.mobileNav.attr('role','menu');
$(document).mousedown(function(){
$this._outlines(false);
});
$(document).keyup(function(){
$this._outlines(true);
});
$($this.btn).click(function (e) {
e.preventDefault();
$this._menuToggle();
});
$this.mobileNav.on('click', '.' + prefix + '_item', function (e) {
e.preventDefault();
$this._itemClick($(this));
});
$($this.btn).keydown(function (e) {
var ev = e || event;
if(ev.keyCode == 13) {
e.preventDefault();
$this._menuToggle();
}
});
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
var ev = e || event;
if(ev.keyCode == 13) {
e.preventDefault();
$this._itemClick($(this));
}
});
if (settings.allowParentLinks && settings.nestedParentLinks) {
$('.'+prefix+'_item a').click(function(e){
e.stopImmediatePropagation();
});
}
};
Plugin.prototype._menuToggle = function (el) {
var $this = this;
var btn = $this.btn;
var mobileNav = $this.mobileNav;
if (btn.hasClass(prefix+'_collapsed')) {
btn.removeClass(prefix+'_collapsed');
btn.addClass(prefix+'_open');
} else {
btn.removeClass(prefix+'_open');
btn.addClass(prefix+'_collapsed');
}
btn.addClass(prefix+'_animating');
$this._visibilityToggle(mobileNav, btn.parent(), true, btn);
};
Plugin.prototype._itemClick = function (el) {
var $this = this;
var settings = $this.settings;
var data = el.data('menu');
if (!data) {
data = {};
data.arrow = el.children('.'+prefix+'_arrow');
data.ul = el.next('ul');
data.parent = el.parent();
if (data.parent.hasClass(prefix+'_parent-link')) {
data.parent = el.parent().parent();
data.ul = el.parent().next('ul');
}
el.data('menu', data);
}
if (data.parent.hasClass(prefix+'_collapsed')) {
data.arrow.html(settings.openedSymbol);
data.parent.removeClass(prefix+'_collapsed');
data.parent.addClass(prefix+'_open');
data.parent.addClass(prefix+'_animating');
$this._visibilityToggle(data.ul, data.parent, true, el);
} else {
data.arrow.html(settings.closedSymbol);
data.parent.addClass(prefix+'_collapsed');
data.parent.removeClass(prefix+'_open');
data.parent.addClass(prefix+'_animating');
$this._visibilityToggle(data.ul, data.parent, true, el);
}
};
Plugin.prototype._visibilityToggle = function(el, parent, animate, trigger, init) {
var $this = this;
var settings = $this.settings;
var items = $this._getActionItems(el);
var duration = 0;
if (animate) {
duration = settings.duration;
}
$("#nav-icon3").toggleClass('open');
if (el.hasClass(prefix+'_hidden')) {
el.removeClass(prefix+'_hidden');
if (!init) {
settings.beforeOpen(trigger);
}
el.slideDown(duration, settings.easingOpen, function(){
$(trigger).removeClass(prefix+'_animating');
$(parent).removeClass(prefix+'_animating');
if (!init) {
settings.afterOpen(trigger);
}
});
el.attr('aria-hidden','false');
items.attr('tabindex', '0');
$this._setVisAttr(el, false);
} else {
el.addClass(prefix+'_hidden');
if (!init){
settings.beforeClose(trigger);
}
el.slideUp(duration, this.settings.easingClose, function() {
el.attr('aria-hidden','true');
items.attr('tabindex', '-1');
$this._setVisAttr(el, true);
el.hide(); //jQuery 1.7 bug fix
$(trigger).removeClass(prefix+'_animating');
$(parent).removeClass(prefix+'_animating');
if (!init){
settings.afterClose(trigger);
} else if (trigger == 'init'){
settings.init();
}
});
}
};
Plugin.prototype._setVisAttr = function(el, hidden) {
var $this = this;
var nonHidden = el.children('li').children('ul').not('.'+prefix+'_hidden');
if (!hidden) {
nonHidden.each(function(){
var ul = $(this);
ul.attr('aria-hidden','false');
var items = $this._getActionItems(ul);
items.attr('tabindex', '0');
$this._setVisAttr(ul, hidden);
});
} else {
nonHidden.each(function(){
var ul = $(this);
ul.attr('aria-hidden','true');
var items = $this._getActionItems(ul);
items.attr('tabindex', '-1');
$this._setVisAttr(ul, hidden);
});
}
};
Plugin.prototype._getActionItems = function(el) {
var data = el.data("menu");
if (!data) {
data = {};
var items = el.children('li');
var anchors = items.find('a');
data.links = anchors.add(items.find('.'+prefix+'_item'));
el.data('menu', data);
}
return data.links;
};
Plugin.prototype._outlines = function(state) {
if (!state) {
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','none');
} else {
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','');
}
};
Plugin.prototype.toggle = function(){
var $this = this;
$this._menuToggle();
};
Plugin.prototype.open = function(){
var $this = this;
if ($this.btn.hasClass(prefix+'_collapsed')) {
$this._menuToggle();
}
};
Plugin.prototype.close = function(){
var $this = this;
if ($this.btn.hasClass(prefix+'_open')) {
$this._menuToggle();
}
};
$.fn[mobileMenu] = function ( options ) {
var args = arguments;
if (options === undefined || typeof options === 'object') {
return this.each(function () {
if (!$.data(this, 'plugin_' + mobileMenu)) {
$.data(this, 'plugin_' + mobileMenu, new Plugin( this, options ));
}
});
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
var returns;
this.each(function () {
var instance = $.data(this, 'plugin_' + mobileMenu);
if (instance instanceof Plugin && typeof instance[options] === 'function') {
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
}
});
return returns !== undefined ? returns : this;
}
};
}(jQuery, document, window));
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under the MIT license
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j
document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i-1);this.superfish('hide');if(!this.parents('.'+o.hoverClass).length){o.onIdle.call(getMenu(this));if(o.$path.length){$.proxy(over,o.$path)();}}},out=function(){var $this=$(this),o=getOptions($this);if(ios){$.proxy(close,$this,o)();}
else{clearTimeout(o.sfTimer);o.sfTimer=setTimeout($.proxy(close,$this,o),o.delay);}},touchHandler=function(e){var $this=$(this),o=getOptions($this),$ul=$this.siblings(e.data.popUpSelector);if(o.onHandleTouch.call($ul)===false){return this;}
if($ul.length>0&&$ul.is(':hidden')){$this.one('click.superfish',false);if(e.type==='MSPointerDown'||e.type==='pointerdown'){$this.trigger('focus');}else{$.proxy(over,$this.parent('li'))();}}},applyHandlers=function($menu,o){var targets='li:has('+o.popUpSelector+')';if($.fn.hoverIntent&&!o.disableHI){$menu.hoverIntent(over,out,targets);}
else{$menu.on('mouseenter.superfish',targets,over).on('mouseleave.superfish',targets,out);}
var touchevent='MSPointerDown.superfish';if(unprefixedPointerEvents){touchevent='pointerdown.superfish';}
if(!ios){touchevent+=' touchend.superfish';}
if(wp7){touchevent+=' mousedown.superfish';}
$menu.on('focusin.superfish','li',over).on('focusout.superfish','li',out).on(touchevent,'a',o,touchHandler);};return{hide:function(instant){if(this.length){var $this=this,o=getOptions($this);if(!o){return this;}
var not=(o.retainPath===true)?o.$path:'',$ul=$this.find('li.'+o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),speed=o.speedOut;if(instant){$ul.show();speed=0;}
o.retainPath=false;if(o.onBeforeHide.call($ul)===false){return this;}
$ul.stop(true,true).animate(o.animationOut,speed,function(){var $this=$(this);o.onHide.call($this);});}
return this;},show:function(){var o=getOptions(this);if(!o){return this;}
var $this=this.addClass(o.hoverClass),$ul=$this.children(o.popUpSelector);if(o.onBeforeShow.call($ul)===false){return this;}
$ul.stop(true,true).animate(o.animation,o.speed,function(){o.onShow.call($ul);});return this;},destroy:function(){return this.each(function(){var $this=$(this),o=$this.data('sfOptions'),$hasPopUp;if(!o){return false;}
$hasPopUp=$this.find(o.popUpSelector).parent('li');clearTimeout(o.sfTimer);toggleMenuClasses($this,o);toggleAnchorClass($hasPopUp);toggleTouchAction($this);$this.off('.superfish').off('.hoverIntent');$hasPopUp.children(o.popUpSelector).attr('style',function(i,style){if(typeof style!=='undefined'){return style.replace(/display[^;]+;?/g,'');}});o.$path.removeClass(o.hoverClass+' '+c.bcClass).addClass(o.pathClass);$this.find('.'+o.hoverClass).removeClass(o.hoverClass);o.onDestroy.call($this);$this.removeData('sfOptions');});},init:function(op){return this.each(function(){var $this=$(this);if($this.data('sfOptions')){return false;}
var o=$.extend({},$.fn.superfish.defaults,op),$hasPopUp=$this.find(o.popUpSelector).parent('li');o.$path=setPathToCurrent($this,o);$this.data('sfOptions',o);toggleMenuClasses($this,o,true);toggleAnchorClass($hasPopUp,true);toggleTouchAction($this);applyHandlers($this,o);$hasPopUp.not('.'+c.bcClass).superfish('hide',true);o.onInit.call(this);});}};})();$.fn.superfish=function(method,args){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}
else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}
else{return $.error('Method '+method+' does not exist on jQuery.fn.superfish');}};$.fn.superfish.defaults={popUpSelector:'ul,.sf-mega',hoverClass:'sfHover',pathClass:'overrideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},animationOut:{opacity:'hide'},speed:'normal',speedOut:'fast',cssArrows:true,disableHI:false,onInit:$.noop,onBeforeShow:$.noop,onShow:$.noop,onBeforeHide:$.noop,onHide:$.noop,onIdle:$.noop,onDestroy:$.noop,onHandleTouch:$.noop};})(jQuery,window);
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b}return -c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b}if(t==d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(ab;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.createEvent=function(a,b,c,d){var e;return null==b&&(b=!1),null==c&&(c=!1),null==d&&(d=null),null!=document.createEvent?(e=document.createEvent("CustomEvent"),e.initCustomEvent(a,b,c,d)):null!=document.createEventObject?(e=document.createEventObject(),e.eventType=a):e.eventName=a,e},a.prototype.emitEvent=function(a,b){return null!=a.dispatchEvent?a.dispatchEvent(b):b in(null!=a)?a[b]():"on"+b in(null!=a)?a["on"+b]():void 0},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]},a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.resetAnimation=f(this.resetAnimation,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),null!=a.scrollContainer&&(this.config.scrollContainer=document.querySelector(a.scrollContainer)),this.animationNameCache=new c,this.wowEvent=this.util().createEvent(this.config.boxClass)}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0,callback:null,scrollContainer:null},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],c=0,d=b.length;d>c;c++)f=b[c],g.push(function(){var a,b,c,d;for(c=f.addedNodes||[],d=[],a=0,b=c.length;b>a;a++)e=c[a],d.push(this.doSync(e));return d}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(this.config.scrollContainer||window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=a.className+" "+this.config.animateClass,null!=this.config.callback&&this.config.callback(a),this.util().emitEvent(a,this.wowEvent),this.util().addEvent(a,"animationend",this.resetAnimation),this.util().addEvent(a,"oanimationend",this.resetAnimation),this.util().addEvent(a,"webkitAnimationEnd",this.resetAnimation),this.util().addEvent(a,"MSAnimationEnd",this.resetAnimation),a},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.resetAnimation=function(a){var b;return a.type.toLowerCase().indexOf("animationend")>=0?(b=a.target||a.srcElement,b.className=b.className.replace(this.config.animateClass,"").trim()):void 0},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;d=[];for(c in b)e=b[c],a[""+c]=e,d.push(function(){var b,d,g,h;for(g=this.vendors,h=[],b=0,d=g.length;d>b;b++)f=g[b],h.push(a[""+f+c.charAt(0).toUpperCase()+c.substr(1)]=e);return h}.call(this));return d},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(h=d(a),g=h.getPropertyCSSValue(b),f=this.vendors,c=0,e=f.length;e>c;c++)i=f[c],g=g||h.getPropertyCSSValue("-"+i+"-"+b);return g},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=this.config.scrollContainer&&this.config.scrollContainer.scrollTop||window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this);
(function(jQuery){var domfocus=false;var mousefocus=false;var zoomactive=false;var tabindexcounter=5000;var ascrailcounter=2000;var globalmaxzindex=0;var $=jQuery;function getScriptPath(){var scripts=document.getElementsByTagName('script');var path=scripts[scripts.length-1].src.split('?')[0];return(path.split('/').length>0)?path.split('/').slice(0,-1).join('/')+'/':'';}
var scriptpath=getScriptPath();var vendors=['ms','moz','webkit','o'];var setAnimationFrame=window.requestAnimationFrame||false;var clearAnimationFrame=window.cancelAnimationFrame||false;if(!setAnimationFrame){for(var vx in vendors){var v=vendors[vx];if(!setAnimationFrame)setAnimationFrame=window[v+'RequestAnimationFrame'];if(!clearAnimationFrame)clearAnimationFrame=window[v+'CancelAnimationFrame']||window[v+'CancelRequestAnimationFrame'];}}
var clsMutationObserver=window.MutationObserver||window.WebKitMutationObserver||false;var _globaloptions={zindex:"30000",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:8*3,touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true,cursorminheight:32,preservenativescrolling:true,railoffset:false,bouncescroll:true,spacebarenabled:true,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:true,horizrailenabled:true,railalign:"right",railvalign:"bottom",enabletranslate3d:true,enablemousewheel:true,enablekeyboard:true,smoothscroll:true,sensitiverail:true,enablemouselockapi:true,cursorfixedheight:false,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:true,enablescrollonselection:true,overflowx:true,overflowy:true,cursordragspeed:0.3,rtlmode:false,cursordragontouch:false,oneaxismousemode:"auto"}
var browserdetected=false;var getBrowserDetection=function(){if(browserdetected)return browserdetected;var domtest=document.createElement('DIV');var d={};d.haspointerlock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document;d.isopera=("opera"in window);d.isopera12=(d.isopera&&("getUserMedia"in navigator));d.isoperamini=(Object.prototype.toString.call(window.operamini)==="[object OperaMini]");d.isie=(("all"in document)&&("attachEvent"in domtest)&&!d.isopera);d.isieold=(d.isie&&!("msInterpolationMode"in domtest.style));d.isie7=d.isie&&!d.isieold&&(!("documentMode"in document)||(document.documentMode==7));d.isie8=d.isie&&("documentMode"in document)&&(document.documentMode==8);d.isie9=d.isie&&("performance"in window)&&(document.documentMode>=9);d.isie10=d.isie&&("performance"in window)&&(document.documentMode>=10);d.isie9mobile=/iemobile.9/i.test(navigator.userAgent);if(d.isie9mobile)d.isie9=false;d.isie7mobile=(!d.isie9mobile&&d.isie7)&&/iemobile/i.test(navigator.userAgent);d.ismozilla=("MozAppearance"in domtest.style);d.iswebkit=("WebkitAppearance"in domtest.style);d.ischrome=("chrome"in window);d.ischrome22=(d.ischrome&&d.haspointerlock);d.ischrome26=(d.ischrome&&("transition"in domtest.style));d.cantouch=("ontouchstart"in document.documentElement)||("ontouchstart"in window);d.hasmstouch=(window.navigator.msPointerEnabled||false);d.ismac=/^mac$/i.test(navigator.platform);d.isios=(d.cantouch&&/iphone|ipad|ipod/i.test(navigator.platform));d.isios4=((d.isios)&&!("seal"in Object));d.isandroid=(/android/i.test(navigator.userAgent));d.trstyle=false;d.hastransform=false;d.hastranslate3d=false;d.transitionstyle=false;d.hastransition=false;d.transitionend=false;var check=['transform','msTransform','webkitTransform','MozTransform','OTransform'];for(var a=0;anw&&!dd.tt){self.delaylist[name]={last:nw+tm,tt:setTimeout(function(){self.delaylist[name].tt=0;fn.call();},tm)}}
else if(!dd||!dd.tt){self.delaylist[name]={last:nw,tt:0}
setTimeout(function(){fn.call();},0);}};this.debounced=function(name,fn,tm){var dd=self.delaylist[name];var nw=(new Date()).getTime();self.delaylist[name]=fn;if(!dd){setTimeout(function(){var fn=self.delaylist[name];self.delaylist[name]=false;fn.call();},tm);}}
this.synched=function(name,fn){function requestSync(){if(self.onsync)return;setAnimationFrame(function(){self.onsync=false;for(name in self.synclist){var fn=self.synclist[name];if(fn)fn.call(self);self.synclist[name]=false;}});self.onsync=true;};self.synclist[name]=fn;requestSync();return name;};this.unsynched=function(name){if(self.synclist[name])self.synclist[name]=false;}
this.css=function(el,pars){for(var n in pars){self.saved.css.push([el,n,el.css(n)]);el.css(n,pars[n]);}};this.scrollTop=function(val){return(typeof val=="undefined")?self.getScrollTop():self.setScrollTop(val);};this.scrollLeft=function(val){return(typeof val=="undefined")?self.getScrollLeft():self.setScrollLeft(val);};BezierClass=function(st,ed,spd,p1,p2,p3,p4){this.st=st;this.ed=ed;this.spd=spd;this.p1=p1||0;this.p2=p2||1;this.p3=p3||0;this.p4=p4||1;this.ts=(new Date()).getTime();this.df=this.ed-this.st;};BezierClass.prototype={B2:function(t){return 3*t*t*(1-t)},B3:function(t){return 3*t*(1-t)*(1-t)},B4:function(t){return(1-t)*(1-t)*(1-t)},getNow:function(){var nw=(new Date()).getTime();var pc=1-((nw-this.ts)/this.spd);var bz=this.B2(pc)+this.B3(pc)+this.B4(pc);return(pc<0)?this.ed:this.st+Math.round(this.df*bz);},update:function(ed,spd){this.st=this.getNow();this.ed=ed;this.spd=spd;this.ts=(new Date()).getTime();this.df=this.ed-this.st;return this;}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};if(cap.hastranslate3d&&cap.isios)this.doc.css("-webkit-backface-visibility","hidden");function getMatrixValues(){var tr=self.doc.css(cap.trstyle);if(tr&&(tr.substr(0,6)=="matrix")){return tr.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,'').split(/, +/);}
return false;}
this.getScrollTop=function(last){if(!last){var mtx=getMatrixValues();if(mtx)return(mtx.length==16)?-mtx[13]:-mtx[5];if(self.timerscroll&&self.timerscroll.bz)return self.timerscroll.bz.getNow();}
return self.doc.translate.y;};this.getScrollLeft=function(last){if(!last){var mtx=getMatrixValues();if(mtx)return(mtx.length==16)?-mtx[12]:-mtx[4];if(self.timerscroll&&self.timerscroll.bh)return self.timerscroll.bh.getNow();}
return self.doc.translate.x;};if(document.createEvent){this.notifyScrollEvent=function(el){var e=document.createEvent("UIEvents");e.initUIEvent("scroll",false,true,window,1);el.dispatchEvent(e);};}
else if(document.fireEvent){this.notifyScrollEvent=function(el){var e=document.createEventObject();el.fireEvent("onscroll");e.cancelBubble=true;};}
else{this.notifyScrollEvent=function(el,add){};}
if(cap.hastranslate3d&&self.opt.enabletranslate3d){this.setScrollTop=function(val,silent){self.doc.translate.y=val;self.doc.translate.ty=(val*-1)+"px";self.doc.css(cap.trstyle,"translate3d("+self.doc.translate.tx+","+self.doc.translate.ty+",0px)");if(!silent)self.notifyScrollEvent(self.win[0]);};this.setScrollLeft=function(val,silent){self.doc.translate.x=val;self.doc.translate.tx=(val*-1)+"px";self.doc.css(cap.trstyle,"translate3d("+self.doc.translate.tx+","+self.doc.translate.ty+",0px)");if(!silent)self.notifyScrollEvent(self.win[0]);};}else{this.setScrollTop=function(val,silent){self.doc.translate.y=val;self.doc.translate.ty=(val*-1)+"px";self.doc.css(cap.trstyle,"translate("+self.doc.translate.tx+","+self.doc.translate.ty+")");if(!silent)self.notifyScrollEvent(self.win[0]);};this.setScrollLeft=function(val,silent){self.doc.translate.x=val;self.doc.translate.tx=(val*-1)+"px";self.doc.css(cap.trstyle,"translate("+self.doc.translate.tx+","+self.doc.translate.ty+")");if(!silent)self.notifyScrollEvent(self.win[0]);};}}else{this.getScrollTop=function(){return self.docscroll.scrollTop();};this.setScrollTop=function(val){return self.docscroll.scrollTop(val);};this.getScrollLeft=function(){return self.docscroll.scrollLeft();};this.setScrollLeft=function(val){return self.docscroll.scrollLeft(val);};}
this.getTarget=function(e){if(!e)return false;if(e.target)return e.target;if(e.srcElement)return e.srcElement;return false;};this.hasParent=function(e,id){if(!e)return false;var el=e.target||e.srcElement||e||false;while(el&&el.id!=id){el=el.parentNode||false;}
return(el!==false);};function getZIndex(){var dom=self.win;if("zIndex"in dom)return dom.zIndex();while(dom.length>0){if(dom[0].nodeType==9)return false;var zi=dom.css('zIndex');if(!isNaN(zi)&&zi!=0)return parseInt(zi);dom=dom.parent();}
return false;};var _convertBorderWidth={"thin":1,"medium":3,"thick":5};function getWidthToPixel(dom,prop,chkheight){var wd=dom.css(prop);var px=parseFloat(wd);if(isNaN(px)){px=_convertBorderWidth[wd]||0;var brd=(px==3)?((chkheight)?(self.win.outerHeight()-self.win.innerHeight()):(self.win.outerWidth()-self.win.innerWidth())):1;if(self.isie8&&px)px+=1;return(brd)?px:0;}
return px;};this.getOffset=function(){if(self.isfixed)return{top:parseFloat(self.win.css('top')),left:parseFloat(self.win.css('left'))};if(!self.viewport)return self.win.offset();var ww=self.win.offset();var vp=self.viewport.offset();return{top:ww.top-vp.top+self.viewport.scrollTop(),left:ww.left-vp.left+self.viewport.scrollLeft()};};this.updateScrollBar=function(len){if(self.ishwscroll){self.rail.css({height:self.win.innerHeight()});if(self.railh)self.railh.css({width:self.win.innerWidth()});}else{var wpos=self.getOffset();var pos={top:wpos.top,left:wpos.left};pos.top+=getWidthToPixel(self.win,'border-top-width',true);var brd=(self.win.outerWidth()-self.win.innerWidth())/2;pos.left+=(self.rail.align)?self.win.outerWidth()-getWidthToPixel(self.win,'border-right-width')-self.rail.width:getWidthToPixel(self.win,'border-left-width');var off=self.opt.railoffset;if(off){if(off.top)pos.top+=off.top;if(self.rail.align&&off.left)pos.left+=off.left;}
if(!self.locked)self.rail.css({top:pos.top,left:pos.left,height:(len)?len.h:self.win.innerHeight()});if(self.zoom){self.zoom.css({top:pos.top+1,left:(self.rail.align==1)?pos.left-20:pos.left+self.rail.width+4});}
if(self.railh&&!self.locked){var pos={top:wpos.top,left:wpos.left};var y=(self.railh.align)?pos.top+getWidthToPixel(self.win,'border-top-width',true)+self.win.innerHeight()-self.railh.height:pos.top+getWidthToPixel(self.win,'border-top-width',true);var x=pos.left+getWidthToPixel(self.win,'border-left-width');self.railh.css({top:y,left:x,width:self.railh.width});}}};this.doRailClick=function(e,dbl,hr){var fn,pg,cur,pos;if(self.locked)return;self.cancelEvent(e);if(dbl){fn=(hr)?self.doScrollLeft:self.doScrollTop;cur=(hr)?((e.pageX-self.railh.offset().left-(self.cursorwidth/2))*self.scrollratio.x):((e.pageY-self.rail.offset().top-(self.cursorheight/2))*self.scrollratio.y);fn(cur);}else{fn=(hr)?self.doScrollLeftBy:self.doScrollBy;cur=(hr)?self.scroll.x:self.scroll.y;pos=(hr)?e.pageX-self.railh.offset().left:e.pageY-self.rail.offset().top;pg=(hr)?self.view.w:self.view.h;(cur>=pos)?fn(pg):fn(-pg);}}
self.hasanimationframe=(setAnimationFrame);self.hascancelanimationframe=(clearAnimationFrame);if(!self.hasanimationframe){setAnimationFrame=function(fn){return setTimeout(fn,15-Math.floor((+new Date)/1000)%16)};clearAnimationFrame=clearInterval;}
else if(!self.hascancelanimationframe)clearAnimationFrame=function(){self.cancelAnimationFrame=true};this.init=function(){self.saved.css=[];if(cap.isie7mobile)return true;if(cap.isoperamini)return true;if(cap.hasmstouch)self.css((self.ispage)?$("html"):self.win,{'-ms-touch-action':'none'});self.zindex="auto";if(!self.ispage&&self.opt.zindex=="auto"){self.zindex=getZIndex()||"auto";}else{self.zindex=self.opt.zindex;}
if(!self.ispage&&self.zindex!="auto"){if(self.zindex>globalmaxzindex)globalmaxzindex=self.zindex;}
if(self.isie&&self.zindex==0&&self.opt.zindex=="auto"){self.zindex="auto";}
if(!self.ispage||(!cap.cantouch&&!cap.isieold&&!cap.isie9mobile)){var cont=self.docscroll;if(self.ispage)cont=(self.haswrapper)?self.win:self.doc;if(!cap.isie9mobile)self.css(cont,{'overflow-y':'hidden'});if(self.ispage&&cap.isie7){if(self.doc[0].nodeName=='BODY')self.css($("html"),{'overflow-y':'hidden'});else if(self.doc[0].nodeName=='HTML')self.css($("body"),{'overflow-y':'hidden'});}
if(cap.isios&&!self.ispage&&!self.haswrapper)self.css($("body"),{"-webkit-overflow-scrolling":"touch"});var cursor=$(document.createElement('div'));cursor.css({position:"relative",top:0,"float":"right",width:self.opt.cursorwidth,height:"0px",'background-color':self.opt.cursorcolor,border:self.opt.cursorborder,'background-clip':'padding-box','-webkit-border-radius':self.opt.cursorborderradius,'-moz-border-radius':self.opt.cursorborderradius,'border-radius':self.opt.cursorborderradius});cursor.hborder=parseFloat(cursor.outerHeight()-cursor.innerHeight());self.cursor=cursor;var rail=$(document.createElement('div'));rail.attr('id',self.id);rail.addClass('nicescroll-rails');var v,a,kp=["left","right"];for(var n in kp){a=kp[n];v=self.opt.railpadding[a];(v)?rail.css("padding-"+a,v+"px"):self.opt.railpadding[a]=0;}
rail.append(cursor);rail.width=Math.max(parseFloat(self.opt.cursorwidth),cursor.outerWidth())+self.opt.railpadding['left']+self.opt.railpadding['right'];rail.css({width:rail.width+"px",'zIndex':self.zindex,"background":self.opt.background,cursor:"default"});rail.visibility=true;rail.scrollable=true;rail.align=(self.opt.railalign=="left")?0:1;self.rail=rail;self.rail.drag=false;var zoom=false;if(self.opt.boxzoom&&!self.ispage&&!cap.isieold){zoom=document.createElement('div');self.bind(zoom,"click",self.doZoom);self.zoom=$(zoom);self.zoom.css({"cursor":"pointer",'z-index':self.zindex,'backgroundImage':'url('+scriptpath+'zoomico.png)','height':18,'width':18,'backgroundPosition':'0px 0px'});if(self.opt.dblclickzoom)self.bind(self.win,"dblclick",self.doZoom);if(cap.cantouch&&self.opt.gesturezoom){self.ongesturezoom=function(e){if(e.scale>1.5)self.doZoomIn(e);if(e.scale<0.8)self.doZoomOut(e);return self.cancelEvent(e);};self.bind(self.win,"gestureend",self.ongesturezoom);}}
self.railh=false;if(self.opt.horizrailenabled){self.css(cont,{'overflow-x':'hidden'});var cursor=$(document.createElement('div'));cursor.css({position:"relative",top:0,height:self.opt.cursorwidth,width:"0px",'background-color':self.opt.cursorcolor,border:self.opt.cursorborder,'background-clip':'padding-box','-webkit-border-radius':self.opt.cursorborderradius,'-moz-border-radius':self.opt.cursorborderradius,'border-radius':self.opt.cursorborderradius});cursor.wborder=parseFloat(cursor.outerWidth()-cursor.innerWidth());self.cursorh=cursor;var railh=$(document.createElement('div'));railh.attr('id',self.id+'-hr');railh.addClass('nicescroll-rails');railh.height=Math.max(parseFloat(self.opt.cursorwidth),cursor.outerHeight());railh.css({height:railh.height+"px",'zIndex':self.zindex,"background":self.opt.background});railh.append(cursor);railh.visibility=true;railh.scrollable=true;railh.align=(self.opt.railvalign=="top")?0:1;self.railh=railh;self.railh.drag=false;}
if(self.ispage){rail.css({position:"fixed",top:"0px",height:"100%"});(rail.align)?rail.css({right:"0px"}):rail.css({left:"0px"});self.body.append(rail);if(self.railh){railh.css({position:"fixed",left:"0px",width:"100%"});(railh.align)?railh.css({bottom:"0px"}):railh.css({top:"0px"});self.body.append(railh);}}else{if(self.ishwscroll){if(self.win.css('position')=='static')self.css(self.win,{'position':'relative'});var bd=(self.win[0].nodeName=='HTML')?self.body:self.win;if(self.zoom){self.zoom.css({position:"absolute",top:1,right:0,"margin-right":rail.width+4});bd.append(self.zoom);}
rail.css({position:"absolute",top:0});(rail.align)?rail.css({right:0}):rail.css({left:0});bd.append(rail);if(railh){railh.css({position:"absolute",left:0,bottom:0});(railh.align)?railh.css({bottom:0}):railh.css({top:0});bd.append(railh);}}else{self.isfixed=(self.win.css("position")=="fixed");var rlpos=(self.isfixed)?"fixed":"absolute";if(!self.isfixed)self.viewport=self.getViewport(self.win[0]);if(self.viewport){self.body=self.viewport;if((/relative|absolute/.test(self.viewport.css("position")))==false)self.css(self.viewport,{"position":"relative"});}
rail.css({position:rlpos});if(self.zoom)self.zoom.css({position:rlpos});self.updateScrollBar();self.body.append(rail);if(self.zoom)self.body.append(self.zoom);if(self.railh){railh.css({position:rlpos});self.body.append(railh);}}
if(cap.isios)self.css(self.win,{'-webkit-tap-highlight-color':'rgba(0,0,0,0)','-webkit-touch-callout':'none'});if(cap.isie&&self.opt.disableoutline)self.win.attr("hideFocus","true");if(cap.iswebkit&&self.opt.disableoutline)self.win.css({"outline":"none"});}
if(self.opt.autohidemode===false){self.autohidedom=false;self.rail.css({opacity:self.opt.cursoropacitymax});if(self.railh)self.railh.css({opacity:self.opt.cursoropacitymax});}
else if(self.opt.autohidemode===true){self.autohidedom=$().add(self.rail);if(cap.isie8)self.autohidedom=self.autohidedom.add(self.cursor);if(self.railh)self.autohidedom=self.autohidedom.add(self.railh);if(self.railh&&cap.isie8)self.autohidedom=self.autohidedom.add(self.cursorh);}
else if(self.opt.autohidemode=="scroll"){self.autohidedom=$().add(self.rail);if(self.railh)self.autohidedom=self.autohidedom.add(self.railh);}
else if(self.opt.autohidemode=="cursor"){self.autohidedom=$().add(self.cursor);if(self.railh)self.autohidedom=self.autohidedom.add(self.cursorh);}
else if(self.opt.autohidemode=="hidden"){self.autohidedom=false;self.hide();self.locked=false;}
if(cap.isie9mobile){self.scrollmom=new ScrollMomentumClass2D(self);self.onmangotouch=function(e){var py=self.getScrollTop();var px=self.getScrollLeft();if((py==self.scrollmom.lastscrolly)&&(px==self.scrollmom.lastscrollx))return true;var dfy=py-self.mangotouch.sy;var dfx=px-self.mangotouch.sx;var df=Math.round(Math.sqrt(Math.pow(dfx,2)+Math.pow(dfy,2)));if(df==0)return;var dry=(dfy<0)?-1:1;var drx=(dfx<0)?-1:1;var tm=+new Date();if(self.mangotouch.lazy)clearTimeout(self.mangotouch.lazy);if(((tm-self.mangotouch.tm)>80)||(self.mangotouch.dry!=dry)||(self.mangotouch.drx!=drx)){self.scrollmom.stop();self.scrollmom.reset(px,py);self.mangotouch.sy=py;self.mangotouch.ly=py;self.mangotouch.sx=px;self.mangotouch.lx=px;self.mangotouch.dry=dry;self.mangotouch.drx=drx;self.mangotouch.tm=tm;}else{self.scrollmom.stop();self.scrollmom.update(self.mangotouch.sx-dfx,self.mangotouch.sy-dfy);var gap=tm-self.mangotouch.tm;self.mangotouch.tm=tm;var ds=Math.max(Math.abs(self.mangotouch.ly-py),Math.abs(self.mangotouch.lx-px));self.mangotouch.ly=py;self.mangotouch.lx=px;if(ds>2){self.mangotouch.lazy=setTimeout(function(){self.mangotouch.lazy=false;self.mangotouch.dry=0;self.mangotouch.drx=0;self.mangotouch.tm=0;self.scrollmom.doMomentum(30);},100);}}}
var top=self.getScrollTop();var lef=self.getScrollLeft();self.mangotouch={sy:top,ly:top,dry:0,sx:lef,lx:lef,drx:0,lazy:false,tm:0};self.bind(self.docscroll,"scroll",self.onmangotouch);}else{if(cap.cantouch||self.istouchcapable||self.opt.touchbehavior||cap.hasmstouch){self.scrollmom=new ScrollMomentumClass2D(self);self.ontouchstart=function(e){if(e.pointerType&&e.pointerType!=2)return false;if(!self.locked){if(cap.hasmstouch){var tg=(e.target)?e.target:false;while(tg){var nc=$(tg).getNiceScroll();if((nc.length>0)&&(nc[0].me==self.me))break;if(nc.length>0)return false;if((tg.nodeName=='DIV')&&(tg.id==self.id))break;tg=(tg.parentNode)?tg.parentNode:false;}}
self.cancelScroll();var tg=self.getTarget(e);if(tg){var skp=(/INPUT/i.test(tg.nodeName))&&(/range/i.test(tg.type));if(skp)return self.stopPropagation(e);}
if(!("clientX"in e)&&("changedTouches"in e)){e.clientX=e.changedTouches[0].clientX;e.clientY=e.changedTouches[0].clientY;}
if(self.forcescreen){var le=e;var e={"original":(e.original)?e.original:e};e.clientX=le.screenX;e.clientY=le.screenY;}
self.rail.drag={x:e.clientX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop(),sl:self.getScrollLeft(),pt:2,dl:false};if(self.ispage||!self.opt.directionlockdeadzone){self.rail.drag.dl="f";}else{var view={w:$(window).width(),h:$(window).height()};var page={w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}
var maxh=Math.max(0,page.h-view.h);var maxw=Math.max(0,page.w-view.w);if(!self.rail.scrollable&&self.railh.scrollable)self.rail.drag.ck=(maxh>0)?"v":false;else if(self.rail.scrollable&&!self.railh.scrollable)self.rail.drag.ck=(maxw>0)?"h":false;else self.rail.drag.ck=false;if(!self.rail.drag.ck)self.rail.drag.dl="f";}
if(self.opt.touchbehavior&&self.isiframe&&cap.isie){var wp=self.win.position();self.rail.drag.x+=wp.left;self.rail.drag.y+=wp.top;}
self.hasmoving=false;self.lastmouseup=false;self.scrollmom.reset(e.clientX,e.clientY);if(!cap.cantouch&&!this.istouchcapable&&!cap.hasmstouch){var ip=(tg)?/INPUT|SELECT|TEXTAREA/i.test(tg.nodeName):false;if(!ip){if(!self.ispage&&cap.hasmousecapture)tg.setCapture();return(self.opt.touchbehavior)?self.cancelEvent(e):self.stopPropagation(e);}
if(/SUBMIT|CANCEL|BUTTON/i.test($(tg).attr('type'))){pc={"tg":tg,"click":false};self.preventclick=pc;}}}};self.ontouchend=function(e){if(e.pointerType&&e.pointerType!=2)return false;if(self.rail.drag&&(self.rail.drag.pt==2)){self.scrollmom.doMomentum();self.rail.drag=false;if(self.hasmoving){self.hasmoving=false;self.lastmouseup=true;self.hideCursor();if(cap.hasmousecapture)document.releaseCapture();if(!cap.cantouch)return self.cancelEvent(e);}}};var moveneedoffset=(self.opt.touchbehavior&&self.isiframe&&!cap.hasmousecapture);self.ontouchmove=function(e,byiframe){if(e.pointerType&&e.pointerType!=2)return false;if(self.rail.drag&&(self.rail.drag.pt==2)){if(cap.cantouch&&(typeof e.original=="undefined"))return true;self.hasmoving=true;if(self.preventclick&&!self.preventclick.click){self.preventclick.click=self.preventclick.tg.onclick||false;self.preventclick.tg.onclick=self.onpreventclick;}
var ev=$.extend({"original":e},e);e=ev;if(("changedTouches"in e)){e.clientX=e.changedTouches[0].clientX;e.clientY=e.changedTouches[0].clientY;}
if(self.forcescreen){var le=e;var e={"original":(e.original)?e.original:e};e.clientX=le.screenX;e.clientY=le.screenY;}
var ofx=ofy=0;if(moveneedoffset&&!byiframe){var wp=self.win.position();ofx=-wp.left;ofy=-wp.top;}
var fy=e.clientY+ofy;var my=(fy-self.rail.drag.y);var fx=e.clientX+ofx;var mx=(fx-self.rail.drag.x);var ny=self.rail.drag.st-my;if(self.ishwscroll&&self.opt.bouncescroll){if(ny<0){ny=Math.round(ny/2);}
else if(ny>self.page.maxh){ny=self.page.maxh+Math.round((ny-self.page.maxh)/2);}}else{if(ny<0){ny=0;fy=0}
if(ny>self.page.maxh){ny=self.page.maxh;fy=0}}
if(self.railh&&self.railh.scrollable){var nx=self.rail.drag.sl-mx;if(self.ishwscroll&&self.opt.bouncescroll){if(nx<0){nx=Math.round(nx/2);}
else if(nx>self.page.maxw){nx=self.page.maxw+Math.round((nx-self.page.maxw)/2);}}else{if(nx<0){nx=0;fx=0}
if(nx>self.page.maxw){nx=self.page.maxw;fx=0}}}
var grabbed=false;if(self.rail.drag.dl){grabbed=true;if(self.rail.drag.dl=="v")nx=self.rail.drag.sl;else if(self.rail.drag.dl=="h")ny=self.rail.drag.st;}else{var ay=Math.abs(my);var ax=Math.abs(mx);var dz=self.opt.directionlockdeadzone;if(self.rail.drag.ck=="v"){if(ay>dz&&(ax<=(ay*0.3))){self.rail.drag=false;return true;}
else if(ax>dz){self.rail.drag.dl="f";$("body").scrollTop($("body").scrollTop());}}
else if(self.rail.drag.ck=="h"){if(ax>dz&&(ay<=(ax*0.3))){self.rail.drag=false;return true;}
else if(ay>dz){self.rail.drag.dl="f";$("body").scrollLeft($("body").scrollLeft());}}}
self.synched("touchmove",function(){if(self.rail.drag&&(self.rail.drag.pt==2)){if(self.prepareTransition)self.prepareTransition(0);if(self.rail.scrollable)self.setScrollTop(ny);self.scrollmom.update(fx,fy);if(self.railh&&self.railh.scrollable){self.setScrollLeft(nx);self.showCursor(ny,nx);}else{self.showCursor(ny);}
if(cap.isie10)document.selection.clear();}});if(cap.ischrome&&self.istouchcapable)grabbed=false;if(grabbed)return self.cancelEvent(e);}};}
self.onmousedown=function(e,hronly){if(self.rail.drag&&self.rail.drag.pt!=1)return;if(self.locked)return self.cancelEvent(e);self.cancelScroll();self.rail.drag={x:e.clientX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y,pt:1,hr:(!!hronly)};var tg=self.getTarget(e);if(!self.ispage&&cap.hasmousecapture)tg.setCapture();if(self.isiframe&&!cap.hasmousecapture){self.saved["csspointerevents"]=self.doc.css("pointer-events");self.css(self.doc,{"pointer-events":"none"});}
return self.cancelEvent(e);};self.onmouseup=function(e){if(self.rail.drag){if(cap.hasmousecapture)document.releaseCapture();if(self.isiframe&&!cap.hasmousecapture)self.doc.css("pointer-events",self.saved["csspointerevents"]);if(self.rail.drag.pt!=1)return;self.rail.drag=false;return self.cancelEvent(e);}};self.onmousemove=function(e){if(self.rail.drag){if(self.rail.drag.pt!=1)return;if(cap.ischrome&&e.which==0)return self.onmouseup(e);self.cursorfreezed=true;if(self.rail.drag.hr){self.scroll.x=self.rail.drag.sx+(e.clientX-self.rail.drag.x);if(self.scroll.x<0)self.scroll.x=0;var mw=self.scrollvaluemaxw;if(self.scroll.x>mw)self.scroll.x=mw;}else{self.scroll.y=self.rail.drag.sy+(e.clientY-self.rail.drag.y);if(self.scroll.y<0)self.scroll.y=0;var my=self.scrollvaluemax;if(self.scroll.y>my)self.scroll.y=my;}
self.synched('mousemove',function(){if(self.rail.drag&&(self.rail.drag.pt==1)){self.showCursor();if(self.rail.drag.hr)self.doScrollLeft(Math.round(self.scroll.x*self.scrollratio.x),self.opt.cursordragspeed);else self.doScrollTop(Math.round(self.scroll.y*self.scrollratio.y),self.opt.cursordragspeed);}});return self.cancelEvent(e);}};if(cap.cantouch||self.opt.touchbehavior){self.onpreventclick=function(e){if(self.preventclick){self.preventclick.tg.onclick=self.preventclick.click;self.preventclick=false;return self.cancelEvent(e);}}
self.bind(self.win,"mousedown",self.ontouchstart);self.onclick=(cap.isios)?false:function(e){if(self.lastmouseup){self.lastmouseup=false;return self.cancelEvent(e);}else{return true;}};if(self.opt.grabcursorenabled&&cap.cursorgrabvalue){self.css((self.ispage)?self.doc:self.win,{'cursor':cap.cursorgrabvalue});self.css(self.rail,{'cursor':cap.cursorgrabvalue});}}else{function checkSelectionScroll(e){if(!self.selectiondrag)return;if(e){var ww=self.win.outerHeight();var df=(e.pageY-self.selectiondrag.top);if(df>0&&df=ww)df-=ww;self.selectiondrag.df=df;}
if(self.selectiondrag.df==0)return;var rt=-Math.floor(self.selectiondrag.df/6)*2;self.doScrollBy(rt);self.debounced("doselectionscroll",function(){checkSelectionScroll()},50);}
if("getSelection"in document){self.hasTextSelected=function(){return(document.getSelection().rangeCount>0);}}
else if("selection"in document){self.hasTextSelected=function(){return(document.selection.type!="None");}}
else{self.hasTextSelected=function(){return false;}}
self.onselectionstart=function(e){if(self.ispage)return;self.selectiondrag=self.win.offset();}
self.onselectionend=function(e){self.selectiondrag=false;}
self.onselectiondrag=function(e){if(!self.selectiondrag)return;if(self.hasTextSelected())self.debounced("selectionscroll",function(){checkSelectionScroll(e)},250);}}
if(cap.hasmstouch){self.css(self.rail,{'-ms-touch-action':'none'});self.css(self.cursor,{'-ms-touch-action':'none'});self.bind(self.win,"MSPointerDown",self.ontouchstart);self.bind(document,"MSPointerUp",self.ontouchend);self.bind(document,"MSPointerMove",self.ontouchmove);self.bind(self.cursor,"MSGestureHold",function(e){e.preventDefault()});self.bind(self.cursor,"contextmenu",function(e){e.preventDefault()});}
if(this.istouchcapable){self.bind(self.win,"touchstart",self.ontouchstart);self.bind(document,"touchend",self.ontouchend);self.bind(document,"touchcancel",self.ontouchend);self.bind(document,"touchmove",self.ontouchmove);}
self.bind(self.cursor,"mousedown",self.onmousedown);self.bind(self.cursor,"mouseup",self.onmouseup);if(self.railh){self.bind(self.cursorh,"mousedown",function(e){self.onmousedown(e,true)});self.bind(self.cursorh,"mouseup",function(e){if(self.rail.drag&&self.rail.drag.pt==2)return;self.rail.drag=false;self.hasmoving=false;self.hideCursor();if(cap.hasmousecapture)document.releaseCapture();return self.cancelEvent(e);});}
if(self.opt.cursordragontouch||!cap.cantouch&&!self.opt.touchbehavior){self.rail.css({"cursor":"default"});self.railh&&self.railh.css({"cursor":"default"});self.jqbind(self.rail,"mouseenter",function(){if(self.canshowonmouseevent)self.showCursor();self.rail.active=true;});self.jqbind(self.rail,"mouseleave",function(){self.rail.active=false;if(!self.rail.drag)self.hideCursor();});if(self.opt.sensitiverail){self.bind(self.rail,"click",function(e){self.doRailClick(e,false,false)});self.bind(self.rail,"dblclick",function(e){self.doRailClick(e,true,false)});self.bind(self.cursor,"click",function(e){self.cancelEvent(e)});self.bind(self.cursor,"dblclick",function(e){self.cancelEvent(e)});}
if(self.railh){self.jqbind(self.railh,"mouseenter",function(){if(self.canshowonmouseevent)self.showCursor();self.rail.active=true;});self.jqbind(self.railh,"mouseleave",function(){self.rail.active=false;if(!self.rail.drag)self.hideCursor();});if(self.opt.sensitiverail){self.bind(self.railh,"click",function(e){self.doRailClick(e,false,true)});self.bind(self.railh,"dblclick",function(e){self.doRailClick(e,true,true)});self.bind(self.cursorh,"click",function(e){self.cancelEvent(e)});self.bind(self.cursorh,"dblclick",function(e){self.cancelEvent(e)});}}}
if(!cap.cantouch&&!self.opt.touchbehavior){self.bind((cap.hasmousecapture)?self.win:document,"mouseup",self.onmouseup);self.bind(document,"mousemove",self.onmousemove);if(self.onclick)self.bind(document,"click",self.onclick);if(!self.ispage&&self.opt.enablescrollonselection){self.bind(self.win[0],"mousedown",self.onselectionstart);self.bind(document,"mouseup",self.onselectionend);self.bind(self.cursor,"mouseup",self.onselectionend);if(self.cursorh)self.bind(self.cursorh,"mouseup",self.onselectionend);self.bind(document,"mousemove",self.onselectiondrag);}
if(self.zoom){self.jqbind(self.zoom,"mouseenter",function(){if(self.canshowonmouseevent)self.showCursor();self.rail.active=true;});self.jqbind(self.zoom,"mouseleave",function(){self.rail.active=false;if(!self.rail.drag)self.hideCursor();});}}else{self.bind((cap.hasmousecapture)?self.win:document,"mouseup",self.ontouchend);self.bind(document,"mousemove",self.ontouchmove);if(self.onclick)self.bind(document,"click",self.onclick);if(self.opt.cursordragontouch){self.bind(self.cursor,"mousedown",self.onmousedown);self.bind(self.cursor,"mousemove",self.onmousemove);self.cursorh&&self.bind(self.cursorh,"mousedown",self.onmousedown);self.cursorh&&self.bind(self.cursorh,"mousemove",self.onmousemove);}}
if(self.opt.enablemousewheel){if(!self.isiframe)self.bind((cap.isie&&self.ispage)?document:self.win,"mousewheel",self.onmousewheel);self.bind(self.rail,"mousewheel",self.onmousewheel);if(self.railh)self.bind(self.railh,"mousewheel",self.onmousewheelhr);}
if(!self.ispage&&!cap.cantouch&&!(/HTML|BODY/.test(self.win[0].nodeName))){if(!self.win.attr("tabindex"))self.win.attr({"tabindex":tabindexcounter++});self.jqbind(self.win,"focus",function(e){domfocus=(self.getTarget(e)).id||true;self.hasfocus=true;if(self.canshowonmouseevent)self.noticeCursor();});self.jqbind(self.win,"blur",function(e){domfocus=false;self.hasfocus=false;});self.jqbind(self.win,"mouseenter",function(e){mousefocus=(self.getTarget(e)).id||true;self.hasmousefocus=true;if(self.canshowonmouseevent)self.noticeCursor();});self.jqbind(self.win,"mouseleave",function(){mousefocus=false;self.hasmousefocus=false;});};}
self.onkeypress=function(e){if(self.locked&&self.page.maxh==0)return true;e=(e)?e:window.e;var tg=self.getTarget(e);if(tg&&/INPUT|TEXTAREA|SELECT|OPTION/.test(tg.nodeName)){var tp=tg.getAttribute('type')||tg.type||false;if((!tp)||!(/submit|button|cancel/i.tp))return true;}
if(self.hasfocus||(self.hasmousefocus&&!domfocus)||(self.ispage&&!domfocus&&!mousefocus)){var key=e.keyCode;if(self.locked&&key!=27)return self.cancelEvent(e);var ctrl=e.ctrlKey||false;var shift=e.shiftKey||false;var ret=false;switch(key){case 38:case 63233:self.doScrollBy(24*3);ret=true;break;case 40:case 63235:self.doScrollBy(-24*3);ret=true;break;case 37:case 63232:if(self.railh){(ctrl)?self.doScrollLeft(0):self.doScrollLeftBy(24*3);ret=true;}
break;case 39:case 63234:if(self.railh){(ctrl)?self.doScrollLeft(self.page.maxw):self.doScrollLeftBy(-24*3);ret=true;}
break;case 33:case 63276:self.doScrollBy(self.view.h);ret=true;break;case 34:case 63277:self.doScrollBy(-self.view.h);ret=true;break;case 36:case 63273:(self.railh&&ctrl)?self.doScrollPos(0,0):self.doScrollTo(0);ret=true;break;case 35:case 63275:(self.railh&&ctrl)?self.doScrollPos(self.page.maxw,self.page.maxh):self.doScrollTo(self.page.maxh);ret=true;break;case 32:if(self.opt.spacebarenabled){(shift)?self.doScrollBy(self.view.h):self.doScrollBy(-self.view.h);ret=true;}
break;case 27:if(self.zoomactive){self.doZoom();ret=true;}
break;}
if(ret)return self.cancelEvent(e);}};if(self.opt.enablekeyboard)self.bind(document,(cap.isopera&&!cap.isopera12)?"keypress":"keydown",self.onkeypress);self.bind(window,'resize',self.lazyResize);self.bind(window,'orientationchange',self.lazyResize);self.bind(window,"load",self.lazyResize);if(cap.ischrome&&!self.ispage&&!self.haswrapper){var tmp=self.win.attr("style");var ww=parseFloat(self.win.css("width"))+1;self.win.css('width',ww);self.synched("chromefix",function(){self.win.attr("style",tmp)});}
self.onAttributeChange=function(e){self.lazyResize(250);}
if(!self.ispage&&!self.haswrapper){if(clsMutationObserver!==false){self.observer=new clsMutationObserver(function(mutations){mutations.forEach(self.onAttributeChange);});self.observer.observe(self.win[0],{childList:true,characterData:false,attributes:true,subtree:false});self.observerremover=new clsMutationObserver(function(mutations){mutations.forEach(function(mo){if(mo.removedNodes.length>0){for(var dd in mo.removedNodes){if(mo.removedNodes[dd]==self.win[0])return self.remove();}}});});self.observerremover.observe(self.win[0].parentNode,{childList:true,characterData:false,attributes:false,subtree:false});}else{self.bind(self.win,(cap.isie&&!cap.isie9)?"propertychange":"DOMAttrModified",self.onAttributeChange);if(cap.isie9)self.win[0].attachEvent("onpropertychange",self.onAttributeChange);self.bind(self.win,"DOMNodeRemoved",function(e){if(e.target==self.win[0])self.remove();});}}
if(!self.ispage&&self.opt.boxzoom)self.bind(window,"resize",self.resizeZoom);if(self.istextarea)self.bind(self.win,"mouseup",self.lazyResize);self.checkrtlmode=true;self.lazyResize(30);}
if(this.doc[0].nodeName=='IFRAME'){function oniframeload(e){self.iframexd=false;try{var doc='contentDocument'in this?this.contentDocument:this.contentWindow.document;var a=doc.domain;}catch(e){self.iframexd=true;doc=false};if(self.iframexd){if("console"in window)console.log('NiceScroll error: policy restriced iframe');return true;}
self.forcescreen=true;if(self.isiframe){self.iframe={"doc":$(doc),"html":self.doc.contents().find('html')[0],"body":self.doc.contents().find('body')[0]};self.getContentSize=function(){return{w:Math.max(self.iframe.html.scrollWidth,self.iframe.body.scrollWidth),h:Math.max(self.iframe.html.scrollHeight,self.iframe.body.scrollHeight)}}
self.docscroll=$(self.iframe.body);}
if(!cap.isios&&self.opt.iframeautoresize&&!self.isiframe){self.win.scrollTop(0);self.doc.height("");var hh=Math.max(doc.getElementsByTagName('html')[0].scrollHeight,doc.body.scrollHeight);self.doc.height(hh);}
self.lazyResize(30);if(cap.isie7)self.css($(self.iframe.html),{'overflow-y':'hidden'});self.css($(self.iframe.body),{'overflow-y':'hidden'});if(cap.isios&&self.haswrapper){self.css($(doc.body),{'-webkit-transform':'translate3d(0,0,0)'});console.log(1);}
if('contentWindow'in this){self.bind(this.contentWindow,"scroll",self.onscroll);}else{self.bind(doc,"scroll",self.onscroll);}
if(self.opt.enablemousewheel){self.bind(doc,"mousewheel",self.onmousewheel);}
if(self.opt.enablekeyboard)self.bind(doc,(cap.isopera)?"keypress":"keydown",self.onkeypress);if(cap.cantouch||self.opt.touchbehavior){self.bind(doc,"mousedown",self.ontouchstart);self.bind(doc,"mousemove",function(e){self.ontouchmove(e,true)});if(self.opt.grabcursorenabled&&cap.cursorgrabvalue)self.css($(doc.body),{'cursor':cap.cursorgrabvalue});}
self.bind(doc,"mouseup",self.ontouchend);if(self.zoom){if(self.opt.dblclickzoom)self.bind(doc,'dblclick',self.doZoom);if(self.ongesturezoom)self.bind(doc,"gestureend",self.ongesturezoom);}};if(this.doc[0].readyState&&this.doc[0].readyState=="complete"){setTimeout(function(){oniframeload.call(self.doc[0],false)},500);}
self.bind(this.doc,"load",oniframeload);}};this.showCursor=function(py,px){if(self.cursortimeout){clearTimeout(self.cursortimeout);self.cursortimeout=0;}
if(!self.rail)return;if(self.autohidedom){self.autohidedom.stop().css({opacity:self.opt.cursoropacitymax});self.cursoractive=true;}
if(!self.rail.drag||self.rail.drag.pt!=1){if((typeof py!="undefined")&&(py!==false)){self.scroll.y=Math.round(py*1/self.scrollratio.y);}
if(typeof px!="undefined"){self.scroll.x=Math.round(px*1/self.scrollratio.x);}}
self.cursor.css({height:self.cursorheight,top:self.scroll.y});if(self.cursorh){(!self.rail.align&&self.rail.visibility)?self.cursorh.css({width:self.cursorwidth,left:self.scroll.x+self.rail.width}):self.cursorh.css({width:self.cursorwidth,left:self.scroll.x});self.cursoractive=true;}
if(self.zoom)self.zoom.stop().css({opacity:self.opt.cursoropacitymax});};this.hideCursor=function(tm){if(self.cursortimeout)return;if(!self.rail)return;if(!self.autohidedom)return;self.cursortimeout=setTimeout(function(){if(!self.rail.active||!self.showonmouseevent){self.autohidedom.stop().animate({opacity:self.opt.cursoropacitymin});if(self.zoom)self.zoom.stop().animate({opacity:self.opt.cursoropacitymin});self.cursoractive=false;}
self.cursortimeout=0;},tm||self.opt.hidecursordelay);};this.noticeCursor=function(tm,py,px){self.showCursor(py,px);if(!self.rail.active)self.hideCursor(tm);};this.getContentSize=(self.ispage)?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:(self.haswrapper)?function(){return{w:self.doc.outerWidth()+parseInt(self.win.css('paddingLeft'))+parseInt(self.win.css('paddingRight')),h:self.doc.outerHeight()+parseInt(self.win.css('paddingTop'))+parseInt(self.win.css('paddingBottom'))}}:function(){return{w:self.docscroll[0].scrollWidth,h:self.docscroll[0].scrollHeight}};this.onResize=function(e,page){if(!self.win)return false;if(!self.haswrapper&&!self.ispage){if(self.win.css('display')=='none'){if(self.visibility)self.hideRail().hideRailHr();return false;}else{if(!self.hidden&&!self.visibility)self.showRail().showRailHr();}}
var premaxh=self.page.maxh;var premaxw=self.page.maxw;var preview={h:self.view.h,w:self.view.w};self.view={w:(self.ispage)?self.win.width():parseInt(self.win[0].clientWidth),h:(self.ispage)?self.win.height():parseInt(self.win[0].clientHeight)};self.page=(page)?page:self.getContentSize();self.page.maxh=Math.max(0,self.page.h-self.view.h);self.page.maxw=Math.max(0,self.page.w-self.view.w);if((self.page.maxh==premaxh)&&(self.page.maxw==premaxw)&&(self.view.w==preview.w)){if(!self.ispage){var pos=self.win.offset();if(self.lastposition){var lst=self.lastposition;if((lst.top==pos.top)&&(lst.left==pos.left))return self;}
self.lastposition=pos;}else{return self;}}
if(self.page.maxh==0){self.hideRail();self.scrollvaluemax=0;self.scroll.y=0;self.scrollratio.y=0;self.cursorheight=0;self.setScrollTop(0);self.rail.scrollable=false;}else{self.rail.scrollable=true;}
if(self.page.maxw==0){self.hideRailHr();self.scrollvaluemaxw=0;self.scroll.x=0;self.scrollratio.x=0;self.cursorwidth=0;self.setScrollLeft(0);self.railh.scrollable=false;}else{self.railh.scrollable=true;}
self.locked=(self.page.maxh==0)&&(self.page.maxw==0);if(self.locked){if(!self.ispage)self.updateScrollBar(self.view);return false;}
if(!self.hidden&&!self.visibility){self.showRail().showRailHr();}
else if(!self.hidden&&!self.railh.visibility)self.showRailHr();if(self.istextarea&&self.win.css('resize')&&self.win.css('resize')!='none')self.view.h-=20;self.cursorheight=Math.min(self.view.h,Math.round(self.view.h*(self.view.h/self.page.h)));self.cursorheight=(self.opt.cursorfixedheight)?self.opt.cursorfixedheight:Math.max(self.opt.cursorminheight,self.cursorheight);self.cursorwidth=Math.min(self.view.w,Math.round(self.view.w*(self.view.w/self.page.w)));self.cursorwidth=(self.opt.cursorfixedheight)?self.opt.cursorfixedheight:Math.max(self.opt.cursorminheight,self.cursorwidth);self.scrollvaluemax=self.view.h-self.cursorheight-self.cursor.hborder;if(self.railh){self.railh.width=(self.page.maxh>0)?(self.view.w-self.rail.width):self.view.w;self.scrollvaluemaxw=self.railh.width-self.cursorwidth-self.cursorh.wborder;}
if(self.checkrtlmode&&self.railh){self.checkrtlmode=false;if(self.opt.rtlmode&&self.scroll.x==0)self.setScrollLeft(self.page.maxw);}
if(!self.ispage)self.updateScrollBar(self.view);self.scrollratio={x:(self.page.maxw/self.scrollvaluemaxw),y:(self.page.maxh/self.scrollvaluemax)};var sy=self.getScrollTop();if(sy>self.page.maxh){self.doScrollTop(self.page.maxh);}else{self.scroll.y=Math.round(self.getScrollTop()*(1/self.scrollratio.y));self.scroll.x=Math.round(self.getScrollLeft()*(1/self.scrollratio.x));if(self.cursoractive)self.noticeCursor();}
if(self.scroll.y&&(self.getScrollTop()==0))self.doScrollTo(Math.floor(self.scroll.y*self.scrollratio.y));return self;};this.resize=self.onResize;this.lazyResize=function(tm){tm=(isNaN(tm))?30:tm;self.delayed('resize',self.resize,tm);return self;}
function _modernWheelEvent(dom,name,fn,bubble){self._bind(dom,name,function(e){var e=(e)?e:window.event;var event={original:e,target:e.target||e.srcElement,type:"wheel",deltaMode:e.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){e.preventDefault?e.preventDefault():e.returnValue=false;return false;},stopImmediatePropagation:function(){(e.stopImmediatePropagation)?e.stopImmediatePropagation():e.cancelBubble=true;}};if(name=="mousewheel"){event.deltaY=-1/40*e.wheelDelta;e.wheelDeltaX&&(event.deltaX=-1/40*e.wheelDeltaX);}else{event.deltaY=e.detail;}
return fn.call(dom,event);},bubble);};this._bind=function(el,name,fn,bubble){self.events.push({e:el,n:name,f:fn,b:bubble,q:false});if(el.addEventListener){el.addEventListener(name,fn,bubble||false);}
else if(el.attachEvent){el.attachEvent("on"+name,fn);}
else{el["on"+name]=fn;}};this.jqbind=function(dom,name,fn){self.events.push({e:dom,n:name,f:fn,q:true});$(dom).bind(name,fn);}
this.bind=function(dom,name,fn,bubble){var el=("jquery"in dom)?dom[0]:dom;if(name=='mousewheel'){if("onwheel"in self.win){self._bind(el,"wheel",fn,bubble||false);}else{var wname=(typeof document.onmousewheel!="undefined")?"mousewheel":"DOMMouseScroll";_modernWheelEvent(el,wname,fn,bubble||false);if(wname=="DOMMouseScroll")_modernWheelEvent(el,"MozMousePixelScroll",fn,bubble||false);}}
else if(el.addEventListener){if(cap.cantouch&&/mouseup|mousedown|mousemove/.test(name)){var tt=(name=='mousedown')?'touchstart':(name=='mouseup')?'touchend':'touchmove';self._bind(el,tt,function(e){if(e.touches){if(e.touches.length<2){var ev=(e.touches.length)?e.touches[0]:e;ev.original=e;fn.call(this,ev);}}
else if(e.changedTouches){var ev=e.changedTouches[0];ev.original=e;fn.call(this,ev);}},bubble||false);}
self._bind(el,name,fn,bubble||false);if(cap.cantouch&&name=="mouseup")self._bind(el,"touchcancel",fn,bubble||false);}
else{self._bind(el,name,function(e){e=e||window.event||false;if(e){if(e.srcElement)e.target=e.srcElement;}
if(!("pageY"in e)){e.pageX=e.clientX+document.documentElement.scrollLeft;e.pageY=e.clientY+document.documentElement.scrollTop;}
return((fn.call(el,e)===false)||bubble===false)?self.cancelEvent(e):true;});}};this._unbind=function(el,name,fn,bub){if(el.removeEventListener){el.removeEventListener(name,fn,bub);}
else if(el.detachEvent){el.detachEvent('on'+name,fn);}else{el['on'+name]=false;}};this.unbindAll=function(){for(var a=0;a0)return dd;dom=(dom.parentNode)?dom.parentNode:false;}
return false;};function execScrollWheel(e,hr,chkscroll){var px,py;var rt=1;if(e.deltaMode==0){px=-Math.floor(e.deltaX*(self.opt.mousescrollstep/(18*3)));py=-Math.floor(e.deltaY*(self.opt.mousescrollstep/(18*3)));}
else if(e.deltaMode==1){px=-Math.floor(e.deltaX*self.opt.mousescrollstep);py=-Math.floor(e.deltaY*self.opt.mousescrollstep);}
if(hr&&self.opt.oneaxismousemode&&(px==0)&&py){px=py;py=0;}
if(px){if(self.scrollmom){self.scrollmom.stop()}
self.lastdeltax+=px;self.debounced("mousewheelx",function(){var dt=self.lastdeltax;self.lastdeltax=0;if(!self.rail.drag){self.doScrollLeftBy(dt)}},120);}
if(py){if(self.opt.nativeparentscrolling&&chkscroll&&!self.ispage&&!self.zoomactive){if(py<0){if(self.getScrollTop()>=self.page.maxh)return true;}else{if(self.getScrollTop()<=0)return true;}}
if(self.scrollmom){self.scrollmom.stop()}
self.lastdeltay+=py;self.debounced("mousewheely",function(){var dt=self.lastdeltay;self.lastdeltay=0;if(!self.rail.drag){self.doScrollBy(dt)}},120);}
e.stopImmediatePropagation();return e.preventDefault();};this.onmousewheel=function(e){if(self.locked){self.debounced("checkunlock",self.resize,250);return true;}
if(self.rail.drag)return self.cancelEvent(e);if(self.opt.oneaxismousemode=="auto"&&e.deltaX!=0)self.opt.oneaxismousemode=false;if(self.opt.oneaxismousemode&&e.deltaX==0){if(!self.rail.scrollable){if(self.railh&&self.railh.scrollable){return self.onmousewheelhr(e);}else{return true;}}}
var nw=+(new Date());var chk=false;if(self.opt.preservenativescrolling&&((self.checkarea+600)20)?ex:0;}
if(!self.opt.smoothscroll){this.doScrollLeft=function(x,spd){var y=self.getScrollTop();self.doScrollPos(x,y,spd);}
this.doScrollTop=function(y,spd){var x=self.getScrollLeft();self.doScrollPos(x,y,spd);}
this.doScrollPos=function(x,y,spd){var nx=(x>self.page.maxw)?self.page.maxw:x;if(nx<0)nx=0;var ny=(y>self.page.maxh)?self.page.maxh:y;if(ny<0)ny=0;self.synched('scroll',function(){self.setScrollTop(ny);self.setScrollLeft(nx);});}
this.cancelScroll=function(){};}
else if(self.ishwscroll&&cap.hastransition&&self.opt.usetransition){this.prepareTransition=function(dif,istime){var ex=(istime)?((dif>20)?dif:0):self.getTransitionSpeed(dif);var trans=(ex)?cap.prefixstyle+'transform '+ex+'ms ease-out':'';if(!self.lasttransitionstyle||self.lasttransitionstyle!=trans){self.lasttransitionstyle=trans;self.doc.css(cap.transitionstyle,trans);}
return ex;};this.doScrollLeft=function(x,spd){var y=(self.scrollrunning)?self.newscrolly:self.getScrollTop();self.doScrollPos(x,y,spd);}
this.doScrollTop=function(y,spd){var x=(self.scrollrunning)?self.newscrollx:self.getScrollLeft();self.doScrollPos(x,y,spd);}
this.doScrollPos=function(x,y,spd){var py=self.getScrollTop();var px=self.getScrollLeft();if(((self.newscrolly-py)*(y-py)<0)||((self.newscrollx-px)*(x-px)<0))self.cancelScroll();if(self.opt.bouncescroll==false){if(y<0)y=0;else if(y>self.page.maxh)y=self.page.maxh;if(x<0)x=0;else if(x>self.page.maxw)x=self.page.maxw;}
if(self.scrollrunning&&x==self.newscrollx&&y==self.newscrolly)return false;self.newscrolly=y;self.newscrollx=x;self.newscrollspeed=spd||false;if(self.timer)return false;self.timer=setTimeout(function(){var top=self.getScrollTop();var lft=self.getScrollLeft();var dst={};dst.x=x-lft;dst.y=y-top;dst.px=lft;dst.py=top;var dd=Math.round(Math.sqrt(Math.pow(dst.x,2)+Math.pow(dst.y,2)));var ms=(self.newscrollspeed&&self.newscrollspeed>1)?self.newscrollspeed:self.getTransitionSpeed(dd);if(self.newscrollspeed&&self.newscrollspeed<=1)ms*=self.newscrollspeed;self.prepareTransition(ms,true);if(self.timerscroll&&self.timerscroll.tm)clearInterval(self.timerscroll.tm);if(ms>0){if(!self.scrollrunning&&self.onscrollstart){var info={"type":"scrollstart","current":{"x":lft,"y":top},"request":{"x":x,"y":y},"end":{"x":self.newscrollx,"y":self.newscrolly},"speed":ms};self.onscrollstart.call(self,info);}
if(cap.transitionend){if(!self.scrollendtrapped){self.scrollendtrapped=true;self.bind(self.doc,cap.transitionend,self.onScrollEnd,false);}}else{if(self.scrollendtrapped)clearTimeout(self.scrollendtrapped);self.scrollendtrapped=setTimeout(self.onScrollEnd,ms);}
var py=top;var px=lft;self.timerscroll={bz:new BezierClass(py,self.newscrolly,ms,0,0,0.58,1),bh:new BezierClass(px,self.newscrollx,ms,0,0,0.58,1)};if(!self.cursorfreezed)self.timerscroll.tm=setInterval(function(){self.showCursor(self.getScrollTop(),self.getScrollLeft())},60);}
self.synched("doScroll-set",function(){self.timer=0;if(self.scrollendtrapped)self.scrollrunning=true;self.setScrollTop(self.newscrolly);self.setScrollLeft(self.newscrollx);if(!self.scrollendtrapped)self.onScrollEnd();});},50);};this.cancelScroll=function(){if(!self.scrollendtrapped)return true;var py=self.getScrollTop();var px=self.getScrollLeft();self.scrollrunning=false;if(!cap.transitionend)clearTimeout(cap.transitionend);self.scrollendtrapped=false;self._unbind(self.doc,cap.transitionend,self.onScrollEnd);self.prepareTransition(0);self.setScrollTop(py);if(self.railh)self.setScrollLeft(px);if(self.timerscroll&&self.timerscroll.tm)clearInterval(self.timerscroll.tm);self.timerscroll=false;self.cursorfreezed=false;self.showCursor(py,px);return self;};this.onScrollEnd=function(){if(self.scrollendtrapped)self._unbind(self.doc,cap.transitionend,self.onScrollEnd);self.scrollendtrapped=false;self.prepareTransition(0);if(self.timerscroll&&self.timerscroll.tm)clearInterval(self.timerscroll.tm);self.timerscroll=false;var py=self.getScrollTop();var px=self.getScrollLeft();self.setScrollTop(py);if(self.railh)self.setScrollLeft(px);self.noticeCursor(false,py,px);self.cursorfreezed=false;if(py<0)py=0
else if(py>self.page.maxh)py=self.page.maxh;if(px<0)px=0
else if(px>self.page.maxw)px=self.page.maxw;if((py!=self.newscrolly)||(px!=self.newscrollx))return self.doScrollPos(px,py,self.opt.snapbackspeed);if(self.onscrollend&&self.scrollrunning){var info={"type":"scrollend","current":{"x":px,"y":py},"end":{"x":self.newscrollx,"y":self.newscrolly}};self.onscrollend.call(self,info);}
self.scrollrunning=false;};}else{this.doScrollLeft=function(x,spd){var y=(self.scrollrunning)?self.newscrolly:self.getScrollTop();self.doScrollPos(x,y,spd);}
this.doScrollTop=function(y,spd){var x=(self.scrollrunning)?self.newscrollx:self.getScrollLeft();self.doScrollPos(x,y,spd);}
this.doScrollPos=function(x,y,spd){var y=((typeof y=="undefined")||(y===false))?self.getScrollTop(true):y;if((self.timer)&&(self.newscrolly==y)&&(self.newscrollx==x))return true;if(self.timer)clearAnimationFrame(self.timer);self.timer=0;var py=self.getScrollTop();var px=self.getScrollLeft();if(((self.newscrolly-py)*(y-py)<0)||((self.newscrollx-px)*(x-px)<0))self.cancelScroll();self.newscrolly=y;self.newscrollx=x;if(!self.bouncescroll||!self.rail.visibility){if(self.newscrolly<0){self.newscrolly=0;}
else if(self.newscrolly>self.page.maxh){self.newscrolly=self.page.maxh;}}
if(!self.bouncescroll||!self.railh.visibility){if(self.newscrollx<0){self.newscrollx=0;}
else if(self.newscrollx>self.page.maxw){self.newscrollx=self.page.maxw;}}
self.dst={};self.dst.x=x-px;self.dst.y=y-py;self.dst.px=px;self.dst.py=py;var dst=Math.round(Math.sqrt(Math.pow(self.dst.x,2)+Math.pow(self.dst.y,2)));self.dst.ax=self.dst.x/dst;self.dst.ay=self.dst.y/dst;var pa=0;var pe=dst;if(self.dst.x==0){pa=py;pe=y;self.dst.ay=1;self.dst.py=0;}else if(self.dst.y==0){pa=px;pe=x;self.dst.ax=1;self.dst.px=0;}
var ms=self.getTransitionSpeed(dst);if(spd&&spd<=1)ms*=spd;if(ms>0){self.bzscroll=(self.bzscroll)?self.bzscroll.update(pe,ms):new BezierClass(pa,pe,ms,0,1,0,1);}else{self.bzscroll=false;}
if(self.timer)return;if((py==self.page.maxh&&y>=self.page.maxh)||(px==self.page.maxw&&x>=self.page.maxw))self.checkContentSize();var sync=1;function scrolling(){if(self.cancelAnimationFrame)return true;self.scrollrunning=true;sync=1-sync;if(sync)return(self.timer=setAnimationFrame(scrolling)||1);var done=0;var sc=sy=self.getScrollTop();if(self.dst.ay){sc=(self.bzscroll)?self.dst.py+(self.bzscroll.getNow()*self.dst.ay):self.newscrolly;var dr=sc-sy;if((dr<0&&sc0&&sc>self.newscrolly))sc=self.newscrolly;self.setScrollTop(sc);if(sc==self.newscrolly)done=1;}else{done=1;}
var scx=sx=self.getScrollLeft();if(self.dst.ax){scx=(self.bzscroll)?self.dst.px+(self.bzscroll.getNow()*self.dst.ax):self.newscrollx;var dr=scx-sx;if((dr<0&&scx0&&scx>self.newscrollx))scx=self.newscrollx;self.setScrollLeft(scx);if(scx==self.newscrollx)done+=1;}else{done+=1;}
if(done==2){self.timer=0;self.cursorfreezed=false;self.bzscroll=false;self.scrollrunning=false;if(sc<0)sc=0;else if(sc>self.page.maxh)sc=self.page.maxh;if(scx<0)scx=0;else if(scx>self.page.maxw)scx=self.page.maxw;if((scx!=self.newscrollx)||(sc!=self.newscrolly))self.doScrollPos(scx,sc);else{if(self.onscrollend){var info={"type":"scrollend","current":{"x":sx,"y":sy},"end":{"x":self.newscrollx,"y":self.newscrolly}};self.onscrollend.call(self,info);}}}else{self.timer=setAnimationFrame(scrolling)||1;}};self.cancelAnimationFrame=false;self.timer=1;if(self.onscrollstart&&!self.scrollrunning){var info={"type":"scrollstart","current":{"x":px,"y":py},"request":{"x":x,"y":y},"end":{"x":self.newscrollx,"y":self.newscrolly},"speed":ms};self.onscrollstart.call(self,info);}
scrolling();if((py==self.page.maxh&&y>=py)||(px==self.page.maxw&&x>=px))self.checkContentSize();self.noticeCursor();};this.cancelScroll=function(){if(self.timer)clearAnimationFrame(self.timer);self.timer=0;self.bzscroll=false;self.scrollrunning=false;return self;};}
this.doScrollBy=function(stp,relative){var ny=0;if(relative){ny=Math.floor((self.scroll.y-stp)*self.scrollratio.y)}else{var sy=(self.timer)?self.newscrolly:self.getScrollTop(true);ny=sy-stp;}
if(self.bouncescroll){var haf=Math.round(self.view.h/2);if(ny<-haf)ny=-haf
else if(ny>(self.page.maxh+haf))ny=(self.page.maxh+haf);}
self.cursorfreezed=false;py=self.getScrollTop(true);if(ny<0&&py<=0)return self.noticeCursor();else if(ny>self.page.maxh&&py>=self.page.maxh){self.checkContentSize();return self.noticeCursor();}
self.doScrollTop(ny);};this.doScrollLeftBy=function(stp,relative){var nx=0;if(relative){nx=Math.floor((self.scroll.x-stp)*self.scrollratio.x)}else{var sx=(self.timer)?self.newscrollx:self.getScrollLeft(true);nx=sx-stp;}
if(self.bouncescroll){var haf=Math.round(self.view.w/2);if(nx<-haf)nx=-haf
else if(nx>(self.page.maxw+haf))nx=(self.page.maxw+haf);}
self.cursorfreezed=false;px=self.getScrollLeft(true);if(nx<0&&px<=0)return self.noticeCursor();else if(nx>self.page.maxw&&px>=self.page.maxw)return self.noticeCursor();self.doScrollLeft(nx);};this.doScrollTo=function(pos,relative){var ny=(relative)?Math.round(pos*self.scrollratio.y):pos;if(ny<0)ny=0
else if(ny>self.page.maxh)ny=self.page.maxh;self.cursorfreezed=false;self.doScrollTop(pos);};this.checkContentSize=function(){var pg=self.getContentSize();if((pg.h!=self.page.h)||(pg.w!=self.page.w))self.resize(false,pg);};self.onscroll=function(e){if(self.rail.drag)return;if(!self.cursorfreezed){self.synched('scroll',function(){self.scroll.y=Math.round(self.getScrollTop()*(1/self.scrollratio.y));if(self.railh)self.scroll.x=Math.round(self.getScrollLeft()*(1/self.scrollratio.x));self.noticeCursor();});}};self.bind(self.docscroll,"scroll",self.onscroll);this.doZoomIn=function(e){if(self.zoomactive)return;self.zoomactive=true;self.zoomrestore={style:{}};var lst=['position','top','left','zIndex','backgroundColor','marginTop','marginBottom','marginLeft','marginRight'];var win=self.win[0].style;for(var a in lst){var pp=lst[a];self.zoomrestore.style[pp]=(typeof win[pp]!="undefined")?win[pp]:'';}
self.zoomrestore.style.width=self.win.css('width');self.zoomrestore.style.height=self.win.css('height');self.zoomrestore.padding={w:self.win.outerWidth()-self.win.width(),h:self.win.outerHeight()-self.win.height()};if(cap.isios4){self.zoomrestore.scrollTop=$(window).scrollTop();$(window).scrollTop(0);}
self.win.css({"position":(cap.isios4)?"absolute":"fixed","top":0,"left":0,"z-index":globalmaxzindex+100,"margin":"0px"});var bkg=self.win.css("backgroundColor");if(bkg==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg))self.win.css("backgroundColor","#fff");self.rail.css({"z-index":globalmaxzindex+101});self.zoom.css({"z-index":globalmaxzindex+102});self.zoom.css('backgroundPosition','0px -18px');self.resizeZoom();if(self.onzoomin)self.onzoomin.call(self);return self.cancelEvent(e);};this.doZoomOut=function(e){if(!self.zoomactive)return;self.zoomactive=false;self.win.css("margin","");self.win.css(self.zoomrestore.style);if(cap.isios4){$(window).scrollTop(self.zoomrestore.scrollTop);}
self.rail.css({"z-index":self.zindex});self.zoom.css({"z-index":self.zindex});self.zoomrestore=false;self.zoom.css('backgroundPosition','0px 0px');self.onResize();if(self.onzoomout)self.onzoomout.call(self);return self.cancelEvent(e);};this.doZoom=function(e){return(self.zoomactive)?self.doZoomOut(e):self.doZoomIn(e);};this.resizeZoom=function(){if(!self.zoomactive)return;var py=self.getScrollTop();self.win.css({width:$(window).width()-self.zoomrestore.padding.w+"px",height:$(window).height()-self.zoomrestore.padding.h+"px"});self.onResize();self.setScrollTop(Math.min(self.page.maxh,py));};this.init();$.nicescroll.push(this);};var ScrollMomentumClass2D=function(nc){var self=this;this.nc=nc;this.lastx=0;this.lasty=0;this.speedx=0;this.speedy=0;this.lasttime=0;this.steptime=0;this.snapx=false;this.snapy=false;this.demulx=0;this.demuly=0;this.lastscrollx=-1;this.lastscrolly=-1;this.chkx=0;this.chky=0;this.timer=0;this.time=function(){return+new Date();};this.reset=function(px,py){self.stop();var now=self.time();self.steptime=0;self.lasttime=now;self.speedx=0;self.speedy=0;self.lastx=px;self.lasty=py;self.lastscrollx=-1;self.lastscrolly=-1;};this.update=function(px,py){var now=self.time();self.steptime=now-self.lasttime;self.lasttime=now;var dy=py-self.lasty;var dx=px-self.lastx;var sy=self.nc.getScrollTop();var sx=self.nc.getScrollLeft();var newy=sy+dy;var newx=sx+dx;self.snapx=(newx<0)||(newx>self.nc.page.maxw);self.snapy=(newy<0)||(newy>self.nc.page.maxh);self.speedx=dx;self.speedy=dy;self.lastx=px;self.lasty=py;};this.stop=function(){self.nc.unsynched("domomentum2d");if(self.timer)clearTimeout(self.timer);self.timer=0;self.lastscrollx=-1;self.lastscrolly=-1;};this.doSnapy=function(nx,ny){var snap=false;if(ny<0){ny=0;snap=true;}
else if(ny>self.nc.page.maxh){ny=self.nc.page.maxh;snap=true;}
if(nx<0){nx=0;snap=true;}
else if(nx>self.nc.page.maxw){nx=self.nc.page.maxw;snap=true;}
if(snap)self.nc.doScrollPos(nx,ny,self.nc.opt.snapbackspeed);};this.doMomentum=function(gp){var t=self.time();var l=(gp)?t+gp:self.lasttime;var sl=self.nc.getScrollLeft();var st=self.nc.getScrollTop();var pageh=self.nc.page.maxh;var pagew=self.nc.page.maxw;self.speedx=(pagew>0)?Math.min(60,self.speedx):0;self.speedy=(pageh>0)?Math.min(60,self.speedy):0;var chk=l&&(t-l)<=60;if((st<0)||(st>pageh)||(sl<0)||(sl>pagew))chk=false;var sy=(self.speedy&&chk)?self.speedy:false;var sx=(self.speedx&&chk)?self.speedx:false;if(sy||sx){var tm=Math.max(16,self.steptime);if(tm>50){var xm=tm/50;self.speedx*=xm;self.speedy*=xm;tm=50;}
self.demulxy=0;self.lastscrollx=self.nc.getScrollLeft();self.chkx=self.lastscrollx;self.lastscrolly=self.nc.getScrollTop();self.chky=self.lastscrolly;var nx=self.lastscrollx;var ny=self.lastscrolly;var onscroll=function(){var df=((self.time()-t)>600)?0.04:0.02;if(self.speedx){nx=Math.floor(self.lastscrollx-(self.speedx*(1-self.demulxy)));self.lastscrollx=nx;if((nx<0)||(nx>pagew))df=0.10;}
if(self.speedy){ny=Math.floor(self.lastscrolly-(self.speedy*(1-self.demulxy)));self.lastscrolly=ny;if((ny<0)||(ny>pageh))df=0.10;}
self.demulxy=Math.min(1,self.demulxy+df);self.nc.synched("domomentum2d",function(){if(self.speedx){var scx=self.nc.getScrollLeft();if(scx!=self.chkx)self.stop();self.chkx=nx;self.nc.setScrollLeft(nx);}
if(self.speedy){var scy=self.nc.getScrollTop();if(scy!=self.chky)self.stop();self.chky=ny;self.nc.setScrollTop(ny);}
if(!self.timer){self.nc.hideCursor();self.doSnapy(nx,ny);}});if(self.demulxy<1){self.timer=setTimeout(onscroll,tm);}else{self.stop();self.nc.hideCursor();self.doSnapy(nx,ny);}};onscroll();}else{self.doSnapy(self.nc.getScrollLeft(),self.nc.getScrollTop());}}};var _scrollTop=jQuery.fn.scrollTop;jQuery.cssHooks["pageYOffset"]={get:function(elem,computed,extra){var nice=$.data(elem,'__nicescroll')||false;return(nice&&nice.ishwscroll)?nice.getScrollTop():_scrollTop.call(elem);},set:function(elem,value){var nice=$.data(elem,'__nicescroll')||false;(nice&&nice.ishwscroll)?nice.setScrollTop(parseInt(value)):_scrollTop.call(elem,value);return this;}};jQuery.fn.scrollTop=function(value){if(typeof value=="undefined"){var nice=(this[0])?$.data(this[0],'__nicescroll')||false:false;return(nice&&nice.ishwscroll)?nice.getScrollTop():_scrollTop.call(this);}else{return this.each(function(){var nice=$.data(this,'__nicescroll')||false;(nice&&nice.ishwscroll)?nice.setScrollTop(parseInt(value)):_scrollTop.call($(this),value);});}}
var _scrollLeft=jQuery.fn.scrollLeft;$.cssHooks.pageXOffset={get:function(elem,computed,extra){var nice=$.data(elem,'__nicescroll')||false;return(nice&&nice.ishwscroll)?nice.getScrollLeft():_scrollLeft.call(elem);},set:function(elem,value){var nice=$.data(elem,'__nicescroll')||false;(nice&&nice.ishwscroll)?nice.setScrollLeft(parseInt(value)):_scrollLeft.call(elem,value);return this;}};jQuery.fn.scrollLeft=function(value){if(typeof value=="undefined"){var nice=(this[0])?$.data(this[0],'__nicescroll')||false:false;return(nice&&nice.ishwscroll)?nice.getScrollLeft():_scrollLeft.call(this);}else{return this.each(function(){var nice=$.data(this,'__nicescroll')||false;(nice&&nice.ishwscroll)?nice.setScrollLeft(parseInt(value)):_scrollLeft.call($(this),value);});}}
var NiceScrollArray=function(doms){var self=this;this.length=0;this.name="nicescrollarray";this.each=function(fn){for(var a=0,i=0;a'+_self.settings.labels['errorMessage']+'
';},labels:{'errorMessage':'Source could not be found...','sequenceInfo.of':' of ','close':'Close','navigator.prev':'Prev','navigator.next':'Next','navigator.play':'Play','navigator.pause':'Pause'},markup:function(){$('body').append(_self.objects.overlay=$('
'),_self.objects.loading=$('
'),_self.objects.case=$('
'));_self.objects.case.after(_self.objects.nav=$('
'));_self.objects.nav.append(_self.objects.close=$(''+_self.settings.labels['close']+' '),_self.objects.prev=$(''+_self.settings.labels['navigator.prev']+' ').hide(),_self.objects.next=$(''+_self.settings.labels['navigator.next']+' ').hide(),_self.objects.play=$(''+_self.settings.labels['navigator.play']+' ').hide(),_self.objects.pause=$(''+_self.settings.labels['navigator.pause']+' ').hide());_self.objects.case.append(_self.objects.content=$('
'),_self.objects.info=$('
'));_self.objects.content.append(_self.objects.contentInner=$('
'));_self.objects.info.append(_self.objects.sequenceInfo=$('
'),_self.objects.title=$(' '),_self.objects.caption=$('
'));},onInit:{},onStart:{},onFinish:{},onClose:{},onCleanup:{}},options);_self._callHooks(_self.settings.onInit);_self.objectData=_self._setObjectData(this);_self._cacheScrollPosition();_self._watchScrollInteraction();_self._addElements();_self._open();_self.dimensions=_self.getViewportDimensions();},get:function(name){return _self.objects[name];},getObjectData:function(){return _self.objectData;},_setObjectData:function(object){var $object=$(object),objectData={title:_self.settings.title||$object.attr(_self._prefixAttributeName('title'))||$object.attr('title'),caption:_self.settings.caption||$object.attr(_self._prefixAttributeName('caption'))||$object.children('img').attr('alt'),url:_self._determineUrl(),requestType:_self.settings.ajax.type,requestData:_self.settings.ajax.data,requestDataType:_self.settings.ajax.dataType,rel:$object.attr(_self._determineAttributeSelector()),type:_self.settings.type||_self._verifyDataType(_self._determineUrl()),isPartOfSequence:_self._isPartOfSequence($object.attr(_self.settings.attr),':'),isPartOfSequenceWithSlideshow:_self._isPartOfSequence($object.attr(_self.settings.attr),':slideshow'),currentIndex:$(_self._determineAttributeSelector()).index($object),sequenceLength:$(_self._determineAttributeSelector()).length};objectData.sequenceInfo=(objectData.currentIndex+1)+_self.settings.labels['sequenceInfo.of']+objectData.sequenceLength;objectData.prevIndex=objectData.currentIndex-1;objectData.nextIndex=objectData.currentIndex+1;return objectData;},_prefixAttributeName:function(name){return'data-'+_self.settings.attrPrefix+name;},_determineLinkTarget:function(){return _self.settings.href||$(_self.origin).attr(_self._prefixAttributeName('href'))||$(_self.origin).attr('href');},_determineAttributeSelector:function(){var $origin=$(_self.origin),selector='';if(typeof _self.cache.selector!=='undefined'){selector=_self.cache.selector;}else if(_self.settings.useCategories===true&&$origin.attr(_self._prefixAttributeName('categories'))){var categories=$origin.attr(_self._prefixAttributeName('categories')).split(' ');$.each(categories,function(index,category){if(index>0){selector+=',';}
selector+='['+_self._prefixAttributeName('categories')+'~="'+category+'"]';});}else{selector='['+_self.settings.attr+'="'+$origin.attr(_self.settings.attr)+'"]';}
_self.cache.selector=selector;return selector;},_determineUrl:function(){var dataUrl=_self._verifyDataUrl(_self._determineLinkTarget()),width=0,density=0,url;$.each(dataUrl,function(index,src){if(_self._devicePixelRatio()>=src.density&&src.density>=density&&_self._matchMedia()('screen and (min-width:'+src.width+'px)')&&src.width>=width){width=src.width;density=src.density;url=src.url;}});return url;},_normalizeUrl:function(url){var srcExp=/^\d+$/;return url.split(',').map(function(str){var src={width:0,density:0};str.trim().split(/\s+/).forEach(function(url,i){if(i===0){return src.url=url;}
var value=url.substring(0,url.length-1),lastChar=url[url.length-1],intVal=parseInt(value,10),floatVal=parseFloat(value);if(lastChar==='w'&&srcExp.test(value)){src.width=intVal;}else if(lastChar==='h'&&srcExp.test(value)){src.height=intVal;}else if(lastChar==='x'&&!isNaN(floatVal)){src.density=floatVal;}});return src;});},_isPartOfSequence:function(rel,expression){var getSimilarLinks=$('['+_self.settings.attr+'="'+rel+'"]'),regexp=new RegExp(expression);return(regexp.test(rel)&&getSimilarLinks.length>1);},isSlideshowEnabled:function(){return(_self.objectData.isPartOfSequence&&(_self.settings.slideshow===true||_self.objectData.isPartOfSequenceWithSlideshow===true));},_loadContent:function(){if(_self.cache.originalObject){_self._restoreObject();}
_self._createObject();},_createObject:function(){var $object;switch(_self.objectData.type){case'image':$object=$(new Image());$object.attr({'src':_self.objectData.url,'alt':_self.objectData.title});break;case'inline':$object=$('
');$object.html(_self._cloneObject($(_self.objectData.url)));$.each(_self.settings.inline,function(name,value){$object.attr(_self._prefixAttributeName(name),value);});break;case'ajax':$object=$('
');$.each(_self.settings.ajax,function(name,value){if(name!=='data'){$object.attr(_self._prefixAttributeName(name),value);}});break;case'flash':$object=$(' ');$.each(_self.settings.flash,function(name,value){$object.attr(name,value);});break;case'video':$object=$(' ');$object.attr('src',_self.objectData.url);$.each(_self.settings.video,function(name,value){$object.attr(name,value);});break;default:$object=$('');$object.attr({'src':_self.objectData.url});$.each(_self.settings.iframe,function(name,value){$object.attr(name,value);});break;}
_self._addObject($object);_self._loadObject($object);},_addObject:function($object){_self.objects.contentInner.html($object);_self._loading('start');_self._callHooks(_self.settings.onStart);if(_self.settings.showSequenceInfo===true&&_self.objectData.isPartOfSequence){_self.objects.sequenceInfo.html(_self.objectData.sequenceInfo);_self.objects.sequenceInfo.show();}else{_self.objects.sequenceInfo.empty();_self.objects.sequenceInfo.hide();}
if(_self.settings.showTitle===true&&_self.objectData.title!==undefined&&_self.objectData.title!==''){_self.objects.title.html(_self.objectData.title);_self.objects.title.show();}else{_self.objects.title.empty();_self.objects.title.hide();}
if(_self.settings.showCaption===true&&_self.objectData.caption!==undefined&&_self.objectData.caption!==''){_self.objects.caption.html(_self.objectData.caption);_self.objects.caption.show();}else{_self.objects.caption.empty();_self.objects.caption.hide();}},_loadObject:function($object){switch(_self.objectData.type){case'inline':if($(_self.objectData.url)){_self._showContent($object);}else{_self.error();}
break;case'ajax':$.ajax($.extend({},_self.settings.ajax,{url:_self.objectData.url,type:_self.objectData.requestType,dataType:_self.objectData.requestDataType,data:_self.objectData.requestData,success:function(data,textStatus,jqXHR){if(_self.objectData.requestDataType==='json'){_self.objectData.data=data;}else{$object.html(data);}
_self._showContent($object);},error:function(jqXHR,textStatus,errorThrown){_self.error();}}));break;case'flash':_self._showContent($object);break;case'video':if(typeof($object.get(0).canPlayType)==='function'||_self.objects.case.find('video').length===0){_self._showContent($object);}else{_self.error();}
break;default:if(_self.objectData.url){_self._calculateDimensions($object);$object.load(function(){_self._showContent($object);});$object.error(function(){_self.error();});}else{_self.error();}
break;}},error:function(){_self.objectData.type='error';var $object=$('
');$object.html(_self.settings.errorMessage);_self.objects.contentInner.html($object);_self._showContent(_self.objects.contentInner);},_calculateDimensions:function($object){_self._cleanupDimensions();var dimensions={objectWidth:$object.attr('width')?$object.attr('width'):$object.attr(_self._prefixAttributeName('width')),objectHeight:$object.attr('height')?$object.attr('height'):$object.attr(_self._prefixAttributeName('height'))};if(!_self.settings.disableShrink){dimensions.maxWidth=parseInt(_self.dimensions.windowWidth*_self.settings.shrinkFactor);dimensions.maxHeight=parseInt(_self.dimensions.windowHeight*_self.settings.shrinkFactor);if(dimensions.maxWidth>_self.settings.maxWidth){dimensions.maxWidth=_self.settings.maxWidth;}
if(dimensions.maxHeight>_self.settings.maxHeight){dimensions.maxHeight=_self.settings.maxHeight;}
dimensions.differenceWidthAsPercent=parseInt(100/dimensions.maxWidth*dimensions.objectWidth);dimensions.differenceHeightAsPercent=parseInt(100/dimensions.maxHeight*dimensions.objectHeight);switch(_self.objectData.type){case'image':case'flash':case'video':if(dimensions.differenceWidthAsPercent>100&&dimensions.differenceWidthAsPercent>dimensions.differenceHeightAsPercent){dimensions.objectWidth=dimensions.maxWidth;dimensions.objectHeight=parseInt(dimensions.objectHeight/dimensions.differenceWidthAsPercent*100);}
if(dimensions.differenceHeightAsPercent>100&&dimensions.differenceHeightAsPercent>dimensions.differenceWidthAsPercent){dimensions.objectWidth=parseInt(dimensions.objectWidth/dimensions.differenceHeightAsPercent*100);dimensions.objectHeight=dimensions.maxHeight;}
if(dimensions.differenceHeightAsPercent>100&&dimensions.differenceWidthAsPercentdimensions.maxWidth){dimensions.objectWidth=dimensions.maxWidth;}
break;default:if((isNaN(dimensions.objectWidth)||dimensions.objectWidth>dimensions.maxWidth)&&!_self.settings.forceWidth){dimensions.objectWidth=dimensions.maxWidth;}
if(((isNaN(dimensions.objectHeight)&&dimensions.objectHeight!=='auto')||dimensions.objectHeight>dimensions.maxHeight)&&!_self.settings.forceHeight){dimensions.objectHeight=dimensions.maxHeight;}
break;}}
if(_self.settings.forceWidth){dimensions.maxWidth=dimensions.objectWidth;}else if($object.attr(_self._prefixAttributeName('max-width'))){dimensions.maxWidth=$object.attr(_self._prefixAttributeName('max-width'));}
if(_self.settings.forceHeight){dimensions.maxHeight=dimensions.objectHeight;}else if($object.attr(_self._prefixAttributeName('max-height'))){dimensions.maxHeight=$object.attr(_self._prefixAttributeName('max-height'));}
_self._adjustDimensions($object,dimensions);},_adjustDimensions:function($object,dimensions){$object.css({'width':dimensions.objectWidth,'height':dimensions.objectHeight,'max-width':dimensions.maxWidth,'max-height':dimensions.maxHeight});_self.objects.contentInner.css({'width':$object.outerWidth(),'height':$object.outerHeight(),'max-width':'100%'});_self.objects.case.css({'width':_self.objects.contentInner.outerWidth()});_self.objects.case.css({'margin-top':parseInt(-(_self.objects.case.outerHeight()/2)),'margin-left':parseInt(-(_self.objects.case.outerWidth()/2))});},_loading:function(process){if(process==='start'){_self.objects.case.addClass(_self.settings.classPrefix+'loading');_self.objects.loading.show();}else if(process==='end'){_self.objects.case.removeClass(_self.settings.classPrefix+'loading');_self.objects.loading.hide();}},getViewportDimensions:function(){return{windowWidth:$(window).innerWidth(),windowHeight:$(window).innerHeight()};},_verifyDataUrl:function(dataUrl){if(!dataUrl||dataUrl===undefined||dataUrl===''){return false;}
if(dataUrl.indexOf('#')>-1){dataUrl=dataUrl.split('#');dataUrl='#'+dataUrl[dataUrl.length-1];}
return _self._normalizeUrl(dataUrl.toString());},_verifyDataType:function(url){var typeMapping=_self.settings.typeMapping;if(!url){return false;}
for(var key in typeMapping){if(typeMapping.hasOwnProperty(key)){var suffixArr=typeMapping[key].split(',');for(var i=0;i-1))){return key;}}}}
return'iframe';},_addElements:function(){if(typeof _self.objects.case!=='undefined'&&$('#'+_self.objects.case.attr('id')).length){return;}
_self.settings.markup();},_showContent:function($object){_self.objects.case.attr(_self._prefixAttributeName('type'),_self.objectData.type);_self.cache.object=$object;_self._calculateDimensions($object);_self._callHooks(_self.settings.onFinish);switch(_self.settings.transitionIn){case'scrollTop':case'scrollRight':case'scrollBottom':case'scrollLeft':case'scrollHorizontal':case'scrollVertical':_self.transition.scroll(_self.objects.case,'in',_self.settings.speedIn);_self.transition.fade(_self.objects.contentInner,'in',_self.settings.speedIn);break;case'elastic':if(_self.objects.case.css('opacity')<1){_self.transition.zoom(_self.objects.case,'in',_self.settings.speedIn);_self.transition.fade(_self.objects.contentInner,'in',_self.settings.speedIn);}
case'fade':case'fadeInline':_self.transition.fade(_self.objects.case,'in',_self.settings.speedIn);_self.transition.fade(_self.objects.contentInner,'in',_self.settings.speedIn);break;default:_self.transition.fade(_self.objects.case,'in',0);break;}
_self._loading('end');_self.isBusy=false;},_processContent:function(){_self.isBusy=true;switch(_self.settings.transitionOut){case'scrollTop':case'scrollRight':case'scrollBottom':case'scrollLeft':case'scrollVertical':case'scrollHorizontal':if(_self.objects.case.is(':hidden')){_self.transition.fade(_self.objects.case,'out',0,0,function(){_self._loadContent();});_self.transition.fade(_self.objects.contentInner,'out',0);}else{_self.transition.scroll(_self.objects.case,'out',_self.settings.speedOut,function(){_self._loadContent();});}
break;case'fade':if(_self.objects.case.is(':hidden')){_self.transition.fade(_self.objects.case,'out',0,0,function(){_self._loadContent();});}else{_self.transition.fade(_self.objects.case,'out',_self.settings.speedOut,0,function(){_self._loadContent();});}
break;case'fadeInline':case'elastic':if(_self.objects.case.is(':hidden')){_self.transition.fade(_self.objects.case,'out',0,0,function(){_self._loadContent();});}else{_self.transition.fade(_self.objects.contentInner,'out',_self.settings.speedOut,0,function(){_self._loadContent();});}
break;default:_self.transition.fade(_self.objects.case,'out',0,0,function(){_self._loadContent();});break;}},_handleEvents:function(){_self._unbindEvents();_self.objects.nav.children().not(_self.objects.close).hide();if(_self.isSlideshowEnabled()){if(!_self.objects.nav.hasClass(_self.settings.classPrefix+'paused')){_self._startTimeout();}else{_self._stopTimeout();}}
if(_self.settings.liveResize){_self._watchResizeInteraction();}
_self.objects.close.click(function(event){event.preventDefault();_self.close();});if(_self.settings.closeOnOverlayClick===true){_self.objects.overlay.css('cursor','pointer').click(function(event){event.preventDefault();_self.close();});}
if(_self.settings.useKeys===true){_self._addKeyEvents();}
if(_self.objectData.isPartOfSequence){_self.objects.nav.attr(_self._prefixAttributeName('ispartofsequence'),true);_self.objects.nav.data('items',_self._setNavigation());_self.objects.prev.click(function(event){event.preventDefault();if(_self.settings.navigateEndless===true||!_self.item.isFirst()){_self.objects.prev.unbind('click');_self.cache.action='prev';_self.objects.nav.data('items').prev.click();if(_self.isSlideshowEnabled()){_self._stopTimeout();}}});_self.objects.next.click(function(event){event.preventDefault();if(_self.settings.navigateEndless===true||!_self.item.isLast()){_self.objects.next.unbind('click');_self.cache.action='next';_self.objects.nav.data('items').next.click();if(_self.isSlideshowEnabled()){_self._stopTimeout();}}});if(_self.isSlideshowEnabled()){_self.objects.play.click(function(event){event.preventDefault();_self._startTimeout();});_self.objects.pause.click(function(event){event.preventDefault();_self._stopTimeout();});}
if(_self.settings.swipe===true){if($.isPlainObject($.event.special.swipeleft)){_self.objects.case.on('swipeleft',function(event){event.preventDefault();_self.objects.next.click();if(_self.isSlideshowEnabled()){_self._stopTimeout();}});}
if($.isPlainObject($.event.special.swiperight)){_self.objects.case.on('swiperight',function(event){event.preventDefault();_self.objects.prev.click();if(_self.isSlideshowEnabled()){_self._stopTimeout();}});}}}},_addKeyEvents:function(){$(document).bind('keyup.lightcase',function(event){if(_self.isBusy){return;}
switch(event.keyCode){case 27:_self.objects.close.click();break;case 37:if(_self.objectData.isPartOfSequence){_self.objects.prev.click();}
break;case 39:if(_self.objectData.isPartOfSequence){_self.objects.next.click();}
break;}});},_startTimeout:function(){_self.objects.play.hide();_self.objects.pause.show();_self.cache.action='next';_self.objects.nav.removeClass(_self.settings.classPrefix+'paused');_self.timeout=setTimeout(function(){_self.objects.nav.data('items').next.click();},_self.settings.timeout);},_stopTimeout:function(){_self.objects.play.show();_self.objects.pause.hide();_self.objects.nav.addClass(_self.settings.classPrefix+'paused');clearTimeout(_self.timeout);},_setNavigation:function(){var $links=$((_self.cache.selector||_self.settings.attr)),sequenceLength=_self.objectData.sequenceLength-1,items={prev:$links.eq(_self.objectData.prevIndex),next:$links.eq(_self.objectData.nextIndex)};if(_self.objectData.currentIndex>0){_self.objects.prev.show();}else{items.prevItem=$links.eq(sequenceLength);}
if(_self.objectData.nextIndex<=sequenceLength){_self.objects.next.show();}else{items.next=$links.eq(0);}
if(_self.settings.navigateEndless===true){_self.objects.prev.show();_self.objects.next.show();}
return items;},item:{isFirst:function(){return(_self.objectData.currentIndex===0);},isLast:function(){return(_self.objectData.currentIndex===(_self.objectData.sequenceLength-1));}},_cloneObject:function($object){var $clone=$object.clone(),objectId=$object.attr('id');if($object.is(':hidden')){_self._cacheObjectData($object);$object.attr('id',_self.settings.idPrefix+'temp-'+objectId).empty();}else{$clone.removeAttr('id');}
return $clone.show();},isMobileDevice:function(){var deviceAgent=navigator.userAgent.toLowerCase(),agentId=deviceAgent.match(_self.settings.mobileMatchExpression);return agentId?true:false;},isTransitionSupported:function(){var body=$('body').get(0),isTransitionSupported=false,transitionMapping={'transition':'','WebkitTransition':'-webkit-','MozTransition':'-moz-','OTransition':'-o-','MsTransition':'-ms-'};for(var key in transitionMapping){if(transitionMapping.hasOwnProperty(key)&&key in body.style){_self.support.transition=transitionMapping[key];isTransitionSupported=true;}}
return isTransitionSupported;},transition:{fade:function($object,type,speed,opacity,callback){var isInTransition=type==='in',startTransition={},startOpacity=$object.css('opacity'),endTransition={},endOpacity=opacity?opacity:isInTransition?1:0;if(!_self.isOpen&&isInTransition)return;startTransition['opacity']=startOpacity;endTransition['opacity']=endOpacity;$object.css(startTransition).show();if(_self.support.transitions){endTransition[_self.support.transition+'transition']=speed+'ms ease';setTimeout(function(){$object.css(endTransition);setTimeout(function(){$object.css(_self.support.transition+'transition','');if(callback&&(_self.isOpen||!isInTransition)){callback();}},speed);},15);}else{$object.stop();$object.animate(endTransition,speed,callback);}},scroll:function($object,type,speed,callback){var isInTransition=type==='in',transition=isInTransition?_self.settings.transitionIn:_self.settings.transitionOut,direction='left',startTransition={},startOpacity=isInTransition?0:1,startOffset=isInTransition?'-50%':'50%',endTransition={},endOpacity=isInTransition?1:0,endOffset=isInTransition?'50%':'-50%';if(!_self.isOpen&&isInTransition)return;switch(transition){case'scrollTop':direction='top';break;case'scrollRight':startOffset=isInTransition?'150%':'50%';endOffset=isInTransition?'50%':'150%';break;case'scrollBottom':direction='top';startOffset=isInTransition?'150%':'50%';endOffset=isInTransition?'50%':'150%';break;case'scrollHorizontal':startOffset=isInTransition?'150%':'50%';endOffset=isInTransition?'50%':'-50%';break;case'scrollVertical':direction='top';startOffset=isInTransition?'-50%':'50%';endOffset=isInTransition?'50%':'150%';break;}
if(_self.cache.action==='prev'){switch(transition){case'scrollHorizontal':startOffset=isInTransition?'-50%':'50%';endOffset=isInTransition?'50%':'150%';break;case'scrollVertical':startOffset=isInTransition?'150%':'50%';endOffset=isInTransition?'50%':'-50%';break;}}
startTransition['opacity']=startOpacity;startTransition[direction]=startOffset;endTransition['opacity']=endOpacity;endTransition[direction]=endOffset;$object.css(startTransition).show();if(_self.support.transitions){endTransition[_self.support.transition+'transition']=speed+'ms ease';setTimeout(function(){$object.css(endTransition);setTimeout(function(){$object.css(_self.support.transition+'transition','');if(callback&&(_self.isOpen||!isInTransition)){callback();}},speed);},15);}else{$object.stop();$object.animate(endTransition,speed,callback);}},zoom:function($object,type,speed,callback){var isInTransition=type==='in',startTransition={},startOpacity=$object.css('opacity'),startScale=isInTransition?'scale(0.75)':'scale(1)',endTransition={},endOpacity=isInTransition?1:0,endScale=isInTransition?'scale(1)':'scale(0.75)';if(!_self.isOpen&&isInTransition)return;startTransition['opacity']=startOpacity;startTransition[_self.support.transition+'transform']=startScale;endTransition['opacity']=endOpacity;$object.css(startTransition).show();if(_self.support.transitions){endTransition[_self.support.transition+'transform']=endScale;endTransition[_self.support.transition+'transition']=speed+'ms ease';setTimeout(function(){$object.css(endTransition);setTimeout(function(){$object.css(_self.support.transition+'transform','');$object.css(_self.support.transition+'transition','');if(callback&&(_self.isOpen||!isInTransition)){callback();}},speed);},15);}else{$object.stop();$object.animate(endTransition,speed,callback);}}},_callHooks:function(hooks){if(typeof(hooks)==='object'){$.each(hooks,function(index,hook){if(typeof(hook)==='function'){hook.call(_self.origin);}});}},_cacheObjectData:function($object){$.data($object,'cache',{id:$object.attr('id'),content:$object.html()});_self.cache.originalObject=$object;},_restoreObject:function(){var $object=$('[id^="'+_self.settings.idPrefix+'temp-"]');$object.attr('id',$.data(_self.cache.originalObject,'cache').id);$object.html($.data(_self.cache.originalObject,'cache').content);},resize:function(){if(!_self.isOpen)return;if(_self.isSlideshowEnabled()){_self._stopTimeout();}
_self.dimensions=_self.getViewportDimensions();_self._calculateDimensions(_self.cache.object);},_cacheScrollPosition:function(){var $window=$(window),$document=$(document),offset={'top':$window.scrollTop(),'left':$window.scrollLeft()};_self.cache.scrollPosition=_self.cache.scrollPosition||{};if($document.width()>$window.width()){_self.cache.scrollPosition.left=offset.left;}
if($document.height()>$window.height()){_self.cache.scrollPosition.top=offset.top;}},_watchResizeInteraction:function(){$(window).resize(_self.resize);},_unwatchResizeInteraction:function(){$(window).off('resize',_self.resize);},_watchScrollInteraction:function(){$(window).scroll(_self._cacheScrollPosition);},_unwatchScrollInteraction:function(){$(window).off('scroll',_self._cacheScrollPosition);},_restoreScrollPosition:function(){$(window).scrollTop(parseInt(_self.cache.scrollPosition.top)).scrollLeft(parseInt(_self.cache.scrollPosition.left)).resize();},_switchToFullScreenMode:function(){_self.settings.shrinkFactor=1;_self.settings.overlayOpacity=1;$('html').addClass(_self.settings.classPrefix+'fullScreenMode');},_open:function(){_self.isOpen=true;_self.support.transitions=_self.settings.cssTransitions?_self.isTransitionSupported():false;_self.support.mobileDevice=_self.isMobileDevice();if(_self.support.mobileDevice){$('html').addClass(_self.settings.classPrefix+'isMobileDevice');if(_self.settings.fullScreenModeForMobile){_self._switchToFullScreenMode();}}
if(!_self.settings.transitionIn){_self.settings.transitionIn=_self.settings.transition;}
if(!_self.settings.transitionOut){_self.settings.transitionOut=_self.settings.transition;}
switch(_self.settings.transitionIn){case'fade':case'fadeInline':case'elastic':case'scrollTop':case'scrollRight':case'scrollBottom':case'scrollLeft':case'scrollVertical':case'scrollHorizontal':if(_self.objects.case.is(':hidden')){_self.objects.close.css('opacity',0);_self.objects.overlay.css('opacity',0);_self.objects.case.css('opacity',0);_self.objects.contentInner.css('opacity',0);}
_self.transition.fade(_self.objects.overlay,'in',_self.settings.speedIn,_self.settings.overlayOpacity,function(){_self.transition.fade(_self.objects.close,'in',_self.settings.speedIn);_self._handleEvents();_self._processContent();});break;default:_self.transition.fade(_self.objects.overlay,'in',0,_self.settings.overlayOpacity,function(){_self.transition.fade(_self.objects.close,'in',0);_self._handleEvents();_self._processContent();});break;}
$('html').addClass(_self.settings.classPrefix+'open');_self.objects.case.attr('aria-hidden','false');},close:function(){_self.isOpen=false;if(_self.isSlideshowEnabled()){_self._stopTimeout();_self.objects.nav.removeClass(_self.settings.classPrefix+'paused');}
_self.objects.loading.hide();_self._unbindEvents();_self._unwatchResizeInteraction();_self._unwatchScrollInteraction();$('html').removeClass(_self.settings.classPrefix+'open');_self.objects.case.attr('aria-hidden','true');_self.objects.nav.children().hide();_self._restoreScrollPosition();_self._callHooks(_self.settings.onClose);switch(_self.settings.transitionOut){case'fade':case'fadeInline':case'scrollTop':case'scrollRight':case'scrollBottom':case'scrollLeft':case'scrollHorizontal':case'scrollVertical':_self.transition.fade(_self.objects.case,'out',_self.settings.speedOut,0,function(){_self.transition.fade(_self.objects.overlay,'out',_self.settings.speedOut,0,function(){_self.cleanup();});});break;case'elastic':_self.transition.zoom(_self.objects.case,'out',_self.settings.speedOut,function(){_self.transition.fade(_self.objects.overlay,'out',_self.settings.speedOut,0,function(){_self.cleanup();});});break;default:_self.cleanup();break;}},_unbindEvents:function(){_self.objects.overlay.unbind('click');$(document).unbind('keyup.lightcase');_self.objects.case.unbind('swipeleft').unbind('swiperight');_self.objects.prev.unbind('click');_self.objects.next.unbind('click');_self.objects.play.unbind('click');_self.objects.pause.unbind('click');_self.objects.close.unbind('click');},_cleanupDimensions:function(){var opacity=_self.objects.contentInner.css('opacity');_self.objects.case.css({'width':'','height':'','top':'','left':'','margin-top':'','margin-left':''});_self.objects.contentInner.removeAttr('style').css('opacity',opacity);_self.objects.contentInner.children().removeAttr('style');},cleanup:function(){_self._cleanupDimensions();_self.objects.loading.hide();_self.objects.overlay.hide();_self.objects.case.hide();_self.objects.prev.hide();_self.objects.next.hide();_self.objects.play.hide();_self.objects.pause.hide();_self.objects.case.removeAttr(_self._prefixAttributeName('type'));_self.objects.nav.removeAttr(_self._prefixAttributeName('ispartofsequence'));_self.objects.contentInner.empty().hide();_self.objects.info.children().empty();if(_self.cache.originalObject){_self._restoreObject();}
_self._callHooks(_self.settings.onCleanup);_self.cache={};},_matchMedia:function(){return window.matchMedia||window.msMatchMedia;},_devicePixelRatio:function(){return window.devicePixelRatio||1;},_isPublicMethod:function(method){return(typeof _self[method]==='function'&&method.charAt(0)!=='_');},_export:function(){window.lightcase={};$.each(_self,function(property){if(_self._isPublicMethod(property)){lightcase[property]=_self[property];}});}};_self._export();$.fn.lightcase=function(method){if(_self._isPublicMethod(method)){return _self[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return _self.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.lightcase');}};})(jQuery);
;(function($){var plugin={};var defaults={mode:'horizontal',slideSelector:'',infiniteLoop:true,hideControlOnEnd:false,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:false,captions:false,ticker:false,tickerHover:false,adaptiveHeight:false,adaptiveHeightSpeed:500,video:false,useCSS:true,preloadImages:'visible',responsive:true,slideZIndex:50,wrapperClass:'bx-wrapper',touchEnabled:true,swipeThreshold:50,oneToOneTouch:true,preventDefaultSwipeX:true,preventDefaultSwipeY:false,pager:true,pagerType:'full',pagerShortSeparator:' / ',pagerSelector:null,buildPager:null,pagerCustom:null,controls:true,nextText:'Next',prevText:'Prev',nextSelector:null,prevSelector:null,autoControls:false,startText:'Start',stopText:'Stop',autoControlsCombine:false,autoControlsSelector:null,auto:false,pause:4000,autoStart:true,autoDirection:'next',autoHover:false,autoDelay:0,autoSlideForOnePage:false,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}}
$.fn.bxSlider=function(options){if(this.length==0)return this;if(this.length>1){this.each(function(){$(this).bxSlider(options)});return this;}
var slider={};var el=this;plugin.el=this;var windowWidth=$(window).width();var windowHeight=$(window).height();var init=function(){slider.settings=$.extend({},defaults,options);slider.settings.slideWidth=parseInt(slider.settings.slideWidth);slider.children=el.children(slider.settings.slideSelector);if(slider.children.length1||slider.settings.maxSlides>1;if(slider.carousel)slider.settings.preloadImages='all';slider.minThreshold=(slider.settings.minSlides*slider.settings.slideWidth)+((slider.settings.minSlides-1)*slider.settings.slideMargin);slider.maxThreshold=(slider.settings.maxSlides*slider.settings.slideWidth)+((slider.settings.maxSlides-1)*slider.settings.slideMargin);slider.working=false;slider.controls={};slider.interval=null;slider.animProp=slider.settings.mode=='vertical'?'top':'left';slider.usingCSS=slider.settings.useCSS&&slider.settings.mode!='fade'&&(function(){var div=document.createElement('div');var props=['WebkitPerspective','MozPerspective','OPerspective','msPerspective'];for(var i in props){if(div.style[props[i]]!==undefined){slider.cssPrefix=props[i].replace('Perspective','').toLowerCase();slider.animProp='-'+slider.cssPrefix+'-transform';return true;}}
return false;}());if(slider.settings.mode=='vertical')slider.settings.maxSlides=slider.settings.minSlides;el.data("origStyle",el.attr("style"));el.children(slider.settings.slideSelector).each(function(){$(this).data("origStyle",$(this).attr("style"));});setup();}
var setup=function(){el.wrap('');slider.viewport=el.parent();slider.loader=$('
');slider.viewport.prepend(slider.loader);el.css({width:slider.settings.mode=='horizontal'?(slider.children.length*100+215)+'%':'auto',position:'relative'});if(slider.usingCSS&&slider.settings.easing){el.css('-'+slider.cssPrefix+'-transition-timing-function',slider.settings.easing);}else if(!slider.settings.easing){slider.settings.easing='swing';}
var slidesShowing=getNumberSlidesShowing();slider.viewport.css({width:'100%',overflow:'hidden',position:'relative'});slider.viewport.parent().css({maxWidth:getViewportMaxWidth()});if(!slider.settings.pager){slider.viewport.parent().css({margin:'0 auto 0px'});}
slider.children.css({'float':slider.settings.mode=='horizontal'?'left':'none',listStyle:'none',position:'relative'});slider.children.css('width',getSlideWidth());if(slider.settings.mode=='horizontal'&&slider.settings.slideMargin>0)slider.children.css('marginRight',slider.settings.slideMargin);if(slider.settings.mode=='vertical'&&slider.settings.slideMargin>0)slider.children.css('marginBottom',slider.settings.slideMargin);if(slider.settings.mode=='fade'){slider.children.css({position:'absolute',zIndex:0,display:'none'});slider.children.eq(slider.settings.startSlide).css({zIndex:slider.settings.slideZIndex,display:'block'});}
slider.controls.el=$('
');if(slider.settings.captions)appendCaptions();slider.active.last=slider.settings.startSlide==getPagerQty()-1;if(slider.settings.video)el.fitVids();var preloadSelector=slider.children.eq(slider.settings.startSlide);if(slider.settings.preloadImages=="all")preloadSelector=slider.children;if(!slider.settings.ticker){if(slider.settings.pager)appendPager();if(slider.settings.controls)appendControls();if(slider.settings.auto&&slider.settings.autoControls)appendControlsAuto();if(slider.settings.controls||slider.settings.autoControls||slider.settings.pager)slider.viewport.after(slider.controls.el);}else{slider.settings.pager=false;}
loadElements(preloadSelector,start);}
var loadElements=function(selector,callback){var total=selector.find('img, iframe').length;if(total==0){callback();return;}
var count=0;selector.find('img, iframe').each(function(){$(this).one('load',function(){if(++count==total)callback();}).each(function(){if(this.complete)$(this).load();});});}
var start=function(){if(slider.settings.infiniteLoop&&slider.settings.mode!='fade'&&!slider.settings.ticker){var slice=slider.settings.mode=='vertical'?slider.settings.minSlides:slider.settings.maxSlides;var sliceAppend=slider.children.slice(0,slice).clone().addClass('bx-clone');var slicePrepend=slider.children.slice(-slice).clone().addClass('bx-clone');el.append(sliceAppend).prepend(slicePrepend);}
slider.loader.remove();setSlidePosition();if(slider.settings.mode=='vertical')slider.settings.adaptiveHeight=true;slider.viewport.height(getViewportHeight());el.redrawSlider();slider.settings.onSliderLoad(slider.active.index);slider.initialized=true;if(slider.settings.responsive)$(window).bind('resize',resizeWindow);if(slider.settings.auto&&slider.settings.autoStart&&(getPagerQty()>1||slider.settings.autoSlideForOnePage))initAuto();if(slider.settings.ticker)initTicker();if(slider.settings.pager)updatePagerActive(slider.settings.startSlide);if(slider.settings.controls)updateDirectionControls();if(slider.settings.touchEnabled&&!slider.settings.ticker)initTouch();}
var getViewportHeight=function(){var height=0;var children=$();if(slider.settings.mode!='vertical'&&!slider.settings.adaptiveHeight){children=slider.children;}else{if(!slider.carousel){children=slider.children.eq(slider.active.index);}else{var currentIndex=slider.settings.moveSlides==1?slider.active.index:slider.active.index*getMoveBy();children=slider.children.eq(currentIndex);for(i=1;i<=slider.settings.maxSlides-1;i++){if(currentIndex+i>=slider.children.length){children=children.add(slider.children.eq(i-1));}else{children=children.add(slider.children.eq(currentIndex+i));}}}}
if(slider.settings.mode=='vertical'){children.each(function(index){height+=$(this).outerHeight();});if(slider.settings.slideMargin>0){height+=slider.settings.slideMargin*(slider.settings.minSlides-1);}}else{height=Math.max.apply(Math,children.map(function(){return $(this).outerHeight(false);}).get());}
if(slider.viewport.css('box-sizing')=='border-box'){height+=parseFloat(slider.viewport.css('padding-top'))+parseFloat(slider.viewport.css('padding-bottom'))+
parseFloat(slider.viewport.css('border-top-width'))+parseFloat(slider.viewport.css('border-bottom-width'));}else if(slider.viewport.css('box-sizing')=='padding-box'){height+=parseFloat(slider.viewport.css('padding-top'))+parseFloat(slider.viewport.css('padding-bottom'));}
return height;}
var getViewportMaxWidth=function(){var width='100%';if(slider.settings.slideWidth>0){if(slider.settings.mode=='horizontal'){width=(slider.settings.maxSlides*slider.settings.slideWidth)+((slider.settings.maxSlides-1)*slider.settings.slideMargin);}else{width=slider.settings.slideWidth;}}
return width;}
var getSlideWidth=function(){var newElWidth=slider.settings.slideWidth;var wrapWidth=slider.viewport.width();if(slider.settings.slideWidth==0||(slider.settings.slideWidth>wrapWidth&&!slider.carousel)||slider.settings.mode=='vertical'){newElWidth=wrapWidth;}else if(slider.settings.maxSlides>1&&slider.settings.mode=='horizontal'){if(wrapWidth>slider.maxThreshold){}else if(wrapWidth0){if(slider.viewport.width()slider.maxThreshold){slidesShowing=slider.settings.maxSlides;}else{var childWidth=slider.children.first().width()+slider.settings.slideMargin;slidesShowing=Math.floor((slider.viewport.width()+
slider.settings.slideMargin)/childWidth);}}else if(slider.settings.mode=='vertical'){slidesShowing=slider.settings.minSlides;}
return slidesShowing;}
var getPagerQty=function(){var pagerQty=0;if(slider.settings.moveSlides>0){if(slider.settings.infiniteLoop){pagerQty=Math.ceil(slider.children.length/getMoveBy());}else{var breakPoint=0;var counter=0
while(breakPoint0&&slider.settings.moveSlides<=getNumberSlidesShowing()){return slider.settings.moveSlides;}
return getNumberSlidesShowing();}
var setSlidePosition=function(){if(slider.children.length>slider.settings.maxSlides&&slider.active.last&&!slider.settings.infiniteLoop){if(slider.settings.mode=='horizontal'){var lastChild=slider.children.last();var position=lastChild.position();setPositionProperty(-(position.left-(slider.viewport.width()-lastChild.outerWidth())),'reset',0);}else if(slider.settings.mode=='vertical'){var lastShowingIndex=slider.children.length-slider.settings.minSlides;var position=slider.children.eq(lastShowingIndex).position();setPositionProperty(-position.top,'reset',0);}}else{var position=slider.children.eq(slider.active.index*getMoveBy()).position();if(slider.active.index==getPagerQty()-1)slider.active.last=true;if(position!=undefined){if(slider.settings.mode=='horizontal')setPositionProperty(-position.left,'reset',0);else if(slider.settings.mode=='vertical')setPositionProperty(-position.top,'reset',0);}}}
var setPositionProperty=function(value,type,duration,params){if(slider.usingCSS){var propValue=slider.settings.mode=='vertical'?'translate3d(0, '+value+'px, 0)':'translate3d('+value+'px, 0, 0)';el.css('-'+slider.cssPrefix+'-transition-duration',duration/1000+'s');if(type=='slide'){el.css(slider.animProp,propValue);el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd',function(){el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');updateAfterSlideTransition();});}else if(type=='reset'){el.css(slider.animProp,propValue);}else if(type=='ticker'){el.css('-'+slider.cssPrefix+'-transition-timing-function','linear');el.css(slider.animProp,propValue);el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd',function(){el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');setPositionProperty(params['resetValue'],'reset',0);tickerLoop();});}}else{var animateObj={};animateObj[slider.animProp]=value;if(type=='slide'){el.animate(animateObj,duration,slider.settings.easing,function(){updateAfterSlideTransition();});}else if(type=='reset'){el.css(slider.animProp,value)}else if(type=='ticker'){el.animate(animateObj,speed,'linear',function(){setPositionProperty(params['resetValue'],'reset',0);tickerLoop();});}}}
var populatePager=function(){var pagerHtml='';var pagerQty=getPagerQty();for(var i=0;i