1 line
No EOL
21 KiB
JavaScript
1 line
No EOL
21 KiB
JavaScript
(function(e){"use strict";e.fn.fitVids=function(t){var n={customSelector:null};var r=document.createElement("div"),i=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];r.className="fit-vids-style";r.innerHTML="<style> .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%; } </style>";i.parentNode.insertBefore(r,i);if(t){e.extend(n,t)}return this.each(function(){var t=["iframe[src*='player.vimeo.com']","iframe[src*='www.youtube.com']","iframe[src*='www.youtube-nocookie.com']","iframe[src*='www.kickstarter.com']","object","embed"];if(n.customSelector){t.push(n.customSelector)}var r=e(this).find(t.join(","));r.each(function(){var t=e(this);if(this.tagName.toLowerCase()==="embed"&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length){return}var n=this.tagName.toLowerCase()==="object"||t.attr("height")&&!isNaN(parseInt(t.attr("height"),10))?parseInt(t.attr("height"),10):t.height(),r=!isNaN(parseInt(t.attr("width"),10))?parseInt(t.attr("width"),10):t.width(),i=n/r;if(!t.attr("id")){var s="fitvid"+Math.floor(Math.random()*999999);t.attr("id",s)}t.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",i*100+"%");t.removeAttr("height").removeAttr("width")})})}})(jQuery);(function(e){var t="Close",n="AfterClose",r="BeforeAppend",i="MarkupParse",s="Open",o="Change",u="mfp",a="."+u,f="mfp-ready",l="mfp-removing",c="mfp-prevent-close";var h,p=function(){},d=!!window.jQuery,v,m=e(window),g,y,b,w,E;var S=function(e,t){h.ev.on(u+e+a,t)},x=function(t,n,r,i){var s=document.createElement("div");s.className="mfp-"+t;if(r){s.innerHTML=r}if(!i){s=e(s);if(n){s.appendTo(n)}}else if(n){n.appendChild(s)}return s},T=function(t,n){h.ev.triggerHandler(u+t,n);if(h.st.callbacks){t=t.charAt(0).toLowerCase()+t.slice(1);if(h.st.callbacks[t]){h.st.callbacks[t].apply(h,e.isArray(n)?n:[n])}}},N=function(){(h.st.focus?h.content.find(h.st.focus).eq(0):h.wrap).focus()},C=function(t){if(t!==E||!h.currTemplate.closeBtn){h.currTemplate.closeBtn=e(h.st.closeMarkup.replace("%title%",h.st.tClose));E=t}return h.currTemplate.closeBtn},k=function(){if(!e.magnificPopup.instance){h=new p;h.init();e.magnificPopup.instance=h}},L=function(t){if(e(t).hasClass(c)){return}var n=h.st.closeOnContentClick;var r=h.st.closeOnBgClick;if(n&&r){return true}else{if(!h.content||e(t).hasClass("mfp-close")||h.preloader&&t===h.preloader[0]){return true}if(t!==h.content[0]&&!e.contains(h.content[0],t)){if(r){return true}}else if(n){return true}}return false};p.prototype={constructor:p,init:function(){var t=navigator.appVersion;h.isIE7=t.indexOf("MSIE 7.")!==-1;h.isIE8=t.indexOf("MSIE 8.")!==-1;h.isLowIE=h.isIE7||h.isIE8;h.isAndroid=/android/gi.test(t);h.isIOS=/iphone|ipad|ipod/gi.test(t);h.probablyMobile=h.isAndroid||h.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);g=e(document.body);y=e(document);h.popupsCache={}},open:function(t){var n;if(t.isObj===false){h.items=t.items.toArray();h.index=0;var r=t.items,o;for(n=0;n<r.length;n++){o=r[n];if(o.parsed){o=o.el[0]}if(o===t.el[0]){h.index=n;break}}}else{h.items=e.isArray(t.items)?t.items:[t.items];h.index=t.index||0}if(h.isOpen){h.updateItemHTML();return}h.types=[];w="";h.ev=t.mainEl||y;if(t.key){if(!h.popupsCache[t.key]){h.popupsCache[t.key]={}}h.currTemplate=h.popupsCache[t.key]}else{h.currTemplate={}}h.st=e.extend(true,{},e.magnificPopup.defaults,t);h.fixedContentPos=h.st.fixedContentPos==="auto"?!h.probablyMobile:h.st.fixedContentPos;if(!h.bgOverlay){h.bgOverlay=x("bg").on("click"+a,function(){h.close()});h.wrap=x("wrap").attr("tabindex",-1).on("click"+a,function(e){if(L(e.target)){h.close()}});h.container=x("container",h.wrap)}h.contentContainer=x("content");if(h.st.preloader){h.preloader=x("preloader",h.container,h.st.tLoading)}var u=e.magnificPopup.modules;for(n=0;n<u.length;n++){var l=u[n];l=l.charAt(0).toUpperCase()+l.slice(1);h["init"+l].call(h)}T("BeforeOpen");if(!h.st.closeBtnInside){h.wrap.append(C())}else{S(i,function(e,t,n,r){n.close_replaceWith=C(r.type)});w+=" mfp-close-btn-in"}if(h.st.alignTop){w+=" mfp-align-top"}if(h.fixedContentPos){h.wrap.css({overflow:h.st.overflowY,overflowX:"hidden",overflowY:h.st.overflowY})}else{h.wrap.css({top:m.scrollTop(),position:"absolute"})}if(h.st.fixedBgPos===false||h.st.fixedBgPos==="auto"&&!h.fixedContentPos){h.bgOverlay.css({height:y.height(),position:"absolute"})}y.on("keyup"+a,function(e){if(e.keyCode===27){h.close()}});m.on("resize"+a,function(){h.updateSize()});if(!h.st.closeOnContentClick){w+=" mfp-auto-cursor"}if(w)h.wrap.addClass(w);var c=h.wH=m.height();var p={};if(h.fixedContentPos){if(h._hasScrollBar(c)){var d=h._getScrollbarSize();if(d){p.paddingRight=d}}}if(h.fixedContentPos){if(!h.isIE7){p.overflow="hidden"}else{e("body, html").css("overflow","hidden")}}var v=h.st.mainClass;if(h.isIE7){v+=" mfp-ie7"}if(v){h._addClassToMFP(v)}h.updateItemHTML();T("BuildControls");g.css(p);h.bgOverlay.add(h.wrap).prependTo(document.body);h._lastFocusedEl=document.activeElement;setTimeout(function(){if(h.content){h._addClassToMFP(f);N()}else{h.bgOverlay.addClass(f)}y.on("focusin"+a,function(t){if(t.target!==h.wrap[0]&&!e.contains(h.wrap[0],t.target)){N();return false}})},16);h.isOpen=true;h.updateSize(c);T(s)},close:function(){if(!h.isOpen)return;h.isOpen=false;if(h.st.removalDelay&&!h.isLowIE){h._addClassToMFP(l);setTimeout(function(){h._close()},h.st.removalDelay)}else{h._close()}},_close:function(){T(t);var r=l+" "+f+" ";h.bgOverlay.detach();h.wrap.detach();h.container.empty();if(h.st.mainClass){r+=h.st.mainClass+" "}h._removeClassFromMFP(r);if(h.fixedContentPos){var i={paddingRight:""};if(h.isIE7){e("body, html").css("overflow","")}else{i.overflow=""}g.css(i)}y.off("keyup"+a+" focusin"+a);h.ev.off(a);h.wrap.attr("class","mfp-wrap").removeAttr("style");h.bgOverlay.attr("class","mfp-bg");h.container.attr("class","mfp-container");if(!h.st.closeBtnInside||h.currTemplate[h.currItem.type]===true){if(h.currTemplate.closeBtn)h.currTemplate.closeBtn.detach()}if(h._lastFocusedEl){e(h._lastFocusedEl).focus()}h.currItem=null;h.content=null;h.currTemplate=null;h.prevHeight=0;T(n)},updateSize:function(e){if(h.isIOS){var t=document.documentElement.clientWidth/window.innerWidth;var n=window.innerHeight*t;h.wrap.css("height",n);h.wH=n}else{h.wH=e||m.height()}if(!h.fixedContentPos){h.wrap.css("height",h.wH)}T("Resize")},updateItemHTML:function(){var t=h.items[h.index];h.contentContainer.detach();if(h.content)h.content.detach();if(!t.parsed){t=h.parseEl(h.index)}var n=t.type;T("BeforeChange",[h.currItem?h.currItem.type:"",n]);h.currItem=t;if(!h.currTemplate[n]){var r=h.st[n]?h.st[n].markup:false;T("FirstMarkupParse",r);if(r){h.currTemplate[n]=e(r)}else{h.currTemplate[n]=true}}if(b&&b!==t.type){h.container.removeClass("mfp-"+b+"-holder")}var i=h["get"+n.charAt(0).toUpperCase()+n.slice(1)](t,h.currTemplate[n]);h.appendContent(i,n);t.preloaded=true;T(o,t);b=t.type;h.container.prepend(h.contentContainer);T("AfterChange")},appendContent:function(e,t){h.content=e;if(e){if(h.st.closeBtnInside&&h.currTemplate[t]===true){if(!h.content.find(".mfp-close").length){h.content.append(C())}}else{h.content=e}}else{h.content=""}T(r);h.container.addClass("mfp-"+t+"-holder");h.contentContainer.append(h.content)},parseEl:function(t){var n=h.items[t],r=n.type;if(n.tagName){n={el:e(n)}}else{n={data:n,src:n.src}}if(n.el){var i=h.types;for(var s=0;s<i.length;s++){if(n.el.hasClass("mfp-"+i[s])){r=i[s];break}}n.src=n.el.attr("data-mfp-src");if(!n.src){n.src=n.el.attr("href")}}n.type=r||h.st.type||"inline";n.index=t;n.parsed=true;h.items[t]=n;T("ElementParse",n);return h.items[t]},addGroup:function(e,t){var n=function(n){n.mfpEl=this;h._openClick(n,e,t)};if(!t){t={}}var r="click.magnificPopup";t.mainEl=e;if(t.items){t.isObj=true;e.off(r).on(r,n)}else{t.isObj=false;if(t.delegate){e.off(r).on(r,t.delegate,n)}else{t.items=e;e.off(r).on(r,n)}}},_openClick:function(t,n,r){var i=r.midClick!==undefined?r.midClick:e.magnificPopup.defaults.midClick;if(i||t.which!==2){var s=r.disableOn!==undefined?r.disableOn:e.magnificPopup.defaults.disableOn;if(s){if(e.isFunction(s)){if(!s.call(h)){return true}}else{if(m.width()<s){return true}}}if(t.type){t.preventDefault();if(h.isOpen){t.stopPropagation()}}r.el=e(t.mfpEl);if(r.delegate){r.items=n.find(r.delegate)}h.open(r)}},updateStatus:function(e,t){if(h.preloader){if(v!==e){h.container.removeClass("mfp-s-"+v)}if(!t&&e==="loading"){t=h.st.tLoading}var n={status:e,text:t};T("UpdateStatus",n);e=n.status;t=n.text;h.preloader.html(t);h.preloader.find("a").click(function(e){e.stopImmediatePropagation()});h.container.addClass("mfp-s-"+e);v=e}},_addClassToMFP:function(e){h.bgOverlay.addClass(e);h.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e);h.wrap.removeClass(e)},_hasScrollBar:function(e){return(h.isIE7?y.height():document.body.scrollHeight)>(e||m.height())},_parseMarkup:function(t,n,r){var s;if(r.data){n=e.extend(r.data,n)}T(i,[t,n,r]);e.each(n,function(e,n){if(n===undefined||n===false){return true}s=e.split("_");if(s.length>1){var r=t.find(a+"-"+s[0]);if(r.length>0){var i=s[1];if(i==="replaceWith"){if(r[0]!==n[0]){r.replaceWith(n)}}else if(i==="img"){if(r.is("img")){r.attr("src",n)}else{r.replaceWith('<img src="'+n+'" class="'+r.attr("class")+'" />')}}else{r.attr(s[1],n)}}}else{t.find(a+"-"+e).html(n)}})},_getScrollbarSize:function(){if(h.scrollbarSize===undefined){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);h.scrollbarSize=e.offsetWidth-e.clientWidth;document.body.removeChild(e)}return h.scrollbarSize}};e.magnificPopup={instance:null,proto:p.prototype,modules:[],open:function(e,t){k();if(!e)e={};e.isObj=true;e.index=t||0;return this.instance.open(e)},close:function(){return e.magnificPopup.instance.close()},registerModule:function(t,n){if(n.options){e.magnificPopup.defaults[t]=n.options}e.extend(this.proto,n.proto);this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:false,mainClass:"",preloader:true,focus:"",closeOnContentClick:false,closeOnBgClick:true,closeBtnInside:true,alignTop:false,removalDelay:0,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(t){k();var n=e(this);if(typeof t==="string"){if(t==="open"){var r,i=d?n.data("magnificPopup"):n[0].magnificPopup,s=parseInt(arguments[1],10)||0;if(i.items){r=i.items[s]}else{r=n;if(i.delegate){r=r.find(i.delegate)}r=r.eq(s)}h._openClick({mfpEl:r},n,i)}else{if(h.isOpen)h[t].apply(h,Array.prototype.slice.call(arguments,1))}}else{if(d){n.data("magnificPopup",t)}else{n[0].magnificPopup=t}h.addGroup(n,t)}return n};var A="inline",O,M,_,D=function(){if(_){M.after(_.addClass(O)).detach();_=null}};e.magnificPopup.registerModule(A,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){h.types.push(A);S(t+"."+A,function(){D()})},getInline:function(t,n){D();if(t.src){var r=h.st.inline,i=e(t.src);if(i.length){var s=i[0].parentNode;if(s&&s.tagName){if(!M){O=r.hiddenClass;M=x(O);O="mfp-"+O}_=i.after(M).detach().removeClass(O)}h.updateStatus("ready")}else{h.updateStatus("error",r.tNotFound);i=e("<div>")}t.inlineElement=i;return i}h.updateStatus("ready");h._parseMarkup(n,{},t);return n}}});var P="ajax",H,B=function(){if(H){g.removeClass(H)}};e.magnificPopup.registerModule(P,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){h.types.push(P);H=h.st.ajax.cursor;S(t+"."+P,function(){B();if(h.req){h.req.abort()}})},getAjax:function(t){if(H)g.addClass(H);h.updateStatus("loading");var n=e.extend({url:t.src,success:function(n,r,i){var s={data:n,xhr:i};T("ParseAjax",s);h.appendContent(e(s.data),P);t.finished=true;B();N();setTimeout(function(){h.wrap.addClass(f)},16);h.updateStatus("ready");T("AjaxContentAdded")},error:function(){B();t.finished=t.loadError=true;h.updateStatus("error",h.st.ajax.tError.replace("%url%",t.src))}},h.st.ajax.settings);h.req=e.ajax(n);return""}}});var j,F=function(t){if(t.data&&t.data.title!==undefined)return t.data.title;var n=h.st.image.titleSrc;if(n){if(e.isFunction(n)){return n.call(h,t)}else if(t.el){return t.el.attr(n)||""}}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure">'+'<div class="mfp-close"></div>'+'<div class="mfp-img"></div>'+'<div class="mfp-bottom-bar">'+'<div class="mfp-title"></div>'+'<div class="mfp-counter"></div>'+"</div>"+"</div>",cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:true,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=h.st.image,n=".image";h.types.push("image");S(s+n,function(){if(h.currItem.type==="image"&&e.cursor){g.addClass(e.cursor)}});S(t+n,function(){if(e.cursor){g.removeClass(e.cursor)}m.off("resize"+a)});S("Resize"+n,h.resizeImage);if(h.isLowIE){S("AfterChange",h.resizeImage)}},resizeImage:function(){var e=h.currItem;if(!e.img)return;if(h.st.image.verticalFit){var t=0;if(h.isLowIE){t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)}e.img.css("max-height",h.wH-t)}},_onImageHasSize:function(e){if(e.img){e.hasSize=true;if(j){clearInterval(j)}e.isCheckingImgSize=false;T("ImageHasSize",e);if(e.imgHidden){if(h.content)h.content.removeClass("mfp-loading");e.imgHidden=false}}},findImageSize:function(e){var t=0,n=e.img[0],r=function(i){if(j){clearInterval(j)}j=setInterval(function(){if(n.naturalWidth>0){h._onImageHasSize(e);return}if(t>200){clearInterval(j)}t++;if(t===3){r(10)}else if(t===40){r(50)}else if(t===100){r(500)}},i)};r(1)},getImage:function(t,n){var r=0,i=function(){if(t){if(t.img[0].complete){t.img.off(".mfploader");if(t===h.currItem){h._onImageHasSize(t);h.updateStatus("ready")}t.hasSize=true;t.loaded=true}else{r++;if(r<200){setTimeout(i,100)}else{s()}}}},s=function(){if(t){t.img.off(".mfploader");if(t===h.currItem){h._onImageHasSize(t);h.updateStatus("error",o.tError.replace("%url%",t.src))}t.hasSize=true;t.loaded=true;t.loadError=true}},o=h.st.image;var u=n.find(".mfp-img");if(u.length){var a=new Image;a.className="mfp-img";t.img=e(a).on("load.mfploader",i).on("error.mfploader",s);a.src=t.src;if(u.is("img")){t.img=t.img.clone()}}h._parseMarkup(n,{title:F(t),img_replaceWith:t.img},t);h.resizeImage();if(t.hasSize){if(j)clearInterval(j);if(t.loadError){n.addClass("mfp-loading");h.updateStatus("error",o.tError.replace("%url%",t.src))}else{n.removeClass("mfp-loading");h.updateStatus("ready")}return n}h.updateStatus("loading");t.loading=true;if(!t.hasSize){t.imgHidden=true;n.addClass("mfp-loading");h.findImageSize(t)}return n}}});var I="iframe",q="//about:blank",R=function(e){if(h.currTemplate[I]){var t=h.currTemplate[I].find("iframe");if(t.length){if(!e){t[0].src=q}if(h.isIE8){t.css("display",e?"block":"none")}}}};e.magnificPopup.registerModule(I,{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(){h.types.push(I);S("BeforeChange",function(e,t,n){if(t!==n){if(t===I){R()}else if(n===I){R(true)}}});S(t+"."+I,function(){R()})},getIframe:function(t,n){var r=t.src;var i=h.st.iframe;e.each(i.patterns,function(){if(r.indexOf(this.index)>-1){if(this.id){if(typeof this.id==="string"){r=r.substr(r.lastIndexOf(this.id)+this.id.length,r.length)}else{r=this.id.call(this,r)}}r=this.src.replace("%id%",r);return false}});var s={};if(i.srcAction){s[i.srcAction]=r}h._parseMarkup(n,s,t);h.updateStatus("ready");return n}}});var U=function(e){var t=h.items.length;if(e>t-1){return e-t}else if(e<0){return t+e}return e},z=function(e,t,n){return e.replace("%curr%",t+1).replace("%total%",n)};e.magnificPopup.registerModule("gallery",{options:{enabled:false,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:true,arrows:true,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=h.st.gallery,r=".mfp-gallery",u=Boolean(e.fn.mfpFastClick);h.direction=true;if(!n||!n.enabled)return false;w+=" mfp-gallery";S(s+r,function(){if(n.navigateByImgClick){h.wrap.on("click"+r,".mfp-img",function(){if(h.items.length>1){h.next();return false}})}y.on("keydown"+r,function(e){if(e.keyCode===37){h.prev()}else if(e.keyCode===39){h.next()}})});S("UpdateStatus"+r,function(e,t){if(t.text){t.text=z(t.text,h.currItem.index,h.items.length)}});S(i+r,function(e,t,r,i){var s=h.items.length;r.counter=s>1?z(n.tCounter,i.index,s):""});S("BuildControls"+r,function(){if(h.items.length>1&&n.arrows&&!h.arrowLeft){var t=n.arrowMarkup,r=h.arrowLeft=e(t.replace("%title%",n.tPrev).replace("%dir%","left")).addClass(c),i=h.arrowRight=e(t.replace("%title%",n.tNext).replace("%dir%","right")).addClass(c);var s=u?"mfpFastClick":"click";r[s](function(){h.prev()});i[s](function(){h.next()});if(h.isIE7){x("b",r[0],false,true);x("a",r[0],false,true);x("b",i[0],false,true);x("a",i[0],false,true)}h.container.append(r.add(i))}});S(o+r,function(){if(h._preloadTimeout)clearTimeout(h._preloadTimeout);h._preloadTimeout=setTimeout(function(){h.preloadNearbyImages();h._preloadTimeout=null},16)});S(t+r,function(){y.off(r);h.wrap.off("click"+r);if(h.arrowLeft&&u){h.arrowLeft.add(h.arrowRight).destroyMfpFastClick()}h.arrowRight=h.arrowLeft=null})},next:function(){h.direction=true;h.index=U(h.index+1);h.updateItemHTML()},prev:function(){h.direction=false;h.index=U(h.index-1);h.updateItemHTML()},goTo:function(e){h.direction=e>=h.index;h.index=e;h.updateItemHTML()},preloadNearbyImages:function(){var e=h.st.gallery.preload,t=Math.min(e[0],h.items.length),n=Math.min(e[1],h.items.length),r;for(r=1;r<=(h.direction?n:t);r++){h._preloadItem(h.index+r)}for(r=1;r<=(h.direction?t:n);r++){h._preloadItem(h.index-r)}},_preloadItem:function(t){t=U(t);if(h.items[t].preloaded){return}var n=h.items[t];if(!n.parsed){n=h.parseEl(t)}T("LazyLoad",n);if(n.type==="image"){n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=true}).on("error.mfploader",function(){n.hasSize=true;n.loadError=true}).attr("src",n.src)}n.preloaded=true}}});var W="retina";e.magnificPopup.registerModule(W,{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=h.st.retina,t=e.ratio;t=!isNaN(t)?t:t();if(t>1){S("ImageHasSize"+"."+W,function(e,n){n.img.css({"max-width":n.img[0].naturalWidth/t,width:"100%"})});S("ElementParse"+"."+W,function(n,r){r.src=e.replaceSrc(r,t)})}}}}});(function(){var t=1e3,n="ontouchstart"in window,r=function(){m.off("touchmove"+s+" touchend"+s)},i="mfpFastClick",s="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var o=e(this),u;if(n){var a,f,l,c,h,p;o.on("touchstart"+s,function(e){c=false;p=1;h=e.originalEvent?e.originalEvent.touches[0]:e.touches[0];f=h.clientX;l=h.clientY;m.on("touchmove"+s,function(e){h=e.originalEvent?e.originalEvent.touches:e.touches;p=h.length;h=h[0];if(Math.abs(h.clientX-f)>10||Math.abs(h.clientY-l)>10){c=true;r()}}).on("touchend"+s,function(e){r();if(c||p>1){return}u=true;e.preventDefault();clearTimeout(a);a=setTimeout(function(){u=false},t);i()})})}o.on("click"+s,function(){if(!u){i()}})})};e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+s+" click"+s);if(n)m.off("touchmove"+s+" touchend"+s)}})()})(window.jQuery||window.Zepto);$(function(){$("article").fitVids()});$(function(){$(".toc h3").click(function(){$("#drawer").toggleClass("hidden")})});$("a[href$='.jpg'],a[href$='.png'],a[href$='.gif']").addClass("image-popup");$(document).ready(function(){$(".image-popup").magnificPopup({type:"image",tLoading:"Loading image #%curr%...",gallery:{enabled:true,navigateByImgClick:true,preload:[0,1]},image:{tError:'<a href="%url%">Image #%curr%</a> could not be loaded.'},removalDelay:300,mainClass:"mfp-fade"})}) |