function rightBarStickyNeeded(){return $(window).width()>992}function loadMorePosts(n){if(n.stopImmediatePropagation(),n.preventDefault,$(this).attr("disabled")=="disabled")return!1;$(this).blur();var t=$(this),f=$(".posts").last(),i=t.attr("href"),r=t.data("pageNumber"),u=t.data("pageParam"),e=i;return $.ajax({type:"GET",cache:!1,url:e,dataType:"html",beforeSend:function(){t.attr("disabled","disabled");t.text("Loading...")},success:function(n){var s,e,o;if($.trim(n)!=""){if(f.append(n),findAndLoadDynamicAds(n),makeLastRightBarSectionSticky(),s=$(".posts-load-more").waypoint(function(n){n=="down"&&$(this.element).trigger("click");this.destroy()},{offset:$(window).height()+100}),e=r+1,t.data("pageNumber",e),t.data("pageParam",u),o=i.replace(u+"="+r,u+"="+e),t.attr("href",o),reloadGoogleAnalytics(i),history.pushState)switch(u){case"page":window.history.pushState({page:r},document.title,i);break;case"pagenum":window.history.pushState({pagenum:r},document.title,i)}}else t.parent().hide()},error:function(){alert("There was an error loading more.")},complete:function(){t.removeAttr("disabled");t.text("Load More")}}),!1}function makeLastRightBarSectionSticky(){var n,t;if(rightBarStickyNeeded()&&(n=$(".posts").last().find(".right-bar-column").last(),t=n.find(".right-bar-section").last(),n&&t)){n.height(n.parent().outerHeight());var r=$(window).height(),u=n.outerHeight(),i=t.outerHeight();if(i>=u)return;n.waypoint(function(n){n=="down"?t.removeClass("unstuck").addClass("stuck"):n=="up"&&t.removeClass("stuck").removeClass("unstuck")},{offset:r-i});n.waypoint(function(n){n=="down"?t.removeClass("stuck").addClass("unstuck"):n=="up"&&t.removeClass("unstuck").addClass("stuck")},{offset:"bottom-in-view"})}}function reloadGoogleAnalytics(n){window.ga&&ga.create&&n&&ga("send","pageview",{page:n})}function defineAndRefreshDynamicPosition(n,t,i){if(n&&t&&i){var r=googletag.defineSlot("/"+window.constant.dfpAccountId+"/"+n,t,i).addService(googletag.pubads());googletag.display(i);googletag.pubads().refresh([r])}}function findAndLoadDynamicAds(n){$data=$(n);$dynamicAds=$data.find("."+window.constant.dfpDynamicAdCssClass);$dynamicAds.each(function(){var n=$(this).data("dfpPositionName"),t=$(this).data("dfpPositionSizes"),i=$(this).attr("id");defineAndRefreshDynamicPosition(n,t,i)})}function isRightBarStickyNeeded(){return $(window).width()>992}function makeStaticRightBarSticky(){isRightBarStickyNeeded()&&$(".right-bar-column").each(function(){var n=$(this),t=n.find(".right-bar-section").last(),u=$(window).height(),a=$(".right-bar-column").length,o,i,h,c;if(n&&t&&typeof n.waypoint=="function"){o=n.parent().find(".col-md-8").first()?n.parent().find(".col-md-8").first():n.parent();n.height(o.outerHeight());var f=n.outerHeight(),r=t.outerHeight(),l=50,e=u-r,s="bottom-in-view";if(r+250>=f||f<u||(i=0,r<30?(h=t.children().first(),h.children().each(function(){i+=$(this).height()})):t.children().each(function(){i+=$(this).height()}),i+250>=f||i==0&&r==0))return!0;i>r&&(e=u-i);$searchFilter=n.find(".mobile-minitablet-smdesktop-hide-element");$searchFilter.length&&(e-=$searchFilter.last().height());c=$(".article-body").length>0;c||(l=50,t.css("background","transparent"),s="bottom-in-view");n.waypoint(function(n){n=="down"?t.removeClass("unstuck").addClass("stuck"):n=="up"&&t.removeClass("stuck").removeClass("unstuck")},{offset:e});n.waypoint(function(n){n=="down"?t.removeClass("stuck").addClass("unstuck"):n=="up"&&t.removeClass("unstuck").addClass("stuck")},{offset:s})}})}function trackTopAdHeight(){if(isRightBarStickyNeeded()){var t=new MutationObserver(function(n){for(var i,t=0;t<n.length;t++)i=n[t],i.type=="attributes"&&i.attributeName=="style"&&Waypoint.refreshAll()}),n=document.getElementById("div-oop-gpt-ad-top02");n!=null&&t.observe(n,{attributes:!0,childList:!0,subtree:!0})}}function trackPrestitialScroll(){if(isRightBarStickyNeeded()){var n=document.getElementById("prestitialWrapper");n!=null&&$("#prestitialWrapper").mouseleave(function(){Waypoint.refreshAll()})}}(function(){"use strict";function n(r){if(!r)throw new Error("No options passed to Waypoint constructor");if(!r.element)throw new Error("No element option passed to Waypoint constructor");if(!r.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+i;this.options=n.Adapter.extend({},n.defaults,r);this.element=this.options.element;this.adapter=new n.Adapter(this.element);this.callback=r.handler;this.axis=this.options.horizontal?"horizontal":"vertical";this.enabled=this.options.enabled;this.triggerPoint=null;this.group=n.Group.findOrCreate({name:this.options.group,axis:this.axis});this.context=n.Context.findOrCreateByElement(this.options.context);n.offsetAliases[this.options.offset]&&(this.options.offset=n.offsetAliases[this.options.offset]);this.group.add(this);this.context.add(this);t[this.key]=this;i+=1}var i=0,t={};n.prototype.queueTrigger=function(n){this.group.queueTrigger(this,n)};n.prototype.trigger=function(n){this.enabled&&this.callback&&this.callback.apply(this,n)};n.prototype.destroy=function(){this.context.remove(this);this.group.remove(this);delete t[this.key]};n.prototype.disable=function(){return this.enabled=!1,this};n.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this};n.prototype.next=function(){return this.group.next(this)};n.prototype.previous=function(){return this.group.previous(this)};n.invokeAll=function(n){var r=[],u,i,f;for(u in t)r.push(t[u]);for(i=0,f=r.length;i<f;i++)r[i][n]()};n.destroyAll=function(){n.invokeAll("destroy")};n.disableAll=function(){n.invokeAll("disable")};n.enableAll=function(){n.invokeAll("enable")};n.refreshAll=function(){n.Context.refreshAll()};n.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight};n.viewportWidth=function(){return document.documentElement.clientWidth};n.adapters=[];n.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0};n.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}};window.Waypoint=n})(),function(){"use strict";function f(n){window.setTimeout(n,1e3/60)}function n(n){this.element=n;this.Adapter=t.Adapter;this.adapter=new this.Adapter(n);this.key="waypoint-context-"+r;this.didScroll=!1;this.didResize=!1;this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()};this.waypoints={vertical:{},horizontal:{}};n.waypointContextKey=this.key;i[n.waypointContextKey]=this;r+=1;this.createThrottledScrollHandler();this.createThrottledResizeHandler()}var r=0,i={},t=window.Waypoint,u=window.onload;n.prototype.add=function(n){var t=n.options.horizontal?"horizontal":"vertical";this.waypoints[t][n.key]=n;this.refresh()};n.prototype.checkEmpty=function(){var n=this.Adapter.isEmptyObject(this.waypoints.horizontal),t=this.Adapter.isEmptyObject(this.waypoints.vertical);n&&t&&(this.adapter.off(".waypoints"),delete i[this.key])};n.prototype.createThrottledResizeHandler=function(){function i(){n.handleResize();n.didResize=!1}var n=this;this.adapter.on("resize.waypoints",function(){n.didResize||(n.didResize=!0,t.requestAnimationFrame(i))})};n.prototype.createThrottledScrollHandler=function(){function i(){n.handleScroll();n.didScroll=!1}var n=this;this.adapter.on("scroll.waypoints",function(){(!n.didScroll||t.isTouch)&&(n.didScroll=!0,t.requestAnimationFrame(i))})};n.prototype.handleResize=function(){t.Context.refreshAll()};n.prototype.handleScroll=function(){var u={},i={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},r,f,s;for(r in i){var n=i[r],h=n.newScroll>n.oldScroll,c=h?n.forward:n.backward;for(f in this.waypoints[r]){var t=this.waypoints[r][f],e=n.oldScroll<t.triggerPoint,o=n.newScroll>=t.triggerPoint,l=e&&o,a=!e&&!o;(l||a)&&(t.queueTrigger(c),u[t.group.id]=t.group)}}for(s in u)u[s].flushTriggers();this.oldScroll={x:i.horizontal.newScroll,y:i.vertical.newScroll}};n.prototype.innerHeight=function(){return this.element==this.element.window?t.viewportHeight():this.adapter.innerHeight()};n.prototype.remove=function(n){delete this.waypoints[n.axis][n.key];this.checkEmpty()};n.prototype.innerWidth=function(){return this.element==this.element.window?t.viewportWidth():this.adapter.innerWidth()};n.prototype.destroy=function(){var t=[],i,r,n,u;for(i in this.waypoints)for(r in this.waypoints[i])t.push(this.waypoints[i][r]);for(n=0,u=t.length;n<u;n++)t[n].destroy()};n.prototype.refresh=function(){var u=this.element==this.element.window,l=u?undefined:this.adapter.offset(),f={},o,e,i,a;this.handleScroll();o={horizontal:{contextOffset:u?0:l.left,contextScroll:u?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:u?0:l.top,contextScroll:u?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(e in o){i=o[e];for(a in this.waypoints[e]){var n=this.waypoints[e][a],r=n.options.offset,v=n.triggerPoint,y=0,s=v==null,p,h,c,w,b;n.element!==n.element.window&&(y=n.adapter.offset()[i.offsetProp]);typeof r=="function"?r=r.apply(n):typeof r=="string"&&(r=parseFloat(r),n.options.offset.indexOf("%")>-1&&(r=Math.ceil(i.contextDimension*r/100)));p=i.contextScroll-i.contextOffset;n.triggerPoint=y+p-r;h=v<i.oldScroll;c=n.triggerPoint>=i.oldScroll;w=h&&c;b=!h&&!c;!s&&w?(n.queueTrigger(i.backward),f[n.group.id]=n.group):!s&&b?(n.queueTrigger(i.forward),f[n.group.id]=n.group):s&&i.oldScroll>=n.triggerPoint&&(n.queueTrigger(i.forward),f[n.group.id]=n.group)}}return t.requestAnimationFrame(function(){for(var n in f)f[n].flushTriggers()}),this};n.findOrCreateByElement=function(t){return n.findByElement(t)||new n(t)};n.refreshAll=function(){for(var n in i)i[n].refresh()};n.findByElement=function(n){return i[n.waypointContextKey]};window.onload=function(){u&&u();n.refreshAll()};t.requestAnimationFrame=function(n){var t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||f;t.call(window,n)};t.Context=n}(),function(){"use strict";function i(n,t){return n.triggerPoint-t.triggerPoint}function u(n,t){return t.triggerPoint-n.triggerPoint}function n(n){this.name=n.name;this.axis=n.axis;this.id=this.name+"-"+this.axis;this.waypoints=[];this.clearTriggerQueues();r[this.axis][this.name]=this}var r={vertical:{},horizontal:{}},t=window.Waypoint;n.prototype.add=function(n){this.waypoints.push(n)};n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}};n.prototype.flushTriggers=function(){var n,t,e,r,o,f;for(n in this.triggerQueues)for(t=this.triggerQueues[n],e=n==="up"||n==="left",t.sort(e?u:i),r=0,o=t.length;r<o;r+=1)f=t[r],(f.options.continuous||r===t.length-1)&&f.trigger([n]);this.clearTriggerQueues()};n.prototype.next=function(n){this.waypoints.sort(i);var r=t.Adapter.inArray(n,this.waypoints),u=r===this.waypoints.length-1;return u?null:this.waypoints[r+1]};n.prototype.previous=function(n){this.waypoints.sort(i);var r=t.Adapter.inArray(n,this.waypoints);return r?this.waypoints[r-1]:null};n.prototype.queueTrigger=function(n,t){this.triggerQueues[t].push(n)};n.prototype.remove=function(n){var i=t.Adapter.inArray(n,this.waypoints);i>-1&&this.waypoints.splice(i,1)};n.prototype.first=function(){return this.waypoints[0]};n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]};n.findOrCreate=function(t){return r[t.axis][t.name]||new n(t)};t.Group=n}(),function(){"use strict";function t(t){this.$element=n(t)}var n=window.jQuery,i=window.Waypoint;n.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(n,i){t.prototype[i]=function(){var n=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,n)}});n.each(["extend","inArray","isEmptyObject"],function(i,r){t[r]=n[r]});i.adapters.push({name:"jquery",Adapter:t});i.Adapter=t}(),function(){"use strict";function n(n){return function(){var r=[],i=arguments[0];return n.isFunction(arguments[0])&&(i=n.extend({},arguments[1]),i.handler=arguments[0]),this.each(function(){var u=n.extend({},i,{element:this});typeof u.context=="string"&&(u.context=n(this).closest(u.context)[0]);r.push(new t(u))}),r}}var t=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=n(window.jQuery));window.Zepto&&(window.Zepto.fn.waypoint=n(window.Zepto))}();$(function(){$(document).on("click",".posts-load-more",loadMorePosts);$(window).resize(function(){rightBarStickyNeeded()?Waypoint.refreshAll():Waypoint.destroyAll()})});$(window).on("load",function(){makeStaticRightBarSticky();trackTopAdHeight();trackPrestitialScroll()})