$(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:'Image #%curr% 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(t){"use strict";t.fn.fitVids=function(e){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='

x

",o.appendChild(r.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=['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&&e.push(i.customSelector);var o=".fitvidsignore";i.ignore&&(o=o+", "+i.ignore);var n=t(this).find(e.join(","));n=n.not("object object"),n=n.not(o),n.each(function(e){var i=t(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),s=n/r;if(!i.attr("id")){var a="fitvid"+e;i.attr("id",a)}i.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",100*s+"%"),i.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto),function(t){var e,i,o,n,r,s,a,l="Close",c="BeforeClose",d="AfterClose",p="BeforeAppend",u="MarkupParse",f="Open",m="Change",h="mfp",g="."+h,v="mfp-ready",y="mfp-removing",w="mfp-prevent-close",b=function(){},C=!!window.jQuery,S=t(window),k=function(t,i){e.ev.on(h+t+g,i)},x=function(e,i,o,n){var r=document.createElement("div");return r.className="mfp-"+e,o&&(r.innerHTML=o),n?i&&i.appendChild(r):(r=t(r),i&&r.appendTo(i)),r},I=function(i,o){e.ev.triggerHandler(h+i,o),e.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),e.st.callbacks[i]&&e.st.callbacks[i].apply(e,t.isArray(o)?o:[o]))},E=function(i){return i===a&&e.currTemplate.closeBtn||(e.currTemplate.closeBtn=t(e.st.closeMarkup.replace("%title%",e.st.tClose)),a=i),e.currTemplate.closeBtn},T=function(){t.magnificPopup.instance||(e=new b,e.init(),t.magnificPopup.instance=e)},O=function(){var t=document.createElement("p").style,e=["ms","O","Moz","Webkit"];if(void 0!==t.transition)return!0;for(;e.length;)if(e.pop()+"Transition"in t)return!0;return!1};b.prototype={constructor:b,init:function(){var i=navigator.appVersion;e.isIE7=-1!==i.indexOf("MSIE 7."),e.isIE8=-1!==i.indexOf("MSIE 8."),e.isLowIE=e.isIE7||e.isIE8,e.isAndroid=/android/gi.test(i),e.isIOS=/iphone|ipad|ipod/gi.test(i),e.supportsTransition=O(),e.probablyMobile=e.isAndroid||e.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=t(document),e.popupsCache={}},open:function(i){o||(o=t(document.body));var r;if(i.isObj===!1){e.items=i.items.toArray(),e.index=0;var a,l=i.items;for(r=0;r(t||S.height())},_setFocus:function(){(e.st.focus?e.content.find(e.st.focus).eq(0):e.wrap).focus()},_onFocusIn:function(i){return i.target===e.wrap[0]||t.contains(e.wrap[0],i.target)?void 0:(e._setFocus(),!1)},_parseMarkup:function(e,i,o){var n;o.data&&(i=t.extend(o.data,i)),I(u,[e,i,o]),t.each(i,function(t,i){if(void 0===i||i===!1)return!0;if(n=t.split("_"),n.length>1){var o=e.find(g+"-"+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(''):o.attr(n[1],i)}}else e.find(g+"-"+t).html(i)})},_getScrollbarSize:function(){if(void 0===e.scrollbarSize){var t=document.createElement("div");t.id="mfp-sbm",t.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(t),e.scrollbarSize=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return e.scrollbarSize}},t.magnificPopup={instance:null,proto:b.prototype,modules:[],open:function(e,i){return T(),e=e?t.extend(!0,{},e):{},e.isObj=!0,e.index=i||0,this.instance.open(e)},close:function(){return t.magnificPopup.instance&&t.magnificPopup.instance.close()},registerModule:function(e,i){i.options&&(t.magnificPopup.defaults[e]=i.options),t.extend(this.proto,i.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},t.fn.magnificPopup=function(i){T();var o=t(this);if("string"==typeof i)if("open"===i){var n,r=C?o.data("magnificPopup"):o[0].magnificPopup,s=parseInt(arguments[1],10)||0;r.items?n=r.items[s]:(n=o,r.delegate&&(n=n.find(r.delegate)),n=n.eq(s)),e._openClick({mfpEl:n},o,r)}else e.isOpen&&e[i].apply(e,Array.prototype.slice.call(arguments,1));else i=t.extend(!0,{},i),C?o.data("magnificPopup",i):o[0].magnificPopup=i,e.addGroup(o,i);return o};var _,P,L,z="inline",M=function(){L&&(P.after(L.addClass(_)).detach(),L=null)};t.magnificPopup.registerModule(z,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){e.types.push(z),k(l+"."+z,function(){M()})},getInline:function(i,o){if(M(),i.src){var n=e.st.inline,r=t(i.src);if(r.length){var s=r[0].parentNode;s&&s.tagName&&(P||(_=n.hiddenClass,P=x(_),_="mfp-"+_),L=r.after(P).detach().removeClass(_)),e.updateStatus("ready")}else e.updateStatus("error",n.tNotFound),r=t("
");return i.inlineElement=r,r}return e.updateStatus("ready"),e._parseMarkup(o,{},i),o}}});var F,B="ajax",H=function(){F&&o.removeClass(F)},N=function(){H(),e.req&&e.req.abort()};t.magnificPopup.registerModule(B,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){e.types.push(B),F=e.st.ajax.cursor,k(l+"."+B,N),k("BeforeChange."+B,N)},getAjax:function(i){F&&o.addClass(F),e.updateStatus("loading");var n=t.extend({url:i.src,success:function(o,n,r){var s={data:o,xhr:r};I("ParseAjax",s),e.appendContent(t(s.data),B),i.finished=!0,H(),e._setFocus(),setTimeout(function(){e.wrap.addClass(v)},16),e.updateStatus("ready"),I("AjaxContentAdded")},error:function(){H(),i.finished=i.loadError=!0,e.updateStatus("error",e.st.ajax.tError.replace("%url%",i.src))}},e.st.ajax.settings);return e.req=t.ajax(n),""}}});var A,j=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var o=e.st.image.titleSrc;if(o){if(t.isFunction(o))return o.call(e,i);if(i.el)return i.el.attr(o)||""}return""};t.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 t=e.st.image,i=".image";e.types.push("image"),k(f+i,function(){"image"===e.currItem.type&&t.cursor&&o.addClass(t.cursor)}),k(l+i,function(){t.cursor&&o.removeClass(t.cursor),S.off("resize"+g)}),k("Resize"+i,e.resizeImage),e.isLowIE&&k("AfterChange",e.resizeImage)},resizeImage:function(){var t=e.currItem;if(t&&t.img&&e.st.image.verticalFit){var i=0;e.isLowIE&&(i=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",e.wH-i)}},_onImageHasSize:function(t){t.img&&(t.hasSize=!0,A&&clearInterval(A),t.isCheckingImgSize=!1,I("ImageHasSize",t),t.imgHidden&&(e.content&&e.content.removeClass("mfp-loading"),t.imgHidden=!1))},findImageSize:function(t){var i=0,o=t.img[0],n=function(r){A&&clearInterval(A),A=setInterval(function(){return o.naturalWidth>0?void e._onImageHasSize(t):(i>200&&clearInterval(A),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===e.currItem&&(e._onImageHasSize(i),e.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,I("ImageLoadComplete")):(n++,200>n?setTimeout(r,100):s()))},s=function(){i&&(i.img.off(".mfploader"),i===e.currItem&&(e._onImageHasSize(i),e.updateStatus("error",a.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},a=e.st.image,l=o.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",i.img=t(c).on("load.mfploader",r).on("error.mfploader",s),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 e._parseMarkup(o,{title:j(i),img_replaceWith:i.img},i),e.resizeImage(),i.hasSize?(A&&clearInterval(A),i.loadError?(o.addClass("mfp-loading"),e.updateStatus("error",a.tError.replace("%url%",i.src))):(o.removeClass("mfp-loading"),e.updateStatus("ready")),o):(e.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,o.addClass("mfp-loading"),e.findImageSize(i)),o)}}});var R,W=function(){return void 0===R&&(R=void 0!==document.createElement("p").style.MozTransform),R};t.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(t){return t.is("img")?t:t.find("img")}},proto:{initZoom:function(){var t,i=e.st.zoom,o=".zoom";if(i.enabled&&e.supportsTransition){var n,r,s=i.duration,a=function(t){var e=t.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,e.css(n),e},d=function(){e.content.css("visibility","visible")};k("BuildControls"+o,function(){if(e._allowZoom()){if(clearTimeout(n),e.content.css("visibility","hidden"),t=e._getItemToZoom(),!t)return void d();r=a(t),r.css(e._getOffset()),e.wrap.append(r),n=setTimeout(function(){r.css(e._getOffset(!0)),n=setTimeout(function(){d(),setTimeout(function(){r.remove(),t=r=null,I("ZoomAnimationEnded")},16)},s)},16)}}),k(c+o,function(){if(e._allowZoom()){if(clearTimeout(n),e.st.removalDelay=s,!t){if(t=e._getItemToZoom(),!t)return;r=a(t)}r.css(e._getOffset(!0)),e.wrap.append(r),e.content.css("visibility","hidden"),setTimeout(function(){r.css(e._getOffset())},16)}}),k(l+o,function(){e._allowZoom()&&(d(),r&&r.remove(),t=null)})}},_allowZoom:function(){return"image"===e.currItem.type},_getItemToZoom:function(){return e.currItem.hasSize?e.currItem.img:!1},_getOffset:function(i){var o;o=i?e.currItem.img:e.st.zoom.opener(e.currItem.el||e.currItem);var n=o.offset(),r=parseInt(o.css("padding-top"),10),s=parseInt(o.css("padding-bottom"),10);n.top-=t(window).scrollTop()-r;var a={width:o.width(),height:(C?o.innerHeight():o[0].offsetHeight)-s-r};return W()?a["-moz-transform"]=a.transform="translate("+n.left+"px,"+n.top+"px)":(a.left=n.left,a.top=n.top),a}}});var Y="iframe",D="//about:blank",X=function(t){if(e.currTemplate[Y]){var i=e.currTemplate[Y].find("iframe");i.length&&(t||(i[0].src=D),e.isIE8&&i.css("display",t?"block":"none"))}};t.magnificPopup.registerModule(Y,{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(){e.types.push(Y),k("BeforeChange",function(t,e,i){e!==i&&(e===Y?X():i===Y&&X(!0))}),k(l+"."+Y,function(){X()})},getIframe:function(i,o){var n=i.src,r=e.st.iframe;t.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 s={};return r.srcAction&&(s[r.srcAction]=n),e._parseMarkup(o,s,i),e.updateStatus("ready"),o}}});var $=function(t){var i=e.items.length;return t>i-1?t-i:0>t?i+t:t},q=function(t,e,i){return t.replace(/%curr%/gi,e+1).replace(/%total%/gi,i)};t.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 i=e.st.gallery,o=".mfp-gallery",r=Boolean(t.fn.mfpFastClick);return e.direction=!0,i&&i.enabled?(s+=" mfp-gallery",k(f+o,function(){i.navigateByImgClick&&e.wrap.on("click"+o,".mfp-img",function(){return e.items.length>1?(e.next(),!1):void 0}),n.on("keydown"+o,function(t){37===t.keyCode?e.prev():39===t.keyCode&&e.next()})}),k("UpdateStatus"+o,function(t,i){i.text&&(i.text=q(i.text,e.currItem.index,e.items.length))}),k(u+o,function(t,o,n,r){var s=e.items.length;n.counter=s>1?q(i.tCounter,r.index,s):""}),k("BuildControls"+o,function(){if(e.items.length>1&&i.arrows&&!e.arrowLeft){var o=i.arrowMarkup,n=e.arrowLeft=t(o.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(w),s=e.arrowRight=t(o.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(w),a=r?"mfpFastClick":"click";n[a](function(){e.prev()}),s[a](function(){e.next()}),e.isIE7&&(x("b",n[0],!1,!0),x("a",n[0],!1,!0),x("b",s[0],!1,!0),x("a",s[0],!1,!0)),e.container.append(n.add(s))}}),k(m+o,function(){e._preloadTimeout&&clearTimeout(e._preloadTimeout),e._preloadTimeout=setTimeout(function(){e.preloadNearbyImages(),e._preloadTimeout=null},16)}),void k(l+o,function(){n.off(o),e.wrap.off("click"+o),e.arrowLeft&&r&&e.arrowLeft.add(e.arrowRight).destroyMfpFastClick(),e.arrowRight=e.arrowLeft=null})):!1},next:function(){e.direction=!0,e.index=$(e.index+1),e.updateItemHTML()},prev:function(){e.direction=!1,e.index=$(e.index-1),e.updateItemHTML()},goTo:function(t){e.direction=t>=e.index,e.index=t,e.updateItemHTML()},preloadNearbyImages:function(){var t,i=e.st.gallery.preload,o=Math.min(i[0],e.items.length),n=Math.min(i[1],e.items.length);for(t=1;t<=(e.direction?n:o);t++)e._preloadItem(e.index+t);for(t=1;t<=(e.direction?o:n);t++)e._preloadItem(e.index-t)},_preloadItem:function(i){if(i=$(i),!e.items[i].preloaded){var o=e.items[i];o.parsed||(o=e.parseEl(i)),I("LazyLoad",o),"image"===o.type&&(o.img=t('').on("load.mfploader",function(){o.hasSize=!0}).on("error.mfploader",function(){o.hasSize=!0,o.loadError=!0,I("LazyLoadError",o)}).attr("src",o.src)),o.preloaded=!0}}}});var Z="retina";t.magnificPopup.registerModule(Z,{options:{replaceSrc:function(t){return t.src.replace(/\.\w+$/,function(t){return"@2x"+t})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var t=e.st.retina,i=t.ratio;i=isNaN(i)?i():i,i>1&&(k("ImageHasSize."+Z,function(t,e){e.img.css({"max-width":e.img[0].naturalWidth/i,width:"100%"})}),k("ElementParse."+Z,function(e,o){o.src=t.replaceSrc(o,i)}))}}}}),function(){var e=1e3,i="ontouchstart"in window,o=function(){S.off("touchmove"+r+" touchend"+r)},n="mfpFastClick",r="."+n;t.fn.mfpFastClick=function(n){return t(this).each(function(){var s,a=t(this);if(i){var l,c,d,p,u,f;a.on("touchstart"+r,function(t){p=!1,f=1,u=t.originalEvent?t.originalEvent.touches[0]:t.touches[0],c=u.clientX,d=u.clientY,S.on("touchmove"+r,function(t){u=t.originalEvent?t.originalEvent.touches:t.touches,f=u.length,u=u[0],(Math.abs(u.clientX-c)>10||Math.abs(u.clientY-d)>10)&&(p=!0,o())}).on("touchend"+r,function(t){o(),p||f>1||(s=!0,t.preventDefault(),clearTimeout(l),l=setTimeout(function(){s=!1},e),n())})})}a.on("click"+r,function(){s||n()})})},t.fn.destroyMfpFastClick=function(){t(this).off("touchstart"+r+" click"+r),i&&S.off("touchmove"+r+" touchend"+r)}}(),T()}(window.jQuery||window.Zepto),!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){var e="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(e){var i=[],o=!1,n=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);return this!==document&&this!==window?!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[n]()>0?i.push(this):(e[n](1),o=e[n]()>0,o&&i.push(this),e[n](0))):(i.push(document.scrollingElement),!1):void 0}),i.length||this.each(function(){this===document.documentElement&&"smooth"===t(this).css("scrollBehavior")&&(i=[this]),i.length||"BODY"!==this.nodeName||(i=[this])}),"first"===e.el&&i.length>1&&(i=[i[0]]),i};t.fn.extend({scrollable:function(t){var e=n.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=n.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(e,i){if(e=e||{},"options"===e)return i?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},i);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var o=t.extend({},t.fn.smoothScroll.defaults,e),n=function(e){var i=function(t){return t.replace(/(:|\.|\/)/g,"\\$1")},n=this,r=t(this),s=t.extend({},o,r.data("ssOpts")||{}),a=o.exclude,l=s.excludeWithin,c=0,d=0,p=!0,u={},f=t.smoothScroll.filterPath(location.pathname),m=t.smoothScroll.filterPath(n.pathname),h=location.hostname===n.hostname||!n.hostname,g=s.scrollTarget||m===f,v=i(n.hash);if(v&&!t(v).length&&(p=!1),s.scrollTarget||h&&g&&v){for(;p&&c=0;t--)c(M[t])}function c(t){if(t.inited){var e=L.top<=t.limit.start?0:L.top>=t.limit.end?2:1;t.mode!=e&&h(t,e)}}function d(){for(var t=M.length-1;t>=0;t--)if(M[t].inited){var e=Math.abs(w(M[t].clone)-M[t].docOffsetTop),i=Math.abs(M[t].parent.node.offsetHeight-M[t].parent.height);if(e>=2||i>=2)return!1}return!0}function p(t){isNaN(parseFloat(t.computed.top))||t.isCell||"none"==t.computed.display||(t.inited=!0,t.clone||g(t),"absolute"!=t.parent.computed.position&&"relative"!=t.parent.computed.position&&(t.parent.node.style.position="relative"),c(t),t.parent.height=t.parent.node.offsetHeight,t.docOffsetTop=w(t.clone))}function u(t){var e=!0;t.clone&&v(t),o(t.node.style,t.css);for(var i=M.length-1;i>=0;i--)if(M[i].node!==t.node&&M[i].parent.node===t.parent.node){e=!1;break}e&&(t.parent.node.style.position=t.parent.css.position),t.mode=-1}function f(){for(var t=M.length-1;t>=0;t--)p(M[t])}function m(){for(var t=M.length-1;t>=0;t--)u(M[t])}function h(t,e){var i=t.node.style;switch(e){case 0:i.position="absolute",i.left=t.offset.left+"px",i.right=t.offset.right+"px",i.top=t.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=t.box.left+"px",i.right=t.box.right+"px",i.top=t.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=t.offset.left+"px",i.right=t.offset.right+"px",i.top="auto",i.bottom=0,i.width="auto",i.marginLeft=0,i.marginRight=0}t.mode=e}function g(t){t.clone=document.createElement("div");var e=t.node.nextSibling||t.node,i=t.clone.style;i.height=t.height+"px",i.width=t.width+"px",i.marginTop=t.computed.marginTop,i.marginBottom=t.computed.marginBottom,i.marginLeft=t.computed.marginLeft,i.marginRight=t.computed.marginRight,i.padding=i.border=i.borderSpacing=0,i.fontSize="1em",i.position="static",i.cssFloat=t.computed.cssFloat,t.node.parentNode.insertBefore(t.clone,e)}function v(t){t.clone.parentNode.removeChild(t.clone),t.clone=void 0}function y(t){var e=getComputedStyle(t),i=t.parentNode,o=getComputedStyle(i),r=t.style.position;t.style.position="relative";var s={top:e.top,marginTop:e.marginTop,marginBottom:e.marginBottom,marginLeft:e.marginLeft,marginRight:e.marginRight,cssFloat:e.cssFloat,display:e.display},a={top:n(e.top),marginBottom:n(e.marginBottom),paddingLeft:n(e.paddingLeft),paddingRight:n(e.paddingRight),borderLeftWidth:n(e.borderLeftWidth),borderRightWidth:n(e.borderRightWidth)};t.style.position=r;var l={position:t.style.position,top:t.style.top,bottom:t.style.bottom,left:t.style.left,right:t.style.right,width:t.style.width,marginTop:t.style.marginTop,marginLeft:t.style.marginLeft,marginRight:t.style.marginRight},c=b(t),d=b(i),p={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)}},u={node:t,box:{left:c.win.left,right:B.clientWidth-c.win.right},offset:{top:c.win.top-d.win.top-p.numeric.borderTopWidth,left:c.win.left-d.win.left-p.numeric.borderLeftWidth,right:-c.win.right+d.win.right-p.numeric.borderRightWidth},css:l,isCell:"table-cell"==e.display,computed:s,numeric:a,width:c.win.right-c.win.left,height:c.win.bottom-c.win.top,mode:-1,inited:!1,parent:p,limit:{start:c.doc.top-a.top,end:d.doc.top+i.offsetHeight-p.numeric.borderBottomWidth-t.offsetHeight-a.top-a.marginBottom}};return u}function w(t){for(var e=0;t;)e+=t.offsetTop,t=t.offsetParent;return e}function b(t){var i=t.getBoundingClientRect();return{doc:{top:i.top+e.pageYOffset,left:i.left+e.pageXOffset},win:i}}function C(){z=setInterval(function(){!d()&&I()},500)}function S(){clearInterval(z)}function k(){F&&(document[N]?S():C())}function x(){F||(r(),f(),e.addEventListener("scroll",s),e.addEventListener("wheel",a),e.addEventListener("resize",I),e.addEventListener("orientationchange",I),t.addEventListener(A,k),C(),F=!0)}function I(){if(F){m();for(var t=M.length-1;t>=0;t--)M[t]=y(M[t].node);f()}}function E(){e.removeEventListener("scroll",s),e.removeEventListener("wheel",a),e.removeEventListener("resize",I),e.removeEventListener("orientationchange",I),t.removeEventListener(A,k),S(),F=!1}function T(){E(),m()}function O(){for(T();M.length;)M.pop()}function _(t){for(var e=M.length-1;e>=0;e--)if(M[e].node===t)return;var i=y(t);M.push(i),F?p(i):x()}function P(t){for(var e=M.length-1;e>=0;e--)M[e].node===t&&(u(M[e]),M.splice(e,1))}var L,z,M=[],F=!1,B=t.documentElement,H=function(){},N="hidden",A="visibilitychange";void 0!==t.webkitHidden&&(N="webkitHidden",A="webkitvisibilitychange"),e.getComputedStyle||i();for(var j=["","-webkit-","-moz-","-ms-"],R=document.createElement("div"),W=j.length-1;W>=0;W--){try{R.style.position=j[W]+"sticky"}catch(Y){}""!=R.style.position&&i()}r(),e.Stickyfill={stickies:M,add:_,remove:P,init:x,rebuild:I,pause:E,stop:T,kill:O}}(document,window),window.jQuery&&!function(t){t.fn.Stickyfill=function(){return this.each(function(){ Stickyfill.add(this)}),this}}(window.jQuery);