");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var S,B="ajax",L=function(){S&&e(document.body).removeClass(S)},j=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(B,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){t.types.push(B),S=t.st.ajax.cursor,w(s+"."+B,j),w("BeforeChange."+B,j)},getAjax:function(n){S&&e(document.body).addClass(S),t.updateStatus("loading");var i=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};C("ParseAjax",a),t.appendContent(e(a.data),B),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(m)},16),t.updateStatus("ready"),C("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(i),""}}});var z,A=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.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 n=t.st.image,i=".image";t.types.push("image"),w(l+i,function(){"image"===t.currItem.type&&n.cursor&&e(document.body).addClass(n.cursor)}),w(s+i,function(){n.cursor&&e(document.body).removeClass(n.cursor),b.off("resize"+p)}),w("Resize"+i,t.resizeImage),t.isLowIE&&w("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,z&&clearInterval(z),e.isCheckingImgSize=!1,C("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){z&&clearInterval(z),z=setInterval(function(){return i.naturalWidth>0?void t._onImageHasSize(e):(n>200&&clearInterval(z),n++,void(3===n?o(10):40===n?o(50):100===n&&o(500)))},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,C("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,c=i.find(".mfp-img");if(c.length){var u=document.createElement("img");u.className="mfp-img",n.el&&n.el.find("img").length&&(u.alt=n.el.find("img").attr("alt")),n.img=e(u).on("load.mfploader",r).on("error.mfploader",a),u.src=n.src,c.is("img")&&(n.img=n.img.clone()),u=n.img[0],u.naturalWidth>0?n.hasSize=!0:u.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:A(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(z&&clearInterval(z),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var F,H=function(){return void 0===F&&(F=void 0!==document.createElement("p").style.MozTransform),F};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,u=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},l=function(){t.content.css("visibility","visible")};w("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void l();r=u(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){l(),setTimeout(function(){r.remove(),e=r=null,C("ZoomAnimationEnded")},16)},a)},16)}}),w(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(!(e=t._getItemToZoom()))return;r=u(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),w(s+i,function(){t._allowZoom()&&(l(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(y?i.innerHeight():i[0].offsetHeight)-a-r};return H()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var N="iframe",Q=function(e){if(t.currTemplate[N]){var n=t.currTemplate[N].find("iframe");n.length&&(e||(n[0].src="//about:blank"),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(N,{options:{markup:'
',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(){t.types.push(N),w("BeforeChange",function(e,t,n){t!==n&&(t===N?Q():n===N&&Q(!0))}),w(s+"."+N,function(){Q()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var q=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},W=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'
',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,o=".mfp-gallery",a=Boolean(e.fn.mfpFastClick);return t.direction=!0,!(!n||!n.enabled)&&(r+=" mfp-gallery",w(l+o,function(){n.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),i.on("keydown"+o,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),w("UpdateStatus"+o,function(e,n){n.text&&(n.text=W(n.text,t.currItem.index,t.items.length))}),w(u+o,function(e,i,o,r){var a=t.items.length;o.counter=a>1?W(n.tCounter,r.index,a):""}),w("BuildControls"+o,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(g),r=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(g),s=a?"mfpFastClick":"click";o[s](function(){t.prev()}),r[s](function(){t.next()}),t.isIE7&&(I("b",o[0],!1,!0),I("a",o[0],!1,!0),I("b",r[0],!1,!0),I("a",r[0],!1,!0)),t.container.append(o.add(r))}}),w(d+o,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void w(s+o,function(){i.off(o),t.wrap.off("click"+o),t.arrowLeft&&a&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=q(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=q(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?o:i);e++)t._preloadItem(t.index+e)
;for(e=1;e<=(t.direction?i:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=q(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),C("LazyLoad",i),"image"===i.type&&(i.img=e('
').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,C("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var D="retina";e.magnificPopup.registerModule(D,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;(n=isNaN(n)?n():n)>1&&(w("ImageHasSize."+D,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),w("ElementParse."+D,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t="ontouchstart"in window,n=function(){b.off("touchmove"+i+" touchend"+i)},i=".mfpFastClick";e.fn.mfpFastClick=function(o){return e(this).each(function(){var r,a=e(this);if(t){var s,c,u,l,d,f;a.on("touchstart"+i,function(e){l=!1,f=1,d=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=d.clientX,u=d.clientY,b.on("touchmove"+i,function(e){d=e.originalEvent?e.originalEvent.touches:e.touches,f=d.length,d=d[0],(Math.abs(d.clientX-c)>10||Math.abs(d.clientY-u)>10)&&(l=!0,n())}).on("touchend"+i,function(e){n(),l||f>1||(r=!0,e.preventDefault(),clearTimeout(s),s=setTimeout(function(){r=!1},1e3),o())})})}a.on("click"+i,function(){r||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+i+" click"+i),t&&b.off("touchmove"+i+" touchend"+i)}}(),k()});
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ScrollMagic=t()}(this,function(){"use strict";var e=function(){};e.version="2.0.5",window.addEventListener("mousewheel",function(){},{passive:!0});var t="data-scrollmagic-pin-spacer";e.Controller=function(r){var o,s,a="ScrollMagic.Controller",l="FORWARD",c="REVERSE",f="PAUSED",u=n.defaults,d=this,h=i.extend({},u,r),p=[],g=!1,v=0,m=f,w=!0,y=0,S=!0,b=function(){for(var e in h)u.hasOwnProperty(e)||delete h[e];if(h.container=i.get.elements(h.container)[0],!h.container)throw a+" init failed.";w=h.container===window||h.container===document.body||!document.body.contains(h.container),w&&(h.container=window),y=z(),h.container.addEventListener("resize",T,{passive:!0}),h.container.addEventListener("scroll",T,{passive:!0});var t=parseInt(h.refreshInterval,10);h.refreshInterval=i.type.Number(t)?t:u.refreshInterval,E()},E=function(){h.refreshInterval>0&&(s=window.setTimeout(A,h.refreshInterval))},x=function(){return h.vertical?i.get.scrollTop(h.container):i.get.scrollLeft(h.container)},z=function(){return h.vertical?i.get.height(h.container):i.get.width(h.container)},C=this._setScrollPos=function(e){h.vertical?w?window.scrollTo(i.get.scrollLeft(),e):h.container.scrollTop=e:w?window.scrollTo(e,i.get.scrollTop()):h.container.scrollLeft=e},F=function(){if(S&&g){var e=i.type.Array(g)?g:p.slice(0);g=!1;var t=v;v=d.scrollPos();var n=v-t;0!==n&&(m=n>0?l:c),m===c&&e.reverse(),e.forEach(function(e,t){e.update(!0)})}},L=function(){o=i.rAF(F)},T=function(e){"resize"==e.type&&(y=z(),m=f),g!==!0&&(g=!0,L())},A=function(){if(!w&&y!=z()){var e;try{e=new Event("resize",{bubbles:!1,cancelable:!1})}catch(t){e=document.createEvent("Event"),e.initEvent("resize",!1,!1)}h.container.dispatchEvent(e)}p.forEach(function(e,t){e.refresh()}),E()};this._options=h;var N=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t};return this.addScene=function(t){if(i.type.Array(t))t.forEach(function(e,t){d.addScene(e)});else if(t instanceof e.Scene)if(t.controller()!==d)t.addTo(d);else if(p.indexOf(t)<0){p.push(t),p=N(p),t.on("shift.controller_sort",function(){p=N(p)});for(var n in h.globalSceneOptions)t[n]&&t[n].call(t,h.globalSceneOptions[n])}return d},this.removeScene=function(e){if(i.type.Array(e))e.forEach(function(e,t){d.removeScene(e)});else{var t=p.indexOf(e);t>-1&&(e.off("shift.controller_sort"),p.splice(t,1),e.remove())}return d},this.updateScene=function(t,n){return i.type.Array(t)?t.forEach(function(e,t){d.updateScene(e,n)}):n?t.update(!0):g!==!0&&t instanceof e.Scene&&(g=g||[],g.indexOf(t)==-1&&g.push(t),g=N(g),L()),d},this.update=function(e){return T({type:"resize"}),e&&F(),d},this.scrollTo=function(n,r){if(i.type.Number(n))C.call(h.container,n,r);else if(n instanceof e.Scene)n.controller()===d&&d.scrollTo(n.scrollOffset(),r);else if(i.type.Function(n))C=n;else{var o=i.get.elements(n)[0];if(o){for(;o.parentNode.hasAttribute(t);)o=o.parentNode;var s=h.vertical?"top":"left",a=i.get.offset(h.container),l=i.get.offset(o);w||(a[s]-=d.scrollPos()),d.scrollTo(l[s]-a[s],r)}}return d},this.scrollPos=function(e){return arguments.length?(i.type.Function(e)&&(x=e),d):x.call(d)},this.info=function(e){var t={size:y,vertical:h.vertical,scrollPos:v,scrollDirection:m,container:h.container,isDocument:w};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return d},this.enabled=function(e){return arguments.length?(S!=e&&(S=!!e,d.updateScene(p,!0)),d):S},this.destroy=function(e){window.clearTimeout(s);for(var t=p.length;t--;)p[t].destroy(e);return h.container.removeEventListener("resize",T,{passive:!0}),h.container.removeEventListener("scroll",T,{passive:!0}),i.cAF(o),null},b(),d};var n={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};e.Controller.addOption=function(e,t){n.defaults[e]=t},e.Controller.extend=function(t){var n=this;e.Controller=function(){return n.apply(this,arguments),this.$super=i.extend({},this),t.apply(this,arguments)||this},i.extend(e.Controller,n),e.Controller.prototype=n.prototype,e.Controller.prototype.constructor=e.Controller},e.Scene=function(n){var o,s,a="BEFORE",l="DURING",c="AFTER",f=r.defaults,u=this,d=i.extend({},f,n),h=a,p=0,g={start:0,end:0},v=0,m=!0,w=function(){for(var e in d)f.hasOwnProperty(e)||delete d[e];for(var t in f)L(t);C()},y={};this.on=function(e,t){return i.type.Function(t)&&(e=e.trim().split(" "),e.forEach(function(e){var n=e.split("."),r=n[0],i=n[1];"*"!=r&&(y[r]||(y[r]=[]),y[r].push({namespace:i||"",callback:t}))})),u},this.off=function(e,t){return e?(e=e.trim().split(" "),e.forEach(function(e,n){var r=e.split("."),i=r[0],o=r[1]||"",s="*"===i?Object.keys(y):[i];s.forEach(function(e){for(var n=y[e]||[],r=n.length;r--;){var i=n[r];!i||o!==i.namespace&&"*"!==o||t&&t!=i.callback||n.splice(r,1)}n.length||delete y[e]})}),u):u},this.trigger=function(t,n){if(t){var r=t.trim().split("."),i=r[0],o=r[1],s=y[i];s&&s.forEach(function(t,r){o&&o!==t.namespace||t.callback.call(u,new e.Event(i,t.namespace,u,n))})}return u},u.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?E():"reverse"===e.what&&u.update())}).on("shift.internal",function(e){S(),u.update()}),this.addTo=function(t){return t instanceof e.Controller&&s!=t&&(s&&s.removeScene(u),s=t,C(),b(!0),E(!0),S(),s.info("container").addEventListener("resize",x,{passive:!0}),t.addScene(u),u.trigger("add",{controller:s}),u.update()),u},this.enabled=function(e){return arguments.length?(m!=e&&(m=!!e,u.update(!0)),u):m},this.remove=function(){if(s){s.info("container").removeEventListener("resize",x,{passive:!0});var e=s;s=void 0,e.removeScene(u),u.trigger("remove")}return u},this.destroy=function(e){return u.trigger("destroy",{reset:e}),u.remove(),u.off("*.*"),null},this.update=function(e){if(s)if(e)if(s.enabled()&&m){var t,n=s.info("scrollPos");t=d.duration>0?(n-g.start)/(g.end-g.start):n>=g.start?1:0,u.trigger("update",{startPos:g.start,endPos:g.end,scrollPos:n}),u.progress(t)}else T&&h===l&&N(!0);else s.updateScene(u,!1);return u},this.refresh=function(){return b(),E(),u},this.progress=function(e){if(arguments.length){var t=!1,n=h,r=s?s.info("scrollDirection"):"PAUSED",i=d.reverse||e>=p;if(0===d.duration?(t=p!=e,p=e<1&&i?0:1,h=0===p?a:l):e<0&&h!==a&&i?(p=0,h=a,t=!0):e>=0&&e<1&&i?(p=e,h=l,t=!0):e>=1&&h!==c?(p=1,h=c,t=!0):h!==l||i||N(),t){var o={progress:p,state:h,scrollDirection:r},f=h!=n,g=function(e){u.trigger(e,o)};f&&n!==l&&(g("enter"),g(n===a?"start":"end")),g("progress"),f&&h!==l&&(g(h===a?"start":"end"),g("leave"))}return u}return p};var S=function(){g={start:v+d.offset},s&&d.triggerElement&&(g.start-=s.info("size")*d.triggerHook),g.end=g.start+d.duration},b=function(e){if(o){var t="duration";F(t,o.call(u))&&!e&&(u.trigger("change",{what:t,newval:d[t]}),u.trigger("shift",{reason:t}))}},E=function(e){var n=0,r=d.triggerElement;if(s&&(r||v>0)){if(r)if(r.parentNode){for(var o=s.info(),a=i.get.offset(o.container),l=o.vertical?"top":"left";r.parentNode.hasAttribute(t);)r=r.parentNode;var c=i.get.offset(r);o.isDocument||(a[l]-=s.scrollPos()),n=c[l]-a[l]}else u.triggerElement(void 0);var f=n!=v;v=n,f&&!e&&u.trigger("shift",{reason:"triggerElementPosition"})}},x=function(e){d.triggerHook>0&&u.trigger("shift",{reason:"containerResize"})},z=i.extend(r.validate,{duration:function(e){if(i.type.String(e)&&e.match(/^(\.|\d)*\d+%$/)){var t=parseFloat(e)/100;e=function(){return s?s.info("size")*t:0}}if(i.type.Function(e)){o=e;try{e=parseFloat(o())}catch(t){e=-1}}if(e=parseFloat(e),!i.type.Number(e)||e<0)throw o?(o=void 0,0):0;return e}}),C=function(e){e=arguments.length?[e]:Object.keys(z),e.forEach(function(e,t){var n;if(z[e])try{n=z[e](d[e])}catch(t){n=f[e]}finally{d[e]=n}})},F=function(e,t){var n=!1,r=d[e];return d[e]!=t&&(d[e]=t,C(e),n=r!=d[e]),n},L=function(e){u[e]||(u[e]=function(t){return arguments.length?("duration"===e&&(o=void 0),F(e,t)&&(u.trigger("change",{what:e,newval:d[e]}),r.shifts.indexOf(e)>-1&&u.trigger("shift",{reason:e})),u):d[e]})};this.controller=function(){return s},this.state=function(){return h},this.scrollOffset=function(){return g.start},this.triggerPosition=function(){var e=d.offset;return s&&(e+=d.triggerElement?v:s.info("size")*u.triggerHook()),e};var T,A;u.on("shift.internal",function(e){var t="duration"===e.reason;(h===c&&t||h===l&&0===d.duration)&&N(),t&&O()}).on("progress.internal",function(e){N()}).on("add.internal",function(e){O()}).on("destroy.internal",function(e){u.removePin(e.reset)});var N=function(e){if(T&&s){var t=s.info(),n=A.spacer.firstChild;if(e||h!==l){var r={position:A.inFlow?"relative":"absolute",top:0,left:0},o=i.css(n,"position")!=r.position;A.pushFollowers?d.duration>0&&(h===c&&0===parseFloat(i.css(A.spacer,"padding-top"))?o=!0:h===a&&0===parseFloat(i.css(A.spacer,"padding-bottom"))&&(o=!0)):r[t.vertical?"top":"left"]=d.duration*p,i.css(n,r),o&&O()}else{"fixed"!=i.css(n,"position")&&(i.css(n,{position:"fixed"}),O());var f=i.get.offset(A.spacer,!0),u=d.reverse||0===d.duration?t.scrollPos-g.start:Math.round(p*d.duration*10)/10;f[t.vertical?"top":"left"]+=u,i.css(A.spacer.firstChild,{top:f.top,left:f.left})}}},O=function(){if(T&&s&&A.inFlow){var e=h===l,t=s.info("vertical"),n=A.spacer.firstChild,r=i.isMarginCollapseType(i.css(A.spacer,"display")),o={};A.relSize.width||A.relSize.autoFullWidth?e?i.css(T,{width:i.get.width(A.spacer)}):i.css(T,{width:"100%"}):(o["min-width"]=i.get.width(t?T:n,!0,!0),o.width=e?o["min-width"]:"auto"),A.relSize.height?e?i.css(T,{height:i.get.height(A.spacer)-(A.pushFollowers?d.duration:0)}):i.css(T,{height:"100%"}):(o["min-height"]=i.get.height(t?n:T,!0,!r),o.height=e?o["min-height"]:"auto"),A.pushFollowers&&(o["padding"+(t?"Top":"Left")]=d.duration*p,o["padding"+(t?"Bottom":"Right")]=d.duration*(1-p)),i.css(A.spacer,o)}},_=function(){s&&T&&h===l&&!s.info("isDocument")&&N()},P=function(){s&&T&&h===l&&((A.relSize.width||A.relSize.autoFullWidth)&&i.get.width(window)!=i.get.width(A.spacer.parentNode)||A.relSize.height&&i.get.height(window)!=i.get.height(A.spacer.parentNode))&&O()},D=function(e){s&&T&&h===l&&!s.info("isDocument")&&(e.preventDefault(),s._setScrollPos(s.info("scrollPos")-((e.wheelDelta||e[s.info("vertical")?"wheelDeltaY":"wheelDeltaX"])/3||30*-e.detail)))};this.setPin=function(e,n){var r={pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"};if(n=i.extend({},r,n),e=i.get.elements(e)[0],!e)return u;if("fixed"===i.css(e,"position"))return u;if(T){if(T===e)return u;u.removePin()}T=e;var o=T.parentNode.style.display,s=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];T.parentNode.style.display="none";var a="absolute"!=i.css(T,"position"),l=i.css(T,s.concat(["display"])),c=i.css(T,["width","height"]);T.parentNode.style.display=o,!a&&n.pushFollowers&&(n.pushFollowers=!1);var f=T.parentNode.insertBefore(document.createElement("div"),T),d=i.extend(l,{position:a?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});if(a||i.extend(d,i.css(T,["width","height"])),i.css(f,d),f.setAttribute(t,""),i.addClass(f,n.spacerClass),A={spacer:f,relSize:{width:"%"===c.width.slice(-1),height:"%"===c.height.slice(-1),autoFullWidth:"auto"===c.width&&a&&i.isMarginCollapseType(l.display)},pushFollowers:n.pushFollowers,inFlow:a},!T.___origStyle){T.___origStyle={};var h=T.style,p=s.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]);p.forEach(function(e){T.___origStyle[e]=h[e]||""})}return A.relSize.width&&i.css(f,{width:c.width}),A.relSize.height&&i.css(f,{height:c.height}),f.appendChild(T),i.css(T,{position:a?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(A.relSize.width||A.relSize.autoFullWidth)&&i.css(T,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",_,{passive:!0}),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("resize",P,{passive:!0}),T.addEventListener("mousewheel",D),T.addEventListener("DOMMouseScroll",D),N(),u},this.removePin=function(e){if(T){if(h===l&&N(!0),e||!s){var n=A.spacer.firstChild;if(n.hasAttribute(t)){var r=A.spacer.style,o=["margin","marginLeft","marginRight","marginTop","marginBottom"];margins={},o.forEach(function(e){margins[e]=r[e]||""}),i.css(n,margins)}A.spacer.parentNode.insertBefore(n,A.spacer),A.spacer.parentNode.removeChild(A.spacer),T.parentNode.hasAttribute(t)||(i.css(T,T.___origStyle),delete T.___origStyle)}window.removeEventListener("scroll",_,{passive:!0}),window.removeEventListener("resize",_,{passive:!0}),window.removeEventListener("resize",P,{passive:!0}),T.removeEventListener("mousewheel",D),T.removeEventListener("DOMMouseScroll",D),T=void 0}return u};var R,k=[];return u.on("destroy.internal",function(e){u.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=i.get.elements(e);return 0!==n.length&&i.type.String(t)?(k.length>0&&u.removeClassToggle(),R=t,k=n,u.on("enter.internal_class leave.internal_class",function(e){var t="enter"===e.type?i.addClass:i.removeClass;k.forEach(function(e,n){t(e,R)})}),u):u},this.removeClassToggle=function(e){return e&&k.forEach(function(e,t){i.removeClass(e,R)}),u.off("start.internal_class end.internal_class"),R=void 0,k=[],u},w(),u};var r={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!i.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=i.get.elements(e)[0];if(!t||!t.parentNode)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(i.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};e.Scene.addOption=function(e,t,n,i){e in r.defaults||(r.defaults[e]=t,r.validate[e]=n,i&&r.shifts.push(e))},e.Scene.extend=function(t){var n=this;e.Scene=function(){return n.apply(this,arguments),this.$super=i.extend({},this),t.apply(this,arguments)||this},i.extend(e.Scene,n),e.Scene.prototype=n.prototype,e.Scene.prototype.constructor=e.Scene},e.Event=function(e,t,n,r){r=r||{};for(var i in r)this[i]=r[i];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var i=e._util=function(e){var t,n={},r=function(e){return parseFloat(e)||0},i=function(t){return t.currentStyle?t.currentStyle:e.getComputedStyle(t)},o=function(t,n,o,s){if(n=n===document?e:n,n===e)s=!1;else if(!u.DomElement(n))return 0;t=t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();var a=(o?n["offset"+t]||n["outer"+t]:n["client"+t]||n["inner"+t])||0;if(o&&s){var l=i(n);a+="Height"===t?r(l.marginTop)+r(l.marginBottom):r(l.marginLeft)+r(l.marginRight)}return a},s=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};n.extend=function(e){for(e=e||{},t=1;t
-1};var a=0,l=["ms","moz","webkit","o"],c=e.requestAnimationFrame,f=e.cancelAnimationFrame;for(t=0;!c&&t=0},u.DomElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var d=n.get={};return d.elements=function(t){var n=[];if(u.String(t))try{t=document.querySelectorAll(t)}catch(e){return n}if("nodelist"===u(t)||u.Array(t))for(var r=0,i=n.length=t.length;re?(n&&(clearTimeout(n),n=null),l=d,r=t.apply(s,a),n||(s=a=null)):n||!1===o.trailing||(n=setTimeout(h,c)),r};return d.cancel=function(){clearTimeout(n),l=0,n=s=a=null},d},this.helpers.debounce=function(t,e,i){var o;return function(){var n=this,s=arguments,a=i&&!o;clearTimeout(o),o=setTimeout(function(){o=null,i||t.apply(n,s)},e),a&&t.apply(n,s)}},this.helpers.isInViewport=function(t){var e=t.getBoundingClientRect(),i=document.documentElement,o=.75*e.height;return e.top>=-o&&e.bottom<=(window.innerHeight||i.clientHeight)+o},this.helpers.date_now=Date.now||function(){return(new Date).getTime()},this.helpers.hasTouch="object"==typeof Modernizr&&Modernizr.touchevents||!1,this.helpers.hasTouchMobile=this.helpers.hasTouch&&window.matchMedia("(max-width: 1024px)").matches,this.helpers.ua=navigator.userAgent||"",this.helpers.is_mobile_ie=-1!==this.helpers.ua.indexOf("IEMobile"),this.helpers.is_firefox=-1!==this.helpers.ua.indexOf("Firefox"),this.helpers.isAtLeastIE11=!(!this.helpers.ua.match(/Trident/)||this.helpers.ua.match(/MSIE/)),this.helpers.isIE11=!(!this.helpers.ua.match(/Trident/)||!this.helpers.ua.match(/rv[ :]11/)),this.helpers.isMac=/^Mac/.test(navigator.platform),this.helpers.is_safari=/^((?!chrome|android).)*safari/i.test(this.helpers.ua),this.helpers.isIE10=navigator.userAgent.match("MSIE 10"),this.helpers.isIE9=navigator.userAgent.match("MSIE 9"),this.helpers.is_EDGE=/Edge\/12./i.test(this.helpers.ua),this.helpers.is_pb=!this.helpers.is_undefined(t.ZnPbFactory);var o=t("body");this.helpers.is_EDGE&&o.addClass("is-edge"),this.helpers.isIE11&&o.addClass("is-ie11"),this.helpers.is_safari&&o.addClass("is-safari")},contact_forms:function(e){var i=this;(e?e.find(".zn-contactForm"):t(".zn-contactForm")).each(function(e,o){var n=t(o),s=n.find(".zn-formItem-field--timepicker"),a=n.find(".zn-formItem-field--datepicker"),r=a.is("[data-datepickerlang]")?a.attr("data-datepickerlang"):"",l=a.is("[data-dateformat]")?a.attr("data-dateformat"):"yy-mm-dd",h=s.is("[data-timeformat]")?s.attr("data-timeformat"):"h:i A";s.length>0&&s.timepicker({timeFormat:h,className:"cf-elm-tp"}),a.length>0&&(a.datepicker({dateFormat:l,showOtherMonths:!0}).datepicker("widget").wrap(''),""!==r&&t.datepicker.setDefaults(t.datepicker.regional[r])),n.on("submit",function(e){if(e.preventDefault(),!0===i.form_submitting)return!1;i.form_submitting=!0;var o=t(this),n=o.find(".zn_contact_ajax_response:eq(0)"),s=!1,a={fields:o.find('textarea, select, input[type="text"], input[type="checkbox"], input[type="hidden"]')},r=n.attr("id"),l=o.find(".zn-formSubmit");if((i.helpers.isIE11||i.helpers.isIE10||i.helpers.isIE9)&&o.is('[action="#"]')&&o.attr("action",""),l.addClass("zn-contactForm--loading"),a.fields.each(function(){var e=t(this),i=e.parent();e.is(":checkbox")&&(e.is(":checked")?e.val(!0):e.val("")),i.removeClass("zn-formItem--invalid"),e.hasClass("zn_validate_not_empty")?e.is(":checkbox")?e.is(":checked")||(i.addClass("zn-formItem--invalid"),s=!0):""===e.val()&&(i.addClass("zn-formItem--invalid"),s=!0):e.hasClass("zn_validate_is_email")?e.val().match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)||(i.addClass("zn-formItem--invalid"),s=!0):e.hasClass("zn_validate_is_numeric")&&isNaN(e.val())&&(i.addClass("zn-formItem--invalid"),s=!0)}),s)return l.removeClass("zn-contactForm--loading"),i.form_submitting=!1,!1;var h=o.serialize();return t.post(o.attr("action"),h).success(function(e){i.form_submitting=!1,l.removeClass("zn-contactForm--loading");var n=t(e).find("#"+r+" > .zn_cf_response"),s=t("#"+r),h=o.data("redirect");s.html(n),n.hasClass("alert-success")&&(a.fields.val(""),h&&window.location.replace(h))}).error(function(){console.log("Error loading page")}),!1})})},background_video:function(e){var i=this,o=e.find(".zn-videoBg:not(.zn-videoBg--no-init)");o.length&&o.each(function(e,o){var n=t(o),s=n.is("[data-video-setup]")&&i.helpers.IsJsonString(n.attr("data-video-setup"))?JSON.parse(n.attr("data-video-setup")):{};if("undefined"!=typeof video_background)new video_background(n,s)})},doParallax:function(e){var i=this,o=t(".js-znParallax",t(e));o.length>0&&!i.helpers.hasTouchMobile&&void 0!==t.fn.znParallax&&o.znParallax()},doObjectParallax:function(e){var i=this;if(t(".js-doObjParallax",t(e)).length>0&&!i.helpers.hasTouchMobile&&!i.helpers.is_mobile_ie&&"undefined"!=typeof Rellax)new Rellax(".js-doObjParallax")},entryAnimations:function(e){var i=this,o=t(e).find(".zn-animateInViewport"),n=[];o.length>0&&o.each(function(e,o){function s(){t(o).parent().hasClass("eluida7543286")&&console.log(i.helpers.isInViewport(o)),!n[e]&&i.helpers.isInViewport(o)&&(a.removeClass("zn-animateInViewport").addClass("is-animating"),n[e]=!0)}var a=t(o);a.css("animation-delay",a.attr("data-anim-delay")),s(),t(window).on("scroll",s)})},objectFitCover:function(e){function i(t,e,i){if(!t||!e)return!1;var o=e.naturalHeight||e.videoHeight,n=!1;(e.naturalWidth||e.videoWidth)/o>=t.offsetWidth/t.offsetHeight&&(n=!0),i&&(n=!n),n?(e.style.height="100%",e.style.width="auto"):(e.style.height="auto",e.style.width="100%")}function o(t,e){var i=window.getComputedStyle(t);"hidden"!==i.overflow&&(t.style.overflow="hidden"),"relative"!==i.position&&"absolute"!==i.position&&"fixed"!==i.position&&(t.style.position="relative"),e.style.position="absolute",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%,-50%)"}function n(t){for(var e=document.getElementsByClassName(t),n=0;n3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.close=function(e){function o(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=(s=n.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t("#"===s?[]:s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i).prop(i,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target).closest(".btn");e.call(o,"toggle"),t(i.target).is('input[type="radio"], input[type="checkbox"]')||(i.preventDefault(),o.is("input,button")?o.trigger("focus"):o.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=(i=e.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(o).remove(),t(n).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}var o=".dropdown-backdrop",n='[data-toggle="dropdown"]',s=function(e){t(e).on("click.bs.dropdown",this.toggle)};s.VERSION="3.3.7",s.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(t.Event("shown.bs.dropdown",r))}return!1}},s.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var s=e(o),a=s.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&s.find(n).trigger("focus"),o.trigger("click");var r=s.find(".dropdown-menu li:not(.disabled):visible a");if(r.length){var l=r.index(i.target);38==i.which&&l>0&&l--,40==i.which&&l ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},e.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.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 n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return(e=t.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)}},e.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)}},e.prototype.show=function(){var i=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(i);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(i.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),c=s[0].offsetWidth,p=s[0].offsetHeight;if(h){var u=r,f=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+p>f.bottom?"top":"top"==r&&d.top-p