2 lines
No EOL
31 KiB
JavaScript
2 lines
No EOL
31 KiB
JavaScript
$(document).ready(function(){$("#main").fitVids(),$(".sticky").Stickyfill(),$("a").smoothScroll({offset:-20}),$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif']").addClass("image-popup"),$(".image-popup").magnificPopup({disableOn:function(){return!($(window).width()<500)},type:"image",tLoading:"Loading image #%curr%...",gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1]},image:{tError:'<a href="%url%">Image #%curr%</a> could not be loaded.'},removalDelay:500,mainClass:"mfp-zoom-in",callbacks:{beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")}},closeOnContentClick:!0,midClick:!0})}),function(e){"use strict";e.fn.fitVids=function(t){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var o=document.head||document.getElementsByTagName("head")[0],n=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",r=document.createElement("div");r.innerHTML='<p>x</p><style id="fit-vids-style">'+n+"</style>",o.appendChild(r.childNodes[1])}return t&&e.extend(i,t),this.each(function(){var t=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&t.push(i.customSelector);var o=".fitvidsignore";i.ignore&&(o=o+", "+i.ignore);var n=e(this).find(t.join(","));n=n.not("object object"),n=n.not(o),n.each(function(t){var i=e(this);if(!(i.parents(o).length>0||"embed"===this.tagName.toLowerCase()&&i.parent("object").length||i.parent(".fluid-width-video-wrapper").length)){i.css("height")||i.css("width")||!isNaN(i.attr("height"))&&!isNaN(i.attr("width"))||(i.attr("height",9),i.attr("width",16));var n="object"===this.tagName.toLowerCase()||i.attr("height")&&!isNaN(parseInt(i.attr("height"),10))?parseInt(i.attr("height"),10):i.height(),r=isNaN(parseInt(i.attr("width"),10))?i.width():parseInt(i.attr("width"),10),a=n/r;if(!i.attr("id")){var s="fitvid"+t;i.attr("id",s)}i.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*a+"%"),i.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto),function(e){var t,i,o,n,r,a,s,l="Close",c="BeforeClose",d="AfterClose",f="BeforeAppend",p="MarkupParse",u="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",w="mfp-removing",y="mfp-prevent-close",b=function(){},C=!!window.jQuery,x=e(window),k=function(e,i){t.ev.on(g+e+h,i)},I=function(t,i,o,n){var r=document.createElement("div");return r.className="mfp-"+t,o&&(r.innerHTML=o),n?i&&i.appendChild(r):(r=e(r),i&&r.appendTo(i)),r},S=function(i,o){t.ev.triggerHandler(g+i,o),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(o)?o:[o]))},T=function(i){return i===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=i),t.currTemplate.closeBtn},E=function(){e.magnificPopup.instance||(t=new b,t.init(),e.magnificPopup.instance=t)},O=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};b.prototype={constructor:b,init:function(){var i=navigator.appVersion;t.isIE7=-1!==i.indexOf("MSIE 7."),t.isIE8=-1!==i.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=O(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document),t.popupsCache={}},open:function(i){o||(o=e(document.body));var r;if(i.isObj===!1){t.items=i.items.toArray(),t.index=0;var s,l=i.items;for(r=0;r<l.length;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===i.el[0]){t.index=r;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],a="",i.mainEl&&i.mainEl.length?t.ev=i.mainEl.eq(0):t.ev=n,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=I("bg").on("click"+h,function(){t.close()}),t.wrap=I("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=I("container",t.wrap)),t.contentContainer=I("content"),t.st.preloader&&(t.preloader=I("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;r<c.length;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}S("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(k(p,function(e,t,i,o){i.close_replaceWith=T(o.type)}),a+=" mfp-close-btn-in"):t.wrap.append(T())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:x.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:n.height(),position:"absolute"}),t.st.enableEscapeKey&&n.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),x.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var f=t.wH=x.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(f)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var w=t.st.mainClass;return t.isIE7&&(w+=" mfp-ie7"),w&&t._addClassToMFP(w),t.updateItemHTML(),S("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||o),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),n.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(f),S(u),i},close:function(){t.isOpen&&(S(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(w),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){S(l);var i=w+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={marginRight:""};t.isIE7?e("body, html").css("overflow",""):o.overflow="",e("html").css(o)}n.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,S(d)},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,o=window.innerHeight*i;t.wrap.css("height",o),t.wH=o}else t.wH=e||x.height();t.fixedContentPos||t.wrap.css("height",t.wH),S("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var o=i.type;if(S("BeforeChange",[t.currItem?t.currItem.type:"",o]),t.currItem=i,!t.currTemplate[o]){var n=t.st[o]?t.st[o].markup:!1;S("FirstMarkupParse",n),n?t.currTemplate[o]=e(n):t.currTemplate[o]=!0}r&&r!==i.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+o.charAt(0).toUpperCase()+o.slice(1)](i,t.currTemplate[o]);t.appendContent(a,o),i.preloaded=!0,S(m,i),r=i.type,t.container.prepend(t.contentContainer),S("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[i]===!0?t.content.find(".mfp-close").length||t.content.append(T()):t.content=e:t.content="",S(f),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var o,n=t.items[i];if(n.tagName?n={el:e(n)}:(o=n.type,n={data:n,src:n.src}),n.el){for(var r=t.types,a=0;a<r.length;a++)if(n.el.hasClass("mfp-"+r[a])){o=r[a];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=o||t.st.type||"inline",n.index=i,n.parsed=!0,t.items[i]=n,S("ElementParse",n),t.items[i]},addGroup:function(e,i){var o=function(o){o.mfpEl=this,t._openClick(o,e,i)};i||(i={});var n="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(n).on(n,o)):(i.isObj=!1,i.delegate?e.off(n).on(n,i.delegate,o):(i.items=e,e.off(n).on(n,o)))},_openClick:function(i,o,n){var r=void 0!==n.midClick?n.midClick:e.magnificPopup.defaults.midClick;if(r||2!==i.which&&!i.ctrlKey&&!i.metaKey){var a=void 0!==n.disableOn?n.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(x.width()<a)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),n.el=e(i.mfpEl),n.delegate&&(n.items=o.find(n.delegate)),t.open(n)}},updateStatus:function(e,o){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),o||"loading"!==e||(o=t.st.tLoading);var n={status:e,text:o};S("UpdateStatus",n),e=n.status,o=n.text,t.preloader.html(o),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass(y)){var o=t.st.closeOnContentClick,n=t.st.closeOnBgClick;if(o&&n)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(o)return!0}else if(n&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?n.height():document.body.scrollHeight)>(e||x.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(i){return i.target===t.wrap[0]||e.contains(t.wrap[0],i.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,i,o){var n;o.data&&(i=e.extend(o.data,i)),S(p,[t,i,o]),e.each(i,function(e,i){if(void 0===i||i===!1)return!0;if(n=e.split("_"),n.length>1){var o=t.find(h+"-"+n[0]);if(o.length>0){var r=n[1];"replaceWith"===r?o[0]!==i[0]&&o.replaceWith(i):"img"===r?o.is("img")?o.attr("src",i):o.replaceWith('<img src="'+i+'" class="'+o.attr("class")+'" />'):o.attr(n[1],i)}}else t.find(h+"-"+e).html(i)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:b.prototype,modules:[],open:function(t,i){return E(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},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:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(i){E();var o=e(this);if("string"==typeof i)if("open"===i){var n,r=C?o.data("magnificPopup"):o[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?n=r.items[a]:(n=o,r.delegate&&(n=n.find(r.delegate)),n=n.eq(a)),t._openClick({mfpEl:n},o,r)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),C?o.data("magnificPopup",i):o[0].magnificPopup=i,t.addGroup(o,i);return o};var L,P,_,B="inline",z=function(){_&&(P.after(_.addClass(L)).detach(),_=null)};e.magnificPopup.registerModule(B,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(B),k(l+"."+B,function(){z()})},getInline:function(i,o){if(z(),i.src){var n=t.st.inline,r=e(i.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(P||(L=n.hiddenClass,P=I(L),L="mfp-"+L),_=r.after(P).detach().removeClass(L)),t.updateStatus("ready")}else t.updateStatus("error",n.tNotFound),r=e("<div>");return i.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(o,{},i),o}}});var M,F="ajax",H=function(){M&&o.removeClass(M)},j=function(){H(),t.req&&t.req.abort()};e.magnificPopup.registerModule(F,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(F),M=t.st.ajax.cursor,k(l+"."+F,j),k("BeforeChange."+F,j)},getAjax:function(i){M&&o.addClass(M),t.updateStatus("loading");var n=e.extend({url:i.src,success:function(o,n,r){var a={data:o,xhr:r};S("ParseAjax",a),t.appendContent(e(a.data),F),i.finished=!0,H(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),S("AjaxContentAdded")},error:function(){H(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(n),""}}});var N,W=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var o=t.st.image.titleSrc;if(o){if(e.isFunction(o))return o.call(t,i);if(i.el)return i.el.attr(o)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,i=".image";t.types.push("image"),k(u+i,function(){"image"===t.currItem.type&&e.cursor&&o.addClass(e.cursor)}),k(l+i,function(){e.cursor&&o.removeClass(e.cursor),x.off("resize"+h)}),k("Resize"+i,t.resizeImage),t.isLowIE&&k("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,N&&clearInterval(N),e.isCheckingImgSize=!1,S("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,o=e.img[0],n=function(r){N&&clearInterval(N),N=setInterval(function(){return o.naturalWidth>0?void t._onImageHasSize(e):(i>200&&clearInterval(N),i++,void(3===i?n(10):40===i?n(50):100===i&&n(500)))},r)};n(1)},getImage:function(i,o){var n=0,r=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,S("ImageLoadComplete")):(n++,200>n?setTimeout(r,100):a()))},a=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=o.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",i.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=i.src,l.is("img")&&(i.img=i.img.clone()),c=i.img[0],c.naturalWidth>0?i.hasSize=!0:c.width||(i.hasSize=!1)}return t._parseMarkup(o,{title:W(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(N&&clearInterval(N),i.loadError?(o.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(o.removeClass("mfp-loading"),t.updateStatus("ready")),o):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,o.addClass("mfp-loading"),t.findImageSize(i)),o)}}});var A,R=function(){return void 0===A&&(A=void 0!==document.createElement("p").style.MozTransform),A};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,i=t.st.zoom,o=".zoom";if(i.enabled&&t.supportsTransition){var n,r,a=i.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),o="all "+i.duration/1e3+"s "+i.easing,n={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return n["-webkit-"+r]=n["-moz-"+r]=n["-o-"+r]=n[r]=o,t.css(n),t},d=function(){t.content.css("visibility","visible")};k("BuildControls"+o,function(){if(t._allowZoom()){if(clearTimeout(n),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return void d();r=s(e),r.css(t._getOffset()),t.wrap.append(r),n=setTimeout(function(){r.css(t._getOffset(!0)),n=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,S("ZoomAnimationEnded")},16)},a)},16)}}),k(c+o,function(){if(t._allowZoom()){if(clearTimeout(n),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),k(l+o,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(i){var o;o=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var n=o.offset(),r=parseInt(o.css("padding-top"),10),a=parseInt(o.css("padding-bottom"),10);n.top-=e(window).scrollTop()-r;var s={width:o.width(),height:(C?o.innerHeight():o[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+n.left+"px,"+n.top+"px)":(s.left=n.left,s.top=n.top),s}}});var $="iframe",Y="//about:blank",D=function(e){if(t.currTemplate[$]){var i=t.currTemplate[$].find("iframe");i.length&&(e||(i[0].src=Y),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule($,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',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($),k("BeforeChange",function(e,t,i){t!==i&&(t===$?D():i===$&&D(!0))}),k(l+"."+$,function(){D()})},getIframe:function(i,o){var n=i.src,r=t.st.iframe;e.each(r.patterns,function(){return n.indexOf(this.index)>-1?(this.id&&(n="string"==typeof this.id?n.substr(n.lastIndexOf(this.id)+this.id.length,n.length):this.id.call(this,n)),n=this.src.replace("%id%",n),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=n),t._parseMarkup(o,a,i),t.updateStatus("ready"),o}}});var Z=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},q=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',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 i=t.st.gallery,o=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(a+=" mfp-gallery",k(u+o,function(){i.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),n.on("keydown"+o,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),k("UpdateStatus"+o,function(e,i){i.text&&(i.text=q(i.text,t.currItem.index,t.items.length))}),k(p+o,function(e,o,n,r){var a=t.items.length;n.counter=a>1?q(i.tCounter,r.index,a):""}),k("BuildControls"+o,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var o=i.arrowMarkup,n=t.arrowLeft=e(o.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(o.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";n[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(I("b",n[0],!1,!0),I("a",n[0],!1,!0),I("b",a[0],!1,!0),I("a",a[0],!1,!0)),t.container.append(n.add(a))}}),k(m+o,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void k(l+o,function(){n.off(o),t.wrap.off("click"+o),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null})):!1},next:function(){t.direction=!0,t.index=Z(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=Z(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,o=Math.min(i[0],t.items.length),n=Math.min(i[1],t.items.length);for(e=1;e<=(t.direction?n:o);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?o:n);e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=Z(i),!t.items[i].preloaded){var o=t.items[i];o.parsed||(o=t.parseEl(i)),S("LazyLoad",o),"image"===o.type&&(o.img=e('<img class="mfp-img" />').on("load.mfploader",function(){o.hasSize=!0}).on("error.mfploader",function(){o.hasSize=!0,o.loadError=!0,S("LazyLoadError",o)}).attr("src",o.src)),o.preloaded=!0}}}});var K="retina";e.magnificPopup.registerModule(K,{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,i=e.ratio;i=isNaN(i)?i():i,i>1&&(k("ImageHasSize."+K,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),k("ElementParse."+K,function(t,o){o.src=e.replaceSrc(o,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,o=function(){x.off("touchmove"+r+" touchend"+r)},n="mfpFastClick",r="."+n;e.fn.mfpFastClick=function(n){return e(this).each(function(){var a,s=e(this);if(i){var l,c,d,f,p,u;s.on("touchstart"+r,function(e){f=!1,u=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,x.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,u=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(f=!0,o())}).on("touchend"+r,function(e){o(),f||u>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),n())})})}s.on("click"+r,function(){a||n()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),i&&x.off("touchmove"+r+" touchend"+r)}}(),E()}(window.jQuery||window.Zepto),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(e){var t="1.7.2",i={},o={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},n=function(t){var i=[],o=!1,n=t.dir&&"left"===t.dir?"scrollLeft":"scrollTop";return this.each(function(){var t=e(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(t[n]()>0?i.push(this):(t[n](1),o=t[n]()>0,o&&i.push(this),t[n](0))):(i.push(document.scrollingElement),!1):void 0}),i.length||this.each(function(){this===document.documentElement&&"smooth"===e(this).css("scrollBehavior")&&(i=[this]),i.length||"BODY"!==this.nodeName||(i=[this])}),"first"===t.el&&i.length>1&&(i=[i[0]]),i};e.fn.extend({scrollable:function(e){var t=n.call(this,{dir:e});return this.pushStack(t)},firstScrollable:function(e){var t=n.call(this,{el:"first",dir:e});return this.pushStack(t)},smoothScroll:function(t,i){if(t=t||{},"options"===t)return i?this.each(function(){var t=e(this),o=e.extend(t.data("ssOpts")||{},i);e(this).data("ssOpts",o)}):this.first().data("ssOpts");var o=e.extend({},e.fn.smoothScroll.defaults,t),n=function(t){var i=function(e){return e.replace(/(:|\.|\/)/g,"\\$1")},n=this,r=e(this),a=e.extend({},o,r.data("ssOpts")||{}),s=o.exclude,l=a.excludeWithin,c=0,d=0,f=!0,p={},u=e.smoothScroll.filterPath(location.pathname),m=e.smoothScroll.filterPath(n.pathname),g=location.hostname===n.hostname||!n.hostname,h=a.scrollTarget||m===u,v=i(n.hash);if(v&&!e(v).length&&(f=!1),a.scrollTarget||g&&h&&v){for(;f&&c<s.length;)r.is(i(s[c++]))&&(f=!1);for(;f&&d<l.length;)r.closest(l[d++]).length&&(f=!1)}else f=!1;f&&(a.preventDefault&&t.preventDefault(),e.extend(p,a,{scrollTarget:a.scrollTarget||v,link:n}),e.smoothScroll(p))};return null!==t.delegateSelector?this.undelegate(t.delegateSelector,"click.smoothscroll").delegate(t.delegateSelector,"click.smoothscroll",n):this.unbind("click.smoothscroll").bind("click.smoothscroll",n),this}}),e.smoothScroll=function(t,o){if("options"===t&&"object"==typeof o)return e.extend(i,o);var n,r,a,s,l,c=0,d="offset",f="scrollTop",p={},u={};"number"==typeof t?(n=e.extend({link:null},e.fn.smoothScroll.defaults,i),a=t):(n=e.extend({link:null},e.fn.smoothScroll.defaults,t||{},i),n.scrollElement&&(d="position","static"===n.scrollElement.css("position")&&n.scrollElement.css("position","relative"))),f="left"===n.direction?"scrollLeft":f,n.scrollElement?(r=n.scrollElement,/^(?:HTML|BODY)$/.test(r[0].nodeName)||(c=r[f]())):r=e("html, body").firstScrollable(n.direction),n.beforeScroll.call(r,n),a="number"==typeof t?t:o||e(n.scrollTarget)[d]()&&e(n.scrollTarget)[d]()[n.direction]||0,p[f]=a+c+n.offset,s=n.speed,"auto"===s&&(l=Math.abs(p[f]-r[f]()),s=l/n.autoCoefficient),u={duration:s,easing:n.easing,complete:function(){n.afterScroll.call(n.link,n)}},n.step&&(u.step=n.step),r.length?r.stop().animate(p,u):n.afterScroll.call(n.link,n)},e.smoothScroll.version=t,e.smoothScroll.filterPath=function(e){return e=e||"",e.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},e.fn.smoothScroll.defaults=o}),!function(e,t){function i(){I=L=S=T=E=O=H}function o(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}function n(e){return parseFloat(e)||0}function r(){_={top:t.pageYOffset,left:t.pageXOffset}}function a(){return t.pageXOffset!=_.left?(r(),void S()):void(t.pageYOffset!=_.top&&(r(),l()))}function s(){setTimeout(function(){t.pageYOffset!=_.top&&(_.top=t.pageYOffset,l())},0)}function l(){for(var e=z.length-1;e>=0;e--)c(z[e])}function c(e){if(e.inited){var t=_.top<=e.limit.start?0:_.top>=e.limit.end?2:1;e.mode!=t&&g(e,t)}}function d(){for(var e=z.length-1;e>=0;e--)if(z[e].inited){var t=Math.abs(y(z[e].clone)-z[e].docOffsetTop),i=Math.abs(z[e].parent.node.offsetHeight-z[e].parent.height);if(t>=2||i>=2)return!1}return!0}function f(e){isNaN(parseFloat(e.computed.top))||e.isCell||"none"==e.computed.display||(e.inited=!0,e.clone||h(e),"absolute"!=e.parent.computed.position&&"relative"!=e.parent.computed.position&&(e.parent.node.style.position="relative"),c(e),e.parent.height=e.parent.node.offsetHeight,e.docOffsetTop=y(e.clone))}function p(e){var t=!0;e.clone&&v(e),o(e.node.style,e.css);for(var i=z.length-1;i>=0;i--)if(z[i].node!==e.node&&z[i].parent.node===e.parent.node){t=!1;break}t&&(e.parent.node.style.position=e.parent.css.position),e.mode=-1}function u(){for(var e=z.length-1;e>=0;e--)f(z[e])}function m(){for(var e=z.length-1;e>=0;e--)p(z[e])}function g(e,t){var i=e.node.style;switch(t){case 0:i.position="absolute",i.left=e.offset.left+"px",i.right=e.offset.right+"px",i.top=e.offset.top+"px",i.bottom="auto",i.width="auto",i.marginLeft=0,i.marginRight=0,i.marginTop=0;break;case 1:i.position="fixed",i.left=e.box.left+"px",i.right=e.box.right+"px",i.top=e.css.top,i.bottom="auto",i.width="auto",i.marginLeft=0,i.marginRight=0,i.marginTop=0;break;case 2:i.position="absolute",i.left=e.offset.left+"px",i.right=e.offset.right+"px",i.top="auto",i.bottom=0,i.width="auto",i.marginLeft=0,i.marginRight=0}e.mode=t}function h(e){e.clone=document.createElement("div");var t=e.node.nextSibling||e.node,i=e.clone.style;i.height=e.height+"px",i.width=e.width+"px",i.marginTop=e.computed.marginTop,i.marginBottom=e.computed.marginBottom,i.marginLeft=e.computed.marginLeft,i.marginRight=e.computed.marginRight,i.padding=i.border=i.borderSpacing=0,i.fontSize="1em",i.position="static",i.cssFloat=e.computed.cssFloat,e.node.parentNode.insertBefore(e.clone,t)}function v(e){e.clone.parentNode.removeChild(e.clone),e.clone=void 0}function w(e){var t=getComputedStyle(e),i=e.parentNode,o=getComputedStyle(i),r=e.style.position;e.style.position="relative";var a={top:t.top,marginTop:t.marginTop,marginBottom:t.marginBottom,marginLeft:t.marginLeft,marginRight:t.marginRight,cssFloat:t.cssFloat,display:t.display},s={top:n(t.top),marginBottom:n(t.marginBottom),paddingLeft:n(t.paddingLeft),paddingRight:n(t.paddingRight),borderLeftWidth:n(t.borderLeftWidth),borderRightWidth:n(t.borderRightWidth)};e.style.position=r;var l={position:e.style.position,top:e.style.top,bottom:e.style.bottom,left:e.style.left,right:e.style.right,width:e.style.width,marginTop:e.style.marginTop,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight},c=b(e),d=b(i),f={node:i,css:{position:i.style.position},computed:{position:o.position},numeric:{borderLeftWidth:n(o.borderLeftWidth),borderRightWidth:n(o.borderRightWidth),borderTopWidth:n(o.borderTopWidth),borderBottomWidth:n(o.borderBottomWidth)}},p={node:e,box:{left:c.win.left,right:F.clientWidth-c.win.right},offset:{top:c.win.top-d.win.top-f.numeric.borderTopWidth,left:c.win.left-d.win.left-f.numeric.borderLeftWidth,right:-c.win.right+d.win.right-f.numeric.borderRightWidth},css:l,isCell:"table-cell"==t.display,computed:a,numeric:s,width:c.win.right-c.win.left,height:c.win.bottom-c.win.top,mode:-1,inited:!1,parent:f,limit:{start:c.doc.top-s.top,end:d.doc.top+i.offsetHeight-f.numeric.borderBottomWidth-e.offsetHeight-s.top-s.marginBottom}};return p}function y(e){for(var t=0;e;)t+=e.offsetTop,e=e.offsetParent;return t}function b(e){var i=e.getBoundingClientRect();return{doc:{top:i.top+t.pageYOffset,left:i.left+t.pageXOffset},win:i}}function C(){B=setInterval(function(){!d()&&S()},500)}function x(){clearInterval(B)}function k(){M&&(document[j]?x():C())}function I(){M||(r(),u(),t.addEventListener("scroll",a),t.addEventListener("wheel",s),t.addEventListener("resize",S),t.addEventListener("orientationchange",S),e.addEventListener(N,k),C(),M=!0)}function S(){if(M){m();for(var e=z.length-1;e>=0;e--)z[e]=w(z[e].node);u()}}function T(){t.removeEventListener("scroll",a),t.removeEventListener("wheel",s),t.removeEventListener("resize",S),t.removeEventListener("orientationchange",S),e.removeEventListener(N,k),x(),M=!1}function E(){T(),m()}function O(){for(E();z.length;)z.pop()}function L(e){for(var t=z.length-1;t>=0;t--)if(z[t].node===e)return;var i=w(e);z.push(i),M?f(i):I()}function P(e){for(var t=z.length-1;t>=0;t--)z[t].node===e&&(p(z[t]),z.splice(t,1))}var _,B,z=[],M=!1,F=e.documentElement,H=function(){},j="hidden",N="visibilitychange";void 0!==e.webkitHidden&&(j="webkitHidden",N="webkitvisibilitychange"),t.getComputedStyle||i();for(var W=["","-webkit-","-moz-","-ms-"],A=document.createElement("div"),R=W.length-1;R>=0;R--){try{A.style.position=W[R]+"sticky"}catch($){}""!=A.style.position&&i()}r(),t.Stickyfill={stickies:z,add:L,remove:P,init:I,rebuild:S,pause:T,stop:E,kill:O}}(document,window),window.jQuery&&!function(e){e.fn.Stickyfill=function(){return this.each(function(){
|
|
Stickyfill.add(this)}),this}}(window.jQuery); |