!(function(a,b,c){function f(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+b+"=([^&#]*)",d=new RegExp(c),e=d.exec(a.location.search);if(b==="page"){return 1}return null==e?"":decodeURIComponent(e[1].replace(/\+/g," "))}(b.infinitescroll=function(c,d,e){(this.element=b(e)),this._create(c,d)}),(b.infinitescroll.defaults={loading:{finished:c,finishedMsg:"There are no more items.",img:"https://d2i6p126yvrgeu.cloudfront.net/includes/templates/york/images/bigspinner.gif",msg:null,msgText:"Loading more products...",selector:null,speed:"slow",start:c},state:{isDuringAjax:!1,isInvalidPage:!1,isDestroyed:!1,isDone:!1,isPaused:!1,currPage:1},callback:c,debug:!1,behavior:"wellca",binder:b(a),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:!1,pathParse:c,dataType:"html",appendCallback:!0,bufferPx:200,errorCallback:function(){},infid:0,pixelsFromNavToBottom:c,path:c}),(b.infinitescroll.prototype={_binding:function(b){var d=this,e=d.options;return((e.v="2.0b2.111027"),e.behavior&&this["_binding_"+e.behavior]!==c?void this["_binding_"+e.behavior].call(this):"bind"!==b&&"unbind"!==b?(this._debug("Binding value  "+b+" not valid"),!1):("unbind"==b?this.options.binder.unbind("smartscroll.infscr."+d.options.infid):this.options.binder[b]("smartscroll.infscr."+d.options.infid,function(){d.scroll()}),void this._debug("Binding",b)))},_create:function(d,e){if(!this._validate(d)){return !1}var g=(this.options=b.extend(!0,{},b.infinitescroll.defaults,d)),i=b(g.nextSelector).attr("href");return((currPage=f("page")),""!=currPage&&(g.state.currPage=currPage),(g.contentSelector=g.contentSelector||this.element),(g.loading.selector=g.loading.selector||g.contentSelector),i?((g.path=this._determinepath(i)),(g.loading.msg=b('<div id="infscr-loading"><div class="content"><img alt="Loading..." src="'+g.loading.img+'" /><div>'+g.loading.msgText+"</div></div></div>")),(new Image().src=g.loading.img),(g.pixelsFromNavToBottom=b(document).height()-b(g.navSelector).offset().top),(g.loading.start=g.loading.start||function(){b(g.navSelector).hide(),g.loading.msg.appendTo(g.loading.selector).fadeIn(g.loading.speed,function(){beginAjax(g)})}),(g.loading.finished=g.loading.finished||function(){g.loading.msg.remove()}),(g.callback=function(a,d){g.behavior&&a["_callback_"+g.behavior]!==c&&a["_callback_"+g.behavior].call(b(g.contentSelector)[0],d),e&&e.call(b(g.contentSelector)[0],d,g)}),void this._setup()):void this._debug("Navigation selector not found"))},_debug:function(){if(this.options&&this.options.debug){return a.console&&console.log.call(console,arguments)}},_determinepath:function(b){var d=this.options;if(d.behavior&&this["_determinepath_"+d.behavior]!==c){return this["_determinepath_"+d.behavior].call(this,b)}if(d.pathParse){return this._debug("pathParse manual"),d.pathParse(b,this.options.state.currPage+1)}if(b.match(/^(.*?)\b2\b(.*?$)/)){b=b.match(/^(.*?)\b2\b(.*?$)/).slice(1)}else{if(b.match(/^(.*?)2(.*?$)/)){if(b.match(/^(.*?page=)2(\/.*|$)/)){return(b=b.match(/^(.*?page=)2(\/.*|$)/).slice(1))}if(b.match(/^(.*&page=)2(\/.*|$)/)){return(b=b.match(/^(.*&page=)2(\/.*|$)/).slice(1))}b=b.match(/^(.*?)2(.*?$)/).slice(1)}else{if(b.match(/^(.*?page=)1(\/.*|$)/)){return(b=b.match(/^(.*?page=)1(\/.*|$)/).slice(1))}if(b.match(/^(.*&page=)1(\/.*|$)/)){return(b=b.match(/^(.*&page=)1(\/.*|$)/).slice(1))}this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com."),(d.state.isInvalidPage=!0)}}return this._debug("determinePath",b),b},_determinepath_wellca:function(b){var c=this.options;return c.pathParse?(this._debug("pathParse manual"),c.pathParse(b,this.options.state.currPage+1)):b.match(/^(.*?page=)[0-9]*(\/.*|$)/)?(b=b.match(/^(.*?page=)[0-9]*(\/.*|$)/).slice(1)):b},_error:function(b){var d=this.options;return d.behavior&&this["_error_"+d.behavior]!==c?void this["_error_"+d.behavior].call(this,b):("destroy"!==b&&"end"!==b&&(b="unknown"),this._debug("Error",b),"end"==b&&this._showdonemsg(),(d.state.isDone=!0),(d.state.currPage=1),(d.state.isPaused=!1),void this._binding("unbind"))},_loadcallback:function(e,f){$("#manual_load_button").show();var j,g=this.options,h=this.options.callback,i=g.state.isDone?"done":g.appendCallback?"append":"no-append";if(g.behavior&&this["_loadcallback_"+g.behavior]!==c){return void this["_loadcallback_"+g.behavior].call(this,e,f)}switch(i){case"done":return this._showdonemsg(),!1;case"no-append":"html"==g.dataType&&((f="<div>"+f+"</div>"),(f=b(f).find(g.itemSelector)));break;case"append":var k=e.children();if(0==k.length){return this._error("end")}for(j=document.createDocumentFragment();e[0].firstChild;){j.appendChild(e[0].firstChild)}this._debug("contentSelector",b(g.contentSelector)[0]),b(g.contentSelector)[0].appendChild(j),(f=k.get())}if((g.loading.finished.call(b(g.contentSelector)[0],g),g.animate)){var l=b(a).scrollTop()+b("#infscr-loading").height()+g.extraScrollPx+"px";b("html,body").animate({scrollTop:l},800,function(){(g.state.isDuringAjax=!1),b(".lazyload-unloaded").lazyload({effect:"fadeIn",threshold:100})})}g.animate||((g.state.isDuringAjax=!1),b(".lazyload-unloaded").lazyload({effect:"fadeIn",threshold:100})),h(this,f)},_nearbottom:function(){var is_in_viewport=!!$("#infinite_scroll_trip:is-in-viewport").length;if(is_in_viewport){$("#manual_load_button").hide()}this._debug("will it go?",is_in_viewport);return is_in_viewport},_pausing:function(b){var d=this.options;if(d.behavior&&this["_pausing_"+d.behavior]!==c){return void this["_pausing_"+d.behavior].call(this,b)}switch(("pause"!==b&&"resume"!==b&&null!==b&&this._debug("Invalid argument. Toggling pause value instead"),(b=!b||("pause"!=b&&"resume"!=b)?"toggle":b))){case"pause":d.state.isPaused=!0;break;case"resume":d.state.isPaused=!1;break;case"toggle":d.state.isPaused=!d.state.isPaused}return this._debug("Paused",d.state.isPaused),!1},_setup:function(){var b=this.options;return b.behavior&&this["_setup_"+b.behavior]!==c?void this["_setup_"+b.behavior].call(this):(this._binding("bind"),!1)},_showdonemsg:function(){$("#manual_load_button").hide();var d=this.options;return d.behavior&&this["_showdonemsg_"+d.behavior]!==c?void this["_showdonemsg_"+d.behavior].call(this):(d.loading.msg.find("img").hide().parent().find("div").html(d.loading.finishedMsg).animate({opacity:1},2000,function(){b(this).parent().fadeOut("normal")}),void d.errorCallback.call(b(d.contentSelector)[0],"done"))},_validate:function(c){for(var d in c){return !(d.indexOf&&d.indexOf("Selector")>-1&&0===b(c[d]).length)||(this._debug("Your "+d+" found no elements."),!1)}},bind:function(){this._binding("bind")},destroy:function(){return(this.options.state.isDestroyed=!0),this._error("destroy")},pause:function(){this._pausing("pause")},resume:function(){this._pausing("resume")},retrieve:function(d){var h,j,k,l,e=this,f=e.options,g=f.path,d=d||null;d?d:f.state.currPage;return((beginAjax=function(c){switch((c.state.currPage++,e._debug("heading into ajax",g),(h=b(b(c.contentSelector).is("table")?"<tbody/>":"<div/>")),(j=g.join(c.state.currPage)),(k="html"==c.dataType||"json"==c.dataType?c.dataType:"html+callback"),c.appendCallback&&"html"==c.dataType&&(k+="+callback"),k)){case"html+callback":e._debug("Using HTML via .load() method"),h.load(j+"&infinitescroll=true "+c.itemSelector,null,function(b){e._loadcallback(h,b)});break;case"html":case"json":e._debug("Using "+k.toUpperCase()+" via $.ajax() method"),b.ajax({url:j,dataType:c.dataType,complete:function(b,c){(l="undefined"!=typeof b.isResolved?b.isResolved():"success"===c||"notmodified"===c),l?e._loadcallback(h,b.responseText):e._error("end")}})}}),f.behavior&&this["retrieve_"+f.behavior]!==c?void this["retrieve_"+f.behavior].call(this,d):f.state.isDestroyed?(this._debug("Instance is destroyed"),!1):((f.state.isDuringAjax=!0),void f.loading.start.call(b(f.contentSelector)[0],f)))},scroll:function(){var b=this.options,d=b.state;return b.behavior&&this["scroll_"+b.behavior]!==c?void this["scroll_"+b.behavior].call(this):void (d.isDuringAjax||d.isInvalidPage||d.isDone||d.isDestroyed||d.isPaused||(this._nearbottom()&&this.retrieve()))},toggle:function(){this._pausing()},unbind:function(){this._binding("unbind")},update:function(c){b.isPlainObject(c)&&(this.options=b.extend(!0,this.options,c))}}),(b.fn.infinitescroll=function(c,d){var e=typeof c;switch(e){case"string":var f=Array.prototype.slice.call(arguments,1);this.each(function(){var a=b.data(this,"infinitescroll");return !!a&&!(!b.isFunction(a[c])||"_"===c.charAt(0))&&void a[c].apply(a,f)});break;case"object":this.each(function(){var a=b.data(this,"infinitescroll");a?a.update(c):b.data(this,"infinitescroll",new b.infinitescroll(c,d,this))})}return this});var e,d=b.event;(d.special.smartscroll={setup:function(){b(this).bind("scroll",d.special.smartscroll.handler);b(this).bind("touchend",d.special.smartscroll.handler)},teardown:function(){b(this).unbind("scroll",d.special.smartscroll.handler);b(this).unbind("touchend",d.special.smartscroll.handler)},handler:function(a,c){var d=this,f=arguments;(a.type="smartscroll"),e&&clearTimeout(e),(e=setTimeout(function(){b.event.dispatch.apply(d,f)},"execAsap"===c?0:100))}}),(b.fn.smartscroll=function(a){return a?this.bind("smartscroll",a):this.trigger("smartscroll",["execAsap"])})})(window,jQuery),(function(a,b){($window=a(b)),(a.fn.lazyload=function(c){function f(){var b=0;d.each(function(){var c=a(this);if(!e.skip_invisible||c.is(":visible")){if(a.abovethetop(this,e)||a.leftofbegin(this,e)){}else{if(a.belowthefold(this,e)||a.rightoffold(this,e)){if(++b>e.failure_limit){return !1}}else{c.trigger("appear")}}}})}var d=this,e={threshold:100,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null};return(c&&(void 0!==c.failurelimit&&((c.failure_limit=c.failurelimit),delete c.failurelimit),void 0!==c.effectspeed&&((c.effect_speed=c.effectspeed),delete c.effectspeed),a.extend(e,c)),($container=void 0===e.container||e.container===b?$window:a(e.container)),0===e.event.indexOf("scroll")&&($container.bind(e.event,function(a){return f()}),$window.bind("update_lazy_load_images",function(a){return f()})),this.each(function(){var b=this,c=a(b);(b.loaded=!1),c.one("appear",function(){if(!this.loaded){if(e.appear){var f=d.length;e.appear.call(b,f,e)}a("<img />").bind("load",function(){c.hide().attr("src",c.data(e.data_attribute))[e.effect](e.effect_speed).removeClass("lazyload-unloaded").addClass("lazyload-loaded"),(b.loaded=!0);var f=a.grep(d,function(a){return !a.loaded});if(((d=a(f)),e.load)){var g=d.length;e.load.call(b,g,e)}}).attr("src",c.data(e.data_attribute))}}),0!==e.event.indexOf("scroll")&&c.bind(e.event,function(a){b.loaded||c.trigger("appear")})}),$window.bind("resize",function(a){f()}),f(),this)}),(a.belowthefold=function(c,d){var e;return(e=void 0===d.container||d.container===b?$window.height()+$window.scrollTop():$container.offset().top+$container.height()),e<=a(c).offset().top-d.threshold}),(a.rightoffold=function(c,d){var e;return(e=void 0===d.container||d.container===b?$window.width()+$window.scrollLeft():$container.offset().left+$container.width()),e<=a(c).offset().left-d.threshold}),(a.abovethetop=function(c,d){var e;return(e=void 0===d.container||d.container===b?$window.scrollTop():$container.offset().top),e>=a(c).offset().top+d.threshold+a(c).height()}),(a.leftofbegin=function(c,d){var e;return(e=void 0===d.container||d.container===b?$window.scrollLeft():$container.offset().left),e>=a(c).offset().left+d.threshold+a(c).width()}),(a.inviewport=function(b,c){return !(a.rightofscreen(b,c)||a.leftofscreen(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))}),a.extend(a.expr[":"],{"below-the-fold":function(c){return a.belowthefold(c,{threshold:0,container:b})},"above-the-top":function(c){return !a.belowthefold(c,{threshold:0,container:b})},"right-of-screen":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-screen":function(c){return !a.rightoffold(c,{threshold:0,container:b})},"in-viewport":function(c){return !a.inviewport(c,{threshold:0,container:b})},"above-the-fold":function(c){return !a.belowthefold(c,{threshold:0,container:b})},"right-of-fold":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-fold":function(c){return !a.rightoffold(c,{threshold:0,container:b})}}),a(document).ready(function(){a(".lazyload-unloaded").lazyload({effect:"fadeIn",threshold:100})})})(jQuery,window);$.fn.isInViewport=function(){var elementTop=$(this).offset().top;var elementBottom=elementTop+$(this).outerHeight();var viewportTop=$(window).scrollTop();var viewportBottom=viewportTop+$(window).height();return elementBottom>viewportTop&&elementTop<viewportBottom};$.extend($.expr[":"],{"is-in-viewport":function(c){return $(c).isInViewport()}});var lazyLoadScrollHandler=function(){$(".lazyload-unloaded:is-in-viewport").trigger("appear")};$(window).on("scroll",lazyLoadScrollHandler);$(window).on("touchmove",lazyLoadScrollHandler);$(window).on("touchend",lazyLoadScrollHandler);$(document).ready(lazyLoadScrollHandler);