var VM=VM||{};VM.Momentum={dataSent:!1,clientId:null,init:function(){var n=this;VM.Track.isTracking()&&VM.Track.withClientId(function(t){n.clientId=t});document.addEventListener("visibilitychange",function(){document.visiblityState==="hidden"&&n.sendData()});window.addEventListener("pagehide",function(){n.sendData()})},sendData:function(){var n,i;if(window.location.pathname.indexOf("/obituaries")!==0&&!this.dataSent){if(this.dataSent=!0,n=VM.$body.find(".details"),n.data("momentum")==="off")return;var r=n.find(".sc-s").last(),t=n.find("#comments-count"),u=performance.now().toFixed(0),f=VM.Scroll.maxHeight===0?0:Math.min(VM.Scroll.maxDepth/VM.Scroll.maxHeight,1);viewport=$(window).width()+"x"+$(window).height();t.length===0&&(t=n.find(".sc-c"));i="/sendmomentum?id="+n.data("id")+"&tag="+n.data("tag")+"&shares="+parseInt(r.text()||0,10)+"&comments="+parseInt(t.text()||0,10)+"&viewport="+viewport+"&clientId="+this.clientId+"&scroll="+f+"&time="+u;navigator.sendBeacon?navigator.sendBeacon(i):$.ajax(i,{method:"POST"})}},onLoaded:function(){var n=$("#site-momentum-items");n.find('[data-ga-value="'+VM.$body.find(".details").data("id")+'"]').remove();n.find(".lazyimg").lazyloader();n.find(".timeago").timeago()}};VM.Embeds={init:function(){var e,o,i,r,n,t,u,f;if(this.tweetEmbeds=[],this.instaEmbeds=[],this.facebookEmbeds=[],this.fbToken=VM.getFacebookApiSettings().access_token,e=$("#details-body").children("p"),e.length>0)for(o=0;o0)for(t=0;t0&&$.when.apply($,this.tweetEmbeds).done(function(){$.getScript("https://platform.twitter.com/widgets.js")});this.instaEmbeds.length>0&&$.when.apply($,this.instaEmbeds).done(function(){$.getScript("https://platform.instagram.com/en_US/embeds.js")});this.facebookEmbeds.length>0&&$.when.apply($,this.facebookEmbeds).done(function(){$.getScript("https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2")})},processEmbed:function(n,t,i){var r="";return i=="twitter"?r="https://publish.twitter.com/oembed?url="+encodeURIComponent(t):i=="instagram"?r="https://graph.facebook.com/instagram_oembed?url="+encodeURIComponent(t)+"&access_token="+this.fbToken:i=="facebook"?r="https://graph.facebook.com/oembed_post?url="+encodeURIComponent(t)+"&access_token="+this.fbToken:i=="facebook-page"&&(r="https://graph.facebook.com/oembed_page?url="+encodeURIComponent(t)+"&access_token="+this.fbToken),$.ajax({cache:!1,url:r,jsonp:"callback",dataType:"jsonp"}).success(function(t){if(t)try{n.innerHTML=t.html}catch(i){}})}};VM.TTS={init:function(){$("#tts").on("click","a",this.onPlayArticle)},onPlayArticle:function(n){n.preventDefault();var t=$(this),i=$("