doFir.push(function(){(function($){var cache={},uuid=0;$.fn.once=function(id,fn){if(typeof id!='string'){if(!(id in cache)){cache[id]=++uuid}
if(!fn){fn=id}
id='jquery-once-'+cache[id]}
var name=id+'-processed';var elements=this.not('.'+name).addClass(name);return $.isFunction(fn)?elements.each(fn):elements};$.fn.removeOnce=function(id,fn){var name=id+'-processed';var elements=this.filter('.'+name).removeClass(name);return $.isFunction(fn)?elements.each(fn):elements}})(jQuery);(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.type='text/javascript';j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'';j.async=!0;f.parentNode.insertBefore(j,f)})(window,document,'script','dataLayer','GTM-TVS8NW5');(function(){var g=/\[object (Boolean|Number|String|Function|Array|Date|RegExp)\]/;function h(a){return null==a?String(a):(a=g.exec(Object.prototype.toString.call(Object(a))))?a[1].toLowerCase():"object"}function k(a,b){return Object.prototype.hasOwnProperty.call(Object(a),b)}function m(a){if(!a||"object"!=h(a)||a.nodeType||a==a.window)return!1;try{if(a.constructor&&!k(a,"constructor")&&!k(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}for(var c in a);return void 0===c||k(a,c)};function n(a,b,c){this.b=a;this.f=b||function(){};this.d=!1;this.a={};this.c=[];this.e=p(this);r(this,a,!c);var d=a.push,e=this;a.push=function(){var b=[].slice.call(arguments,0),c=d.apply(a,b);r(e,b);return c}}window.DataLayerHelper=n;n.prototype.get=function(a){var b=this.a;a=a.split(".");for(var c=0;c<a.length;c++){if(void 0===b[a[c]])return;b=b[a[c]]}return b};n.prototype.flatten=function(){this.b.splice(0,this.b.length);this.b[0]={};s(this.a,this.b[0])};function r(a,b,c){for(a.c.push.apply(a.c,b);!1===a.d&&0<a.c.length;){b=a.c.shift();if("array"==h(b))a:{var d=b,e=a.a;if("string"==h(d[0])){for(var f=d[0].split("."),u=f.pop(),d=d.slice(1),l=0;l<f.length;l++){if(void 0===e[f[l]])break a;e=e[f[l]]}try{e[u].apply(e,d)}catch(v){}}}else if("function"==typeof b)try{b.call(a.e)}catch(w){}else if(m(b))for(var q in b)s(t(q,b[q]),a.a);else continue;c||(a.d=!0,a.f(a.a,b),a.d=!1)}}
function p(a){return{set:function(b,c){s(t(b,c),a.a)},get:function(b){return a.get(b)}}}function t(a,b){for(var c={},d=c,e=a.split("."),f=0;f<e.length-1;f++)d=d[e[f]]={};d[e[e.length-1]]=b;return c}function s(a,b){for(var c in a)if(k(a,c)){var d=a[c];"array"==h(d)?("array"==h(b[c])||(b[c]=[]),s(d,b[c])):m(d)?(m(b[c])||(b[c]={}),s(d,b[c])):b[c]=d}}})();(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);var ibtmediaDfp=function(){};var adblock_status='';(function($){ibtmediaDfp=$.fn.ibtmediaDfp=$.ibtmediaDfp=function ibtmediaDfp(){if(typeof Drupal.settings.ibtmediaDfp=='undefined'){return}
var config=Drupal.settings.ibtmediaDfp;if(typeof config=='undefined'||!config){return}
this.config=config;this.inArray=function(needle,haystack){var length=haystack.length;for(var i=0;i<length;i++){if(haystack[i]==needle){return!0}}
return!1};this.getNextSlotId=function(){this.nextSlotId++;return this.nextSlotId}
this.init=function(){var initilized=(typeof this.config.initilized!='undefined'&&this.config.initilized==!0)?!0:!1;var ibtmediaDfp=this;var config=this.config;if(!initilized){$(document).on('dynamicdfp',function(event){ibtmediaDfp.debug('triggered '+event.type+' event',event);var update=!0;if(typeof event.update!='undefined'){update=event.update}
var tags=[];if(typeof event.tags!='undefined'){tags=event.tags}else{tags=$('.dfp-dynamic-tag')}
if(tags.length>0){tags.each(function(){var tag=$(this);var position=tag.data('position');if(event.positions.length>0){if(!ibtmediaDfp.inArray(position,event.positions)){return}}else{return}
ibtmediaDfp.debug('position '+position);var tagSlot=tag.data('slot');if(tagSlot!=undefined&&update==!1){return}
var wrapperId=tag.data('wrapper_id');var placeholderId=tag.data('placeholder_id')+'-adslot-'+ibtmediaDfp.getNextSlotId();tag.html('<div id="'+placeholderId+'" class="'+wrapperId+'">');if(typeof event.colorbox=='object'&&!$.isEmptyObject(event.colorbox)){var colorboxSettings={html:$('#'+placeholderId),fixed:!0,closeButton:!1,scrolling:!1};$.extend(colorboxSettings,event.colorbox);$.colorbox(colorboxSettings);ibtmediaDfp.debug('opening '+position+' tag in colorbox',placeholderId)}
var yieldbotEnabled=tag.data('yieldbot_enabled');var rubiconEnabled=tag.data('rubicon_enabled');var adunit=tag.data('adunit');var size=tag.data('size');var mappingSizes=tag.data('mapping');var position=tag.data('position');if(config.yieldbot&&yieldbotEnabled){ybotq.push(function(){googletag.cmd.push(function(){ibtmediaDfp.googletagRefresh(tag,placeholderId,adunit,size,mappingSizes,position)})})}else{googletag.cmd.push(function(){ibtmediaDfp.googletagRefresh(tag,placeholderId,adunit,size,mappingSizes,position)})}
if(config.rubicon&&rubiconEnabled){rubicontag.cmd.push(function(){ibtmediaDfp.googletagRubiconRefresh(tag,placeholderId,adunit,size,mappingSizes,position)})}})}else{ibtmediaDfp.debug('$(".dfp-dynamic-tag") tags are not found',$('.dfp-dynamic-tag'),'error')}});if(config.yieldbot){ybotq.push(function(){googletag.cmd.push(function(){ibtmediaDfp.googletagRenderEnded()})})}else{googletag.cmd.push(function(){ibtmediaDfp.googletagRenderEnded()})}
ibtmediaDfp.debug('initilized',ibtmediaDfp);initilized=!0;this.nextSlotId=0}
Drupal.settings.ibtmediaDfp.initilized=initilized;$.event.trigger({type:'ibtmediaDfpReady',ibtmediaDfp:this})};this.googletagRefresh=function(tag,placeholderId,adunit,size,mappingSizes,position){var browserSize,adSizes;var ibtmediaDfp=this;var slot=googletag.defineSlot(adunit,size,placeholderId).setTargeting("pos",position).addService(googletag.pubads());tag.data('slot',slot);if(typeof apstag!=='undefined'){var placeholderId_apstag=tag.data('placeholder_id');nw_log("apstag refresh "+placeholderId);apstag.fetchBids({slots:[{slotID:placeholderId,sizes:size}]},function(bids){apstag.setDisplayBids();googletag.pubads().refresh([slot])})}else{googletag.pubads().refresh([slot])}
ibtmediaDfp.debug('refreshing '+placeholderId,slot)},this.googletagRubiconRefresh=function(tag,placeholderId,adunit,size,mappingSizes,position){var ibtmediaDfp=this;rubicontag.defineSlot(adunit,size,placeholderId).setPosition(position).setFPI('domain',ibtmediaDfp.config.site_url);rubicontag.setTargetingForGPTSlot(googletag.slots[position])},this.googletagRenderEnded=function(){var ibtmediaDfp=this;googletag.pubads().addEventListener('slotRenderEnded',function(event){var tags=$('.dfp-dynamic-tag');if(tags.length>0){tags.each(function(){var tag=$(this);var tagSlot=tag.data('slot');if(event.slot===tagSlot){ibtmediaDfp.debug('render ended for '+tag.data('placeholder_id'),event);if($("#colorbox").length>0&&$("#colorbox").css("display")=="block"){$.colorbox.resize({innerWidth:event.size[0],innerHeight:event.size[1]})}}})}
if(event.slot===googletag.slots.adhesion){nw_log('dfp adhesion is on this page');$('html').css('padding-bottom',50)}});googletag.pubads().addEventListener('impressionViewable',function(event){var body=$('body');if(googletag.slots.top==event.slot){var obj=$('#dfp-ad-top');if(obj.hasClass('impview')&&!obj.hasClass('unstick')&&!obj.hasClass('sticky')){}}
if(googletag.slots.right1==event.slot){var obj=$('#dfp-ad-right1');if(obj.hasClass('impview')&&!obj.hasClass('unstick')&&!obj.hasClass('sticky')){}}
if(googletag.slots.right2==event.slot){var obj=$('#dfp-ad-right2');if(obj.hasClass('impview')&&!obj.hasClass('unstick')&&!obj.hasClass('sticky')){}}
if(googletag.slots.right3==event.slot){var obj=$('#dfp-ad-right3');if(obj.hasClass('impview')&&!obj.hasClass('unstick')&&!obj.hasClass('sticky')){}}
if(googletag.slots.right4==event.slot){var obj=$('#dfp-ad-right4');if(obj.hasClass('impview')&&!obj.hasClass('unstick')&&!obj.hasClass('sticky')){}}})},this.triggerDfpAd=function(positions,colorbox){$.event.trigger({type:'dynamicdfp',positions:positions,colorbox:colorbox})};this.debug=function(message,data,type){if(this.config.debug){nw_log(message);type=!type?'message':type;var prefix='%cDFP Ad: ';if(type=='message'){style='font-size: 16px; font-weight: bold; color: #002654;'}else if(type=='error'){prefix='%cDFP Ad Error: ';style='font-size: 16px; font-weight: bold; color: #e55b5b;'}
if(!data){data=''}
nw_log(prefix+message,style,data)}}
this.init()};Drupal.behaviors.ibtmediaDfp={attach:function(context,settings){if(context=='#cboxLoadedContent'){return}
var ibtdfp=new ibtmediaDfp();$('#edit-ibtmedia-dfp-dynamic-tag-test-button').click(function(){var positions=$('#edit-ibtmedia-dfp-test-ad-position').val();var ibtdfp=new ibtmediaDfp();var colorbox={};if($('#edit-ibtmedia-dfp-dynamic-tag-test-colorbox').is(':checked')){colorbox={'innerWidth':300,'innerHeight':300}}
ibtdfp.triggerDfpAd(positions,colorbox);return!1});$('#edit-ibtmedia-dfp-dynamic-tag-clear-button').click(function(){var positions=$('#edit-ibtmedia-dfp-test-ad-position').val();$(positions).each(function(){$('.dfp-ad-'+this+'-wrapper').remove()});return!1});if($('.dfp-dynamic-tag').length>0){var positions=[];var tags=[];$('.dfp-dynamic-tag').each(function(){var tag=$(this);var on_page_load=tag.data('on_page_load');var position=tag.data('position');if(on_page_load==1){positions.push(position);tags.push(tag)}});if(tags.length>0){$.event.trigger({type:'dynamicdfp',positions:positions,tags:$(tags)})}}
function sendTrackingCalls(status){adblock_status=status;if(typeof ga!='undefined'){ga('send','event','AdBlock',status,{"nonInteraction":!0,"dimension12":status})}
if(typeof dataLayer!='undefined'){dataLayer.push({'event':'AdBlock','eventCategory':'AdBlock','eventAction':status,'dimension12':status,'nonInteraction':!0})}}
var enable_blockadblock=Drupal.settings.enable_blockadblock;if(enable_blockadblock||typeof enable_blockadblock!='undefined'){if(typeof blockAdBlock==='undefined'){sendTrackingCalls('No')}else{blockAdBlock.onDetected(function(){sendTrackingCalls('Yes')});blockAdBlock.onNotDetected(function(){sendTrackingCalls('No')})}}}}}(jQuery));(function($){Drupal.behaviors.dataLayer={langPrefixes:function langPrefixes(){var languages=Drupal.settings.dataLayer.languages,langList=[];for(var lang in languages){if(languages[lang].prefix!==''){langList.push(languages[lang].prefix)}}
return langList},attach:function(){return}}})(jQuery);/*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
 * https://jqueryvalidation.org/
 * Copyright (c) 2017 Jorn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!c.settings.submitHandler||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&(!j.form&&j.hasAttribute("contenteditable")&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){!this.form&&this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name"));var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0],this.name=d),!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);if("function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f){if(j=f.call(b,j),"string"!=typeof j)throw new TypeError("The normalizer should return a string value.");delete g.normalizer}for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=".  Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a});(function($){$(document).ready(function(){var ccWrapper=$('.correction-box-wrapper');var ccHolder=$('.content-correction-holder');var nodeId=Drupal.settings.contentCorrection.nodeId;var correctionFormNodeId=Drupal.settings.contentCorrection.correctionFormNodeId;var correctionFormNodetitle=Drupal.settings.contentCorrection.correctionFormNodetitle;var correctionFormNodeCategory=Drupal.settings.contentCorrection.correctionFormNodeCategory;var correctionFormNodeURl=Drupal.settings.contentCorrection.correctionFormNodeURl;var correctionFormConfirmationMsg=Drupal.settings.contentCorrection.correctionFormConfirmationMsg;var correctionForm='#webform-client-form-'+correctionFormNodeId;$('.user-btn.btn-correct a').on('click',function(e){var thisLink=$(this);if(thisLink.hasClass('toggling')){return!1}
thisLink.addClass('active toggling');e.preventDefault();if(!$(".btn-correct").hasClass('loaded')){ccHolder.hide();$.ajax({url:"/content-correction",cache:!0,dataType:"html",success:function(data){ccHolder.html(data);$("input[name='submitted[article_id]']").val(nodeId);if($(".correction-box-wrapper  .article-category span.node-category").length!=0){$(".correction-box-wrapper  .article-category span.node-category").html(correctionFormNodeCategory)}
$(".correction-box-wrapper  .article-title span.node-title").html(correctionFormNodetitle);$(".correction-box-wrapper  .article-url span.node-url").html(correctionFormNodeURl);$(".correction-box-wrapper  .btn-correct").addClass('loaded');ccHolder.slideToggle(function(){thisLink.removeClass('toggling')})}})}else{ccHolder.slideToggle(function(){thisLink.removeClass('toggling')})}});$(ccHolder).on('click','.genericon-close-alt',function(e){var thisLink=$(this);thisLink.addClass('toggling');ccHolder.slideToggle(function(){thisLink.removeClass('toggling')});$('.user-btn.btn-correct a').removeClass('active')});$(ccHolder).on('submit',correctionForm,function(e){if(ccHolder.hasClass('submitted')){return!1}
var $form=$(correctionForm);if($form.valid()){ccHolder.addClass('submitted');var $messagebox=$('.message');$('.correction-form').fadeOut(300,function(){$(this).remove()});var message=correctionFormConfirmationMsg;$messagebox.append(message)
$messagebox.fadeIn();$.ajax({type:'POST',url:$(correctionForm).attr('action'),data:$(correctionForm).serialize(),success:function(msg){ccHolder.removeClass('submitted')}})}
e.preventDefault()});var $form=$(correctionForm);if(typeof $form.validate()!=='undefined'){$form.validate({submitHandler:function($form){$form.submit()}}).form()}})})(jQuery);(function($){$.fn.shuffle=function(){return this.each(function(){var items=$(this).children().clone(!0);return(items.length)?$(this).html($.shuffle(items)):this})}
$.shuffle=function(arr){for(var j,x,i=arr.length;i;j=parseInt(Math.random()*i),x=arr[--i],arr[i]=arr[j],arr[j]=x);return arr}
Drupal.behaviors.newsweek={attach:function(context,settings){this.toggleExpandableHeight();if($('.shuffle').length){$('.shuffle').shuffle()}
var interval=setInterval(function(){$('.currency').shuffle()},1000);this.menuButtons();var is_ibtailored=0;if($('body').hasClass('page-ibtailored')||$('body').hasClass('node-type-nw-ibtailored')){is_ibtailored=1}
$('.social-share .genericon-facebook-alt').click(function(e){e.preventDefault();window.open($(this).attr('href'),'fbShareWindow','height=520, width=550, top='+($(window).height()/2-275)+', left='+($(window).width()/2-225)+', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');return!1});if($('.debate-slider').length>0){$('.debate-slider .slider').slick({slidesToShow:3,slidesToScroll:3,appendArrows:$('.debate-slider-arrows'),responsive:[{breakpoint:768,settings:{slidesToShow:1,slidesToScroll:1}},]})}},detectIE:function(){var ua=window.navigator.userAgent;var msie=ua.indexOf('MSIE ');if(msie>0){return parseInt(ua.substring(msie+5,ua.indexOf('.',msie)),10)}
var trident=ua.indexOf('Trident/');if(trident>0){var rv=ua.indexOf('rv:');return parseInt(ua.substring(rv+3,ua.indexOf('.',rv)),10)}
var edge=ua.indexOf('Edge/');if(edge>0){return parseInt(ua.substring(edge+5,ua.indexOf('.',edge)),10)}
return!1},detectFFX:function(){if(navigator.userAgent.toLowerCase().indexOf('firefox')>-1){$('body').addClass('ffx')}},menuButtons:function(){var body=$('body');var btn1=$('.lk-1');var btn2=$('.page-header .genericon-menu');var btn3=$('.btn-share');btn1.on('click',function(){if(btn1.parent().hasClass('expand')){btn1.parent().removeClass('expand')}else{body.removeClass('expand-menu');btn2.removeClass('genericon-close-alt');btn1.parent().addClass('expand')}});btn2.on('click',function(){if(body.hasClass('expand-menu')){}else{btn1.parent().removeClass('expand')}});btn3.on('click',function(){if(body.hasClass('expand-share')){body.removeClass('expand-share')}else{body.addClass('expand-share')}})},menuExpand:function(){var pageHeader=$('.page-header');var btnGlobal=$('.m-expand');var btnMenu=$('.m-expand.menu');var targetBody=$('body');if(pageHeader.length>0){pageHeader.on('click','.menu-search .m-expand',function(event){var toggle=$(this);if(toggle.hasClass('active')){toggle.removeClass('active');toggle.parent().removeClass('expand');targetBody.removeClass('menu-expand');if(targetBody.hasClass('social-display')){targetBody.removeClass('social-display')}}else{toggle.addClass('active').parent().addClass('expand');btnGlobal.not(this).removeClass('active').parent().removeClass('expand');targetBody.addClass('menu-expand');if(!targetBody.hasClass('social-display')){targetBody.addClass('social-display')}
var windowWidth=$(window).width();if(windowWidth>767){$('.menu-search #search-block-form .form-text').focus()}}});pageHeader.on('click','.header-meta.desktop .header-editions .m-expand',function(event){var toggle=$(this);if(toggle.hasClass('active')){toggle.removeClass('active').parent().removeClass('expand');targetBody.removeClass('menu-expand')}else{toggle.addClass('active').parent().addClass('expand');btnGlobal.not(this).removeClass('active').parent().removeClass('expand');targetBody.addClass('menu-expand')}});pageHeader.on('click','.header-meta.mobile .m-expand',function(event){var toggle=$(this);if(toggle.hasClass('subscribe')){return}
targetBody.addClass('menu-expand');btnMenu.addClass('active');if(toggle.hasClass('edition')){$('.header-meta.desktop .header-editions').addClass('expand')}});pageHeader.on('click','.m-expand.back',function(event){var toggle=$(this);toggle.closest('.expand').removeClass('expand');btnMenu.addClass('active').parent().addClass('expand')})}
$(document).click(function(event){if(!$(event.target).closest('.dropdown').length&&!$(event.target).closest('.expand').length){Drupal.behaviors.newsweek.menuCollapse()}})},menuCollapse:function(){$('.m-expand').removeClass('active').parent().removeClass('expand')},closeAll:function(){this.menuCollapse()},carousel:function(){},setCarouselItems:function(e){var count=e.item.count;var width=$('body').width();var limit=4;if(width>=768)limit=8;if(width>=992)limit=16;while(count>0){count--;$(e.target).trigger('remove.owl.carousel',1)}
items=Drupal.behaviors.carousel_bk;while(count<limit){var html=items.eq(count).html();count++;if(html)$(e.target).trigger('add.owl.carousel','<li>'+html+'</li>')}},resizeCarouselNav:function(){var owlNav=$('.feature.magazine .owl-nav');var owlItemImage=$('.feature.magazine article:first-of-type .image').height();if(owlNav.length){var topPosition=owlItemImage/2-29;owlNav.css('top',topPosition)}},setSponsorHeight:function(){var sponsor=$('#block-nw-home-featured-story li.sponsor .info');if(!sponsor.length){return}
Drupal.behaviors.newsweek.calculateHeight(sponsor);$(window).on('resize',function(){Drupal.behaviors.newsweek.calculateHeight(sponsor)})},calculateHeight:function(sponsor){var windowWidth=$(window).width();if(windowWidth<768){sponsor.css('min-height','');return}
var sibling=$('#block-nw-home-featured-story li.first .info');var height=sibling.outerHeight();sponsor.css('min-height',height)},toggleExpandableHeight:function(){if($('.article-body .expandable').length>0){var windowWidth=$(window).width();if(windowWidth>991){var toggleHeight=445}else{var toggleHeight=290}
$('.expandable-toggle').removeClass('active');$('.expandable').css('height',toggleHeight);$('body').on('click','.expandable-toggle .toggle',function(event){var toggle=$('.expandable-toggle');if(toggle.hasClass('active')){toggle.removeClass('active');$('.expandable').addClass('collapsed').css('height',toggleHeight)}else{toggle.addClass('active');$('.expandable').removeClass('collapsed').css('height','auto')}})}else{$('body').on('click','.expandable-toggle .toggle',function(event){var toggle=$(this).parent('.expandable-toggle');if(toggle.hasClass('active')){toggle.removeClass('active');$('.expandable').css('height','115px')}else{toggle.addClass('active');$('.expandable').css('height','auto')}})}},toggleLiveStream:function(){$('.livestream-article .image').on('click',function(){$(this).parent().find('.livestream-embed').html(Drupal.settings.livestreamEmbed.code);$(this).remove();$('.feature li.large .info-wrapper').css('margin-top',0);return!1})},webfontLoader:function(){WebFont.load({custom:{families:['Roboto Condensed:300,400,700'],urls:['https://g.newsweek.com/themes/newsweek/css/fonts_inline.css']}})}}})(jQuery);(function($){Drupal.behaviors.lemon={elements:{},attach:function(context,settings){if(is_slideshow==1){}else{this.stickyAds()}
if($('#dfp-ad-player_topright-wrapper').length>0){this.changeSidebarWidth()}},init:function(){if(!this.elements.length){var thisObj=this;this.elements.window={el:$(window)};this.elements.body={el:$('body')}
this.elements.header={el:$('#page-header')}
this.elements.social={el:$('.social-share')}
this.elements.pagebottom={el:$('.page-bottom')}
this.elements.right1={el:$('#dfp-ad-right1')}
this.elements.right2={el:$('#dfp-ad-right2')}
this.elements.right3={el:$('#dfp-ad-right3')}
this.elements.right4={el:$('#dfp-ad-right4')}
this.elements.content={el:$('.page-content')}
this.elements.sidebar={el:$('.page-sidebar')}
this.elements.artbody={el:$('.article-content')}
this.elements.artnav={el:$('.article-navigation')}
this.elements.pagetop={el:$('.page-top')}
this.elements.player={el:$('.videocontent-wrapper')}
$(document).on('recalculate',function(){thisObj.recalculateElements()});if(typeof googletag!='undefined'){googletag.cmd.push(function(){var repos=0,delay=100;googletag.pubads().addEventListener('slotRenderEnded',function(event){nw_log('slotRenderEnded',event.slot.getSlotElementId(),event.sourceAgnosticLineItemId,event.sourceAgnosticCreativeId,Date.now()-timerStart);if(repos){clearTimeout(repos);delay+=500}
repos=setTimeout(function(){$.event.trigger({type:'recalculate'});$.event.trigger({type:'reposition'});repos=0;delay=100},delay)})})}
$(window).on('scroll',function(){$.event.trigger({type:'reposition'})});$(window).on('resize',function(){$.event.trigger({type:'recalculate'});$.event.trigger({type:'reposition'})});$(window).on('load',function(){$.event.trigger({type:'recalculate'})});$(document).on('breaking_news_open breaking_news_close',function(){$.event.trigger({type:'recalculate'});$.event.trigger({type:'reposition'})});$.event.trigger({type:'recalculate'});$.event.trigger({type:'reposition'})}
if(site_name=='Medical Daily'){this.parallaxCalc()}
if(site_name=='Newsweek'){this.stickySocial()}
this.scrollTop();if($('.scroll-top').length>0){this.showScrollTop()}
if(this.elements.body.el.hasClass('logged-in')&&!this.elements.body.el.hasClass('pelcro-special')){return}
if(is_slideshow!=1){if(location.href.indexOf("isFollow=")==-1){this.stickyHeader()}
if((site_name=='Newsweek'&&getCookie('nwsubl')!=1)||site_name!='Newsweek'){if(location.href.indexOf("isFollow=")==-1){if(window.dfpSlots&&dfpSlots.onvideoplay){var this_=this;dfpSlots.onvideoplay.push(function(){this_.stickyPlayer()})}else{this.stickyPlayer()}}}}},recalculateElements:function(){var el;var fixed=!1;this.elements.window.height=this.elements.window.el.height();this.elements.window.width=this.elements.window.el.width();this.elements.header=this.setItemAttributes(this.elements.header);this.elements.social=this.setItemAttributes(this.elements.social);this.elements.pagebottom=this.setItemAttributes(this.elements.pagebottom);this.elements.right1=this.setItemAttributes(this.elements.right1);this.elements.right2=this.setItemAttributes(this.elements.right2);this.elements.right3=this.setItemAttributes(this.elements.right3);this.elements.right4=this.setItemAttributes(this.elements.right4);this.elements.content=this.setItemAttributes(this.elements.content);this.elements.sidebar=this.setItemAttributes(this.elements.sidebar);this.elements.artbody=this.setItemAttributes(this.elements.artbody);this.elements.artnav=this.setItemAttributes(this.elements.artnav);this.elements.pagetop=this.setItemAttributes(this.elements.pagetop);this.elements.player=this.setItemAttributes(this.elements.player)},setItemAttributes:function(item){var el;var fixed=!1;var absolute=!1;var l=t='';el=item.el;if(!el.length){return item}
if(el.hasClass('fixed')){fixed=!0;el.removeClass('fixed')}
if(el.hasClass('absolute')){absolute=!0;el.removeClass('absolute')}
item.height=el.length?el.outerHeight(!0):0;item.width=el.length?el.width():0;item.outerwidth=el.length?el.outerWidth():0;l=el.css('left');t=el.css('top');el.css('left','').css('top','');item.left=el.length?el.offset().left:0;item.top=el.length?el.offset().top:0;el.css('left',l).css('top',t);if(fixed){el.addClass('fixed')}
if(absolute){el.addClass('absolute')}
return item},isMobile:function(){return(/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent.toLowerCase()))},parallaxCalc:function(){var thisObj=this;var body=thisObj.elements.body.el;if(body.hasClass('featured-article')){$(document).on('reposition',function(){var parafig=$('figure.feature');var image_h=parafig.find('img').outerHeight();var arthead=$('.full-article header');var arthead_h=arthead.outerHeight();var arthead_t=image_h-arthead_h;var toc=$('.toc');var toc_t=image_h-44;if(thisObj.elements.window.width>767){parafig.css('height',image_h);if(thisObj.elements.window.width>991){toc.css('top',toc_t);arthead.css('top',arthead_t)}else{toc.css('top','');arthead.css('top','')}}else{parafig.css('height','');toc.css('top','');arthead.css('top','')}})}
if(body.hasClass('collection-article')){$(document).on('reposition',function(){var parafig=$('figure.feature');var image_h=parafig.find('img').outerHeight();if(thisObj.elements.window.width>767){parafig.css('height',image_h).find('.image').css('height',image_h);$('.article-body aside').each(function(){var marginTop=$(this).prev('p').find('.figcaption').outerHeight()+50;$(this).css('margin-top',marginTop)})}else{parafig.css('height','').find('.image').css('height','');$('.article-body aside').css('margin-top','')}})}},scrollTop:function(){var thisObj=this;var body=thisObj.elements.body.el;var hashTagActive='';var scrollElement=$('.scroll');if(scrollElement.length>0){var sticky_h=50;if(site_name=='International Business Times'){var sticky_h=36}
if(site_name=='Latin Times'){}
if(site_name=='Medical Daily'){var sticky_h=60}
if(!body.hasClass('ds0')&&!$('#dfp-ad-top').hasClass('unstick')){var offset=thisObj.elements.pagetop.height+sticky_h}else{var offset=sticky_h}
scrollElement.on('click',function(event){if(hashTagActive!=this.hash){event.preventDefault();var dest=0;if($(this.hash).offset().top>$(document).height()-$(window).height()){dest=$(document).height()-$(window).height()}else{dest=$(this.hash).offset().top}
$('html, body').animate({scrollTop:dest-offset},1000,'swing');hashTagActive=this.hash}})}},stickyHeader:function(){var thisObj=this;var body=thisObj.elements.body.el;if(!$('#dfp-ad-top').hasClass('unstick')&&ibtmedia_device=='desktop'&&(body.hasClass('standard-article')||body.hasClass('featured-article')||body.hasClass('collection-article'))){thisObj.triggerStickTopAd()}else{thisObj.fixedHeader()}
if(jQuery('#stickyHeaderBar').length==0){jQuery(".page-header").clone(!0).attr("id","stickyHeaderBar").addClass("fixed").appendTo("#block-nw-nw-header .content").find("#amp_suggestions_container1").remove()}
var s=0;jQuery(window).on('scroll',function(){if(jQuery(document).scrollTop()>180){if(!s){s=1;jQuery('#stickyHeaderBar').addClass('show')}}else if(s){s=0;jQuery('#stickyHeaderBar').removeClass('show');jQuery("body").removeClass('expand-menu')}});jQuery(window).trigger('scroll')},triggerStickTopAd:function(){var thisObj=this;var body=thisObj.elements.body.el;var obj=thisObj.elements.pagetop.el;var header=thisObj.elements.header.el;var offset=50;var typeB=!0;if(site_name=='Latin Times'){var typeB=!1}
if(site_name=='Medical Daily'){var offset=60;var typeB=!1}
if(site_name=='International Business Times'){var offset=36}
if(typeB){var main=$('html');$(document).on('reposition',function(e){var st=thisObj.elements.window.el.scrollTop();var obj_h=thisObj.elements.pagetop.height;var header_t=thisObj.elements.header.top;var header_h=thisObj.elements.header.height;if(!body.hasClass('ds0')){var start=header_h-offset;obj.addClass('fixed').css('top',0).find('#dfp-ad-top').css('min-height',obj_h);main.css('padding-top',obj_h);if(st>start){header.addClass('fixed').css({'top':obj_h,'transition':'',});body.css('padding-top',header_h)}else{header.removeClass('fixed').css({'top':'','transition':'0.3s',});body.css('padding-top','')}
if(!$('#dfp-ad-top').hasClass('sticky')){setTimeout(function(){body.addClass('ds0');obj.removeClass('fixed').css('top','').find('#dfp-ad-top').css('min-height','');main.css('padding-top','');header.css({'top':'','transition':'0.3s',})},30000)}}else{thisObj.fixedHeader()}})}else{var main=$('div.main');$(document).on('reposition',function(e){var st=thisObj.elements.window.el.scrollTop();var start=header_h-offset;var obj_h=thisObj.elements.pagetop.height;var obj_t=thisObj.elements.pagetop.top;if(!body.hasClass('ds0')){if(st>start){header.addClass('fixed');body.css('padding-top',header_h);obj.addClass('fixed').css('top',offset);main.css('padding-top',obj_h)}else{header.removeClass('fixed');body.css('padding-top','');obj.removeClass('fixed').css('top','');main.css('padding-top','')}
if(!$('#dfp-ad-top').hasClass('sticky')){setTimeout(function(){body.addClass('ds0');obj.removeClass('fixed').css('top','');main.css('padding-top','')},15000)}}else{thisObj.fixedHeader()}})}},fixedHeader:function(){var thisObj=this;var body=thisObj.elements.body.el;var header=thisObj.elements.header.el;var playerContainer=thisObj.elements.player.el
var offset=50;if(site_name=='Latin Times'){}
if(site_name=='Medical Daily'){var offset=60}
if(site_name=='International Business Times'){var offset=36}
var lastScrollTop=0;$(document).on('reposition',function(e){var st=thisObj.elements.window.el.scrollTop();var header_t=thisObj.elements.header.top;var header_h=thisObj.elements.header.height;var start=header_t+header_h-offset;if(st>start){if(!header.hasClass('unstick')){header.addClass('fixed').css({'transition':'0.3s'});body.addClass('scrollHeader').css('padding-top',header_h)}
if(ibtmedia_device!='desktop'){if(st>=lastScrollTop&&st>=offset){header.css({'top':-offset});body.removeClass('upScroll');if(playerContainer.hasClass('mStickyPlayer')){playerContainer.find('.videocontent').css({'top':14,'transition':''})}}else{header.css({'top':''});body.addClass('upScroll');playerContainer.find('.videocontent').css({'top':'','transition':'0.3s'})}
lastScrollTop=st}else{if(st>lastScrollTop&&st>offset){body.addClass('downScroll').removeClass('upScroll')}else{body.removeClass('downScroll').addClass('upScroll')}
lastScrollTop=st}}else{header.removeClass('fixed').css({'transition':''});body.removeClass('scrollHeader downScroll upScroll').css('padding-top','')}})},stickyAds:function(){var thisObj=this;var body=thisObj.elements.body.el;if(body.hasClass('locked-content')||ibtmedia_device!='desktop'){return}
if(site_name=='Newsweek'){if(body.hasClass('featured-article')){$(document).on('reposition',function(){})}}else{if(body.hasClass('standard-article')){$(document).on('reposition',function(){thisObj.standardStickyAds()})}
if(body.hasClass('featured-article')||body.hasClass('collection-article')){$(document).on('reposition',function(){thisObj.featuredStickyAds()})}}},unstickObj:function(obj){obj.parent().css('min-height','');obj.removeClass('fixed absolute').css({'top':'','left':'','width':''})},standardStickyAds:function(){var thisObj=this;var right1=thisObj.elements.right1.el;var right2=thisObj.elements.right2.el;var right3=thisObj.elements.right3.el;var right4=thisObj.elements.right4.el;if(thisObj.elements.window.width<992){thisObj.unstickObj(right1);thisObj.unstickObj(right2);thisObj.unstickObj(right3);thisObj.unstickObj(right4);return}
var body=thisObj.elements.body.el;if(!body.hasClass('ds1')&&right1.hasClass('unstick')){nw_log('unstick r1');body.addClass('ds1')}
if(!body.hasClass('ds2')&&right2.hasClass('unstick')){nw_log('unstick r2');body.addClass('ds2')}
if(!body.hasClass('ds3')&&right3.hasClass('unstick')){nw_log('unstick r3');body.addClass('ds3')}
if(!body.hasClass('ds4')&&right4.hasClass('unstick')){nw_log('unstick r4');body.addClass('ds4')}
var right1_t=thisObj.elements.right1.top;var right1_l=thisObj.elements.right1.left;var right1_w=thisObj.elements.right1.width;var right1_h=thisObj.elements.right1.height;var right2_t=thisObj.elements.right2.top;var right2_l=thisObj.elements.right2.left;var right2_w=thisObj.elements.right2.width;var right2_h=thisObj.elements.right2.height;var right3_t=thisObj.elements.right3.top;var right3_l=thisObj.elements.right3.left;var right3_w=thisObj.elements.right3.width;var right3_h=thisObj.elements.right3.height;var right4_t=thisObj.elements.right4.top;var right4_l=thisObj.elements.right4.left;var right4_w=thisObj.elements.right4.width;var right4_h=thisObj.elements.right4.height;var sticky_h=50;if(site_name=='International Business Times'){var sticky_h=36}
if(site_name=='Latin Times'){}
if(site_name=='Medical Daily'){var sticky_h=60}
if(!body.hasClass('ds0')&&!$('#dfp-ad-top').hasClass('unstick')){var offset=thisObj.elements.pagetop.height+sticky_h}else{var offset=sticky_h}
var st=thisObj.elements.window.el.scrollTop()+offset;var start1=right1_t;var start2=right2_t;var start3=right3_t;var start4=right4_t;if(body.hasClass('node-type-picture-this')){var stop1=thisObj.elements.pagebottom.top-right1_h-50}
var stop1=right2_t-right1_h;var stop2=(right2.hasClass('sticky'))?thisObj.elements.pagebottom.top-right2_h:right3_t-right2_h;var stop3=(right3.hasClass('sticky'))?thisObj.elements.pagebottom.top-right3_h:right4_t-right3_h;var stop4=thisObj.elements.pagebottom.top-right4_h;if(st>start1){if(!body.hasClass('ds1')){right1.parent().css('min-height',right1_h);right1.addClass('fixed').css({'top':offset,'left':right1_l,'width':right1_w})}else{thisObj.unstickObj(right1)}
if(st>stop1){thisObj.unstickObj(right1);if(!right1.hasClass('sticky')){body.addClass('ds1')}}}else{thisObj.unstickObj(right1)}
if(st>start2){if(!body.hasClass('ds2')){right2.parent().css('min-height',right2_h);right2.addClass('fixed').css({'top':offset,'left':right2_l,'width':right2_w})}else{thisObj.unstickObj(right2)}
if(st>stop2){if(right2.hasClass('sticky')){$.event.trigger({type:'recalculate'});right2.removeClass('fixed').addClass('absolute').css({'top':stop2-right2_t,'left':'',})}else{thisObj.unstickObj(right2);body.addClass('ds2')}}}else{thisObj.unstickObj(right2)}
if(st>start3){if(!body.hasClass('ds3')){right3.parent().css('min-height',right3_h);right3.addClass('fixed').css({'top':offset,'left':right3_l,'width':right3_w})}else{thisObj.unstickObj(right3)}
if(st>stop3){if(right3.hasClass('sticky')){$.event.trigger({type:'recalculate'});right3.removeClass('fixed').addClass('absolute').css({'top':stop3-right3_t,'left':'',})}else{thisObj.unstickObj(right3);body.addClass('ds3')}}}else{thisObj.unstickObj(right3)}
if(st>start4){if(!body.hasClass('ds4')){right4.parent().css('min-height',right4_h);right4.addClass('fixed').css({'top':offset,'left':right4_l,'width':right4_w})}else{thisObj.unstickObj(right4)}
if(st>stop4){if(right4.hasClass('sticky')){$.event.trigger({type:'recalculate'});right4.removeClass('fixed').addClass('absolute').css({'top':stop4-right4_t,'left':'',})}else{thisObj.unstickObj(right4);body.addClass('ds4')}}}else{thisObj.unstickObj(right4)}},featuredStickyAds:function(){var thisObj=this;var right1=thisObj.elements.right1.el;var right2=thisObj.elements.right2.el;var right3=thisObj.elements.right3.el;var right4=thisObj.elements.right4.el;if(thisObj.elements.window.width<992){thisObj.unstickObj(right1);thisObj.unstickObj(right2);thisObj.unstickObj(right3);thisObj.unstickObj(right4);return}
var body=thisObj.elements.body.el;var right1_t=thisObj.elements.right1.top;var right1_l=thisObj.elements.right1.left;var right1_w=thisObj.elements.right1.width;var right1_h=thisObj.elements.right1.height;var right2_t=thisObj.elements.right2.top;var right2_l=thisObj.elements.right2.left;var right2_w=thisObj.elements.right2.width;var right2_h=thisObj.elements.right2.height;var right3_t=thisObj.elements.right3.top;var right3_l=thisObj.elements.right3.left;var right3_w=thisObj.elements.right3.width;var right3_h=thisObj.elements.right3.height;var right4_t=thisObj.elements.right4.top;var right4_l=thisObj.elements.right4.left;var right4_w=thisObj.elements.right4.width;var right4_h=thisObj.elements.right4.height;var sticky_h=50;if(site_name=='International Business Times'){var sticky_h=36}
if(site_name=='Latin Times'){}
if(site_name=='Medical Daily'){var sticky_h=60}
if(!body.hasClass('ds0')&&!$('#dfp-ad-top').hasClass('unstick')){var offset=thisObj.elements.pagetop.height+sticky_h}else{var offset=sticky_h}
var st=thisObj.elements.window.el.scrollTop()+offset;var start1=right1_t;var start2=right2_t;var start3=right3_t;var start4=right4_t;var stop1=right2_t-right1_h;var stop2=right3_t-right2_h;var stop3=right4_t-right3_h;var stop4=thisObj.elements.pagebottom.top-right4_h;var parallax2=right2.closest('aside').nextAll('p.parallax:first');var parallax3=right3.closest('aside').nextAll('p.parallax:first');var parallax4=right4.closest('aside').nextAll('p.parallax:first');var parallax2_t=0;var parallax3_t=0;var parallax4_t=0;if(parallax2.length>0){parallax2_t=parallax2.offset().top}
if(parallax3.length>0){parallax3_t=parallax3.offset().top}
if(parallax4.length>0){parallax4_t=parallax4.offset().top}
if(parallax2_t>0&&parallax2_t<stop2){stop2=parallax2_t-right2_h}
if(parallax3_t>0&&parallax3_t<stop3){stop3=parallax3_t-right3_h}
if(parallax4_t>0&&parallax4_t<stop4){stop4=parallax4_t-right4_h}
if(st>start1){right1.parent().css('min-height',right1_h);if(st<stop1){right1.removeClass('absolute').addClass('fixed').css({'top':position,'left':right1_l,'width':right1_w})}else{right1.addClass('absolute').css({'top':stop1,'left':right1_l,'width':right1_w})}}else{thisObj.unstickObj(right1)}
if(st>start2){right2.parent().css('min-height',right2_h);if(st<stop2){right2.removeClass('absolute').addClass('fixed').css({'top':position,'left':right2_l,'width':right2_w})}else{right2.addClass('absolute').css({'top':stop2,'left':right2_l,'width':right2_w})}}else{thisObj.unstickObj(right2)}
if(st>start3){right3.parent().css('min-height',right3_h);if(st<stop3){right3.removeClass('absolute').addClass('fixed').css({'top':position,'left':right3_l,'width':right3_w})}else{right3.addClass('absolute').css({'top':stop3,'left':right3_l,'width':right3_w})}}else{thisObj.unstickObj(right3)}
if(st>start4){right4.parent().css('min-height',right4_h);if(st<stop4){right4.removeClass('absolute').addClass('fixed').css({'top':position,'left':right4_l,'width':right4_w})}else{right4.addClass('absolute').css({'top':stop4,'left':right4_l,'width':right4_w})}}else{thisObj.unstickObj(right4)}},stickyPlayer:function(){var thisObj=this;var body=thisObj.elements.body.el;var playerContainer=thisObj.elements.player.el;var closePlayer=$('#close_fusion_jwplayer');var classname='stickyPlayer',bclassname='sticky_player';var sticky_h=50;if(playerContainer.length>0){if(ibtmedia_device!='desktop'){if(!body.hasClass('msp')){return}else{classname='mStickyPlayer';bclassname='msitcky_player';nw_log('mStickyPlayer enabled')}}
if($('.videocontent .tvplayer').length>0){var atom=0;var start;var disableMiniPlayer;var obj_h;$(document).on('recalculate',function(){disableMiniPlayer=body.hasClass('disableMiniPlayer');var obj_t=thisObj.elements.player.top;obj_h=thisObj.elements.player.height;start=obj_t+obj_h/2;if(is_slideshow==1&&ibtmedia_device!='desktop'&&$('.article-body').length>0){var art=$('.article-body');start=art.offset().top+art.outerHeight()/3}
if(!body.hasClass('ds0')&&!$('#dfp-ad-top').hasClass('unstick')){sticky_h+=thisObj.elements.pagetop.height}});$(document).on('reposition',function(){if(typeof start==='undefined'){$(document).trigger("recalculate")}
var st=thisObj.elements.window.el.scrollTop()+sticky_h;if(st>start){if(!disableMiniPlayer&&window.dfpSlots&&dfpSlots.onvideoplay&&!atom){body.addClass(bclassname);jQuery(".videocontent",playerContainer).hide();playerContainer.addClass(classname).css('min-height',obj_h);atom=1;setTimeout(function(){jQuery(".videocontent",playerContainer).show()},1);setTimeout(function(){closePlayer.show()},1000)}}else if(atom){body.removeClass(bclassname);jQuery(".videocontent",playerContainer).hide();playerContainer.removeClass(classname).css('min-height',obj_h);atom=0;setTimeout(function(){jQuery(".videocontent",playerContainer).show()},1)}});closePlayer.click(function(){body.addClass('disableMiniPlayer');body.removeClass(bclassname);playerContainer.removeClass(classname).css('min-height','');closePlayer.hide();videojs.getAllPlayers()[0].pause();if(typeof ga!='undefined'){ga('gtm1.send','event','VideoPlayer','close button',ibtmedia_device,{nonInteraction:!0})}})}else if(playerContainer.hasClass('embed-responsive')){$(document).on('reposition',function(){var obj_t=playerContainer.offset().top;var obj_h=playerContainer.outerHeight();var start=obj_t+obj_h/2;var st=thisObj.elements.window.el.scrollTop()+offset;if(st>start){if(!body.hasClass('disableMiniPlayer')){body.addClass(bclassname);playerContainer.addClass(classname).css('min-height',obj_h);setTimeout(function(){closePlayer.show()},30000)}}else{body.removeClass(bclassname);playerContainer.removeClass(classname).css('min-height','')}});closePlayer.click(function(){body.addClass('disableMiniPlayer');body.removeClass(bclassname);playerContainer.removeClass(classname).css('min-height','');closePlayer.hide();videojs.getAllPlayers()[0].pause();if(typeof ga!='undefined'){ga('gtm1.send','event','VideoPlayer','close button',ibtmedia_device,{nonInteraction:!0})}})}else if(typeof jwplayer=='function'&&typeof(jwplayer("fusion_jwplayer"))!='undefined'){$(document).on('reposition',function(){var obj_t=playerContainer.offset().top;var obj_h=playerContainer.outerHeight();var start=obj_t+obj_h/2;var st=thisObj.elements.window.el.scrollTop()+offset;if(st>start){if(!body.hasClass('disableMiniPlayer')){body.addClass(bclassname);playerContainer.addClass(classname).css('min-height',obj_h);jwplayer("fusion_jwplayer").resize();if(jwplayer("fusion_jwplayer").getPosition()>=1&&!body.hasClass('mobile-arb')){closePlayer.show()}}}else{body.removeClass(bclassname);playerContainer.removeClass(classname).css('min-height','');jwplayer("fusion_jwplayer").resize()}});closePlayer.click(function(){jwplayer("fusion_jwplayer").pause(!0);body.addClass('disableMiniPlayer').removeClass(bclassname);playerContainer.removeClass(classname).css('min-height','');jwplayer("fusion_jwplayer").resize();closePlayer.hide();if(typeof ga!='undefined'){ga('gtm1.send','event','VideoPlayer','close button',ibtmedia_device,{nonInteraction:!0})}})}}
$.event.trigger({type:'recalculate'});$.event.trigger({type:'reposition'})},changeSidebarWidth:function(){var thisObj=this;var obj=thisObj.elements.sidebar.el;$(document).on('reposition',function(e){var win_w=thisObj.elements.window.width;if(win_w>991){obj.css({'flex':'none','width':400,}).parent().css({'display':'flex',})}else{obj.css({'flex':'','width':'',}).parent().css({'display':'',})}})},stickySocial:function(){var thisObj=this;var obj=thisObj.elements.artnav.el;if($('#block-nw-magazine-article-header').length>0){$(document).on('reposition',function(){var win_h2=thisObj.elements.window.height/2;var st=thisObj.elements.window.el.scrollTop()+win_h2;var obj_t=$('#block-nw-magazine-article-header').offset().top;var obj_h=$('#block-nw-magazine-article-header').outerHeight();var start=obj_t+obj_h/2;if(st>start){obj.css({'opacity':1,'visibility':'visible'})}else{obj.css({'opacity':0,'visibility':'hidden'})}})}},showScrollTop:function(){var thisObj=this;var body=this.elements.body.el;var obj=$('.scroll-top');var start=body.height()/3;if(obj.length>0){$(document).on('reposition',function(e){var st=thisObj.elements.window.el.scrollTop();if(st>start){obj.addClass('show')}else{obj.removeClass('show')}})}},getParam:function(param){var vars={};window.location.href.replace(location.hash,'').replace(/[?&]+([^=&]+)=?([^&]*)?/gi,function(m,key,value){vars[key]=value!==undefined?value:''});if(param){return vars[param]?vars[param]:null}
return vars}};Drupal.behaviors.lemon.init()})(jQuery)})