function isRightBarStickyNeeded(){return $(window).width()>992}function makeStaticRightBarSticky(){isRightBarStickyNeeded()&&$(".right-bar-column").each(function(n){var t=$(this),i=t.find(".right-bar-section").last(),e=$(window).height(),l=$(".right-bar-column").length,u,s,y,p;if(t&&i){var a=t.parent().find(".col-md-8").first()?t.parent().find(".col-md-8").first():t.parent(),r=a.outerHeight(),o=i.outerHeight();if(t.addClass("rightbar-is-sticky"),u=e-o,s="bottom-in-view",o+150>=r||r<e)return!0;t.height(r);$searchFilter=t.find(".mobile-minitablet-smdesktop-hide-element");$searchFilter.length&&(u-=$searchFilter.last().height());var f=t.parents(".posts"),h=f.prevAll("div"),c=f.nextAll("div"),w=$(h[0]).hasClass("horizontal-widget")||$(h[0]).hasClass("more-posts-divider"),v=$(c[0]).hasClass("horizontal-widget")||$(c[0]).hasClass("more-posts-divider")||f.next(".horizontal-widget").length;(v||n==l-1)&&i.css("background","transparent");y=new Waypoint({element:t,handler:function(n){n=="down"?i.removeClass("unstuck").addClass("stuck"):n=="up"&&i.removeClass("stuck").removeClass("unstuck")},offset:u});p=new Waypoint({element:t,handler:function(n){n=="down"?i.removeClass("stuck").addClass("unstuck"):n=="up"&&i.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 trackFlexiblelistposition(){var t=new MutationObserver(function(n){n.forEach(function(n){[].filter.call(n.addedNodes,function(n){return n.nodeName==="video"}).forEach(function(n){console.log("video added");n.addEventListener("loaddata",function(n){RemoveSticky();try{makeStaticRightBarSticky()}catch(n){console.warn(n)}})})})}),n=document.getElementById("div-oop-gpt-ad-flexiblelistposition");n!==null&&t.observe(n,{childList:!0,subtree:!0})}function trackPrestitialScroll(){if(isRightBarStickyNeeded()){var n=document.getElementById("prestitialWrapper");n!=null&&$("#prestitialWrapper").mouseleave(function(){Waypoint.refreshAll()})}}function RecreateRightBar(){if(isRightBarStickyNeeded()&&$(".right-bar-column").first().hasClass("rightbar-is-sticky")){console.log("RightBar recreated after ads load");RemoveSticky();try{makeStaticRightBarSticky()}catch(n){console.warn(n)}}}function RemoveSticky(){$(".right-bar-column").each(function(){$(this).height("auto");$(this).removeClass("rightbar-is-sticky")});$(".right-bar-section.stuck").removeClass("stuck");$(".right-bar-section.unstuck").removeClass("unstuck");Waypoint.destroyAll()}function externalLinksNewTab(){var u,r,t,n,i;for(console.log("external links"),u=window.location.hostname,r=document.getElementsByTagName("a"),t=0;t<r.length;t++)n=r[t],i=n.hostname,i&&i!=="localhost"&&i!==u&&(n.target||(n.target="_blank"),n.rel||(n.rel="noopener"))}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),e=$(".posts").last(),u=t.attr("href"),r=t.data("pageNumber"),i=t.data("pageParam"),f=t.data("ajaxPath");return f?(n.stopImmediatePropagation(),n.preventDefault,$.ajax({type:"GET",cache:!1,url:f,dataType:"html",beforeSend:function(){t.attr("disabled","disabled");t.text("Loading...")},success:function(n){var o,s,h;if($.trim(n)!=""){if(e.append(n),findAndLoadDynamicAds(n),makeLastRightBarSectionSticky(),o=r+1,t.data("pageNumber",o),t.data("pageParam",i),s=u.replace(i+"="+r,i+"="+o),t.attr("href",s),h=f.replace(i+"="+r,i+"="+o),t.data("ajaxPath",h),observeLozad(),history.pushState)switch(i){case"page":window.history.pushState({page:r},document.title,u);break;case"pagenum":window.history.pushState({pagenum:r},document.title,u)}}else t.parent().hide()},error:function(){},complete:function(){t.removeAttr("disabled");t.text("Load More")}}),!1):!0}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.addClass("rightbar-is-sticky");var i=n.parent().outerHeight(),r=i,u=t.outerHeight(),f=$(window).height();if(u>=r||r<f)return;n.height(i)}}function defineAndRefreshDynamicPosition(n,t,i){if(t===""&&googletag&&window.constant.dfpAdConfig.dynamicPositions){const i=window.constant.dfpAdConfig.dynamicPositions.filter(function(t){return t.name===n});i&&$.isArray(i)&&i.length>0&&(t=i[0].sizes)}n&&t&&i&&googletag.cmd.push(function(){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(){"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.Context.refreshAll();for(var i in t)t[i].enabled=!0;return this};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(u){this.element=u;this.Adapter=t.Adapter;this.adapter=new this.Adapter(u);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:{}};u.waypointContextKey=this.key;i[u.waypointContextKey]=this;r+=1;t.windowContext||(t.windowContext=!0,t.windowContext=new n(window));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),r=this.element==this.element.window;n&&t&&!r&&(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,n,s;for(r in i){var t=i[r],h=t.newScroll>t.oldScroll,c=h?t.forward:t.backward;for(f in this.waypoints[r])if(n=this.waypoints[r][f],n.triggerPoint!==null){var e=t.oldScroll<n.triggerPoint,o=t.newScroll>=n.triggerPoint,l=e&&o,a=!e&&!o;(l||a)&&(n.queueTrigger(c),u[n.group.id]=n.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=Math.floor(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))}();$(window).on("load",function(){try{makeStaticRightBarSticky()}catch(n){console.warn(n)}trackTopAdHeight();trackPrestitialScroll();trackFlexiblelistposition();externalLinksNewTab();console.log("RightBar created on LOAD")});$(window).resize(function(){if(isRightBarStickyNeeded())if($(".right-bar-column").first().hasClass("rightbar-is-sticky"))Waypoint.refreshAll();else try{makeStaticRightBarSticky()}catch(n){console.warn(n)}else $(".right-bar-column").first().hasClass("rightbar-is-sticky")&&RemoveSticky()});window.loadMorePostsFirstPage=function(n,t){var i=$("#postlist-container").last(),r=n,u=t?t:"Loading more stories...";return $.ajax({type:"GET",cache:!1,url:r,dataType:"html",beforeSend:function(){$box=$("<div/>").addClass("loading p-14-gray text-center margin-bottom-10");$box.append($("<p/>").text(u));$box.append($("<p/>").append($("<img/>").attr("src","/content/img/spinner-1s-81px.gif")));i.append($box)},success:function(n){$.trim(n)!=""&&(i.append(n),findAndLoadDynamicAds(n),makeLastRightBarSectionSticky(),observeLozad())},error:function(){},complete:function(){i.find(".loading").remove()}}),!1};window.loadContentOffers=function(n){var t=$("#contentoffers-container").last(),i=n;return $.ajax({type:"GET",cache:!1,url:i,dataType:"html",beforeSend:function(){$box=$("<div/>").addClass("loading p-14-gray text-center margin-bottom-10");$box.append($("<p/>").text("Loading related content..."));$box.append($("<p/>").append($("<img/>").attr("src","/content/img/spinner-1s-81px.gif")));t.append($box)},success:function(n){$.trim(n)!=""&&(t.append(n),observeLozad())},error:function(){},complete:function(){t.find(".loading").remove()}}),!1};window.loadSolutionProviders=function(n){var t=$(".article-img").first(),i=n;if(t.length!=0)return $.ajax({type:"GET",startTime:performance.now(),cache:!1,url:i,dataType:"html",beforeSend:function(){},success:function(n){var r,i,u;$.trim(n)!=""&&t.after(n);r=performance.now()-this.startTime;i=r/1e3;i=i.toFixed(3);u="AJAX request took "+i+" seconds to complete.";console.log(u)},error:function(){},complete:function(){}}),!1};$(function(){$(document).on("click",".posts-load-more",loadMorePosts)})