(function(){TWP.Util=TWP.Util||{};TWP.Util.User=function(){var C=false;var N=false;var I=null;var G="";var D="";var J=null;var H=false;var E="washington-post";var F=["wapo_display"];var K=["wapo_login_id"];var B=["at"];function O(R,Q){var S=-1,P=-1;S=(R.indexOf(Q)+Q.length+1);P=(J.indexOf(";",S))==-1?J.length:J.indexOf(";",S);return R.substring(S,P).split("|")[0];}function M(){var S,P,V,U=document.cookie.split(";");for(S=0;S0&&typeof Q=="string"&&T)?Q:false;}}}function A(Q){var P=Q.indexOf("@");var R=Q.lastIndexOf(".");if(P<1||R=Q.length){return false;}else{return true;}}function L(){var Q=document.location.href;if(Q.indexOf("localhost")>-1){var S=$.cookie("TWPNIUCID");if(typeof S=="undefined"||S==null){var R=new Date();var P="TWPNI"+R.getTime()+"."+Math.round(Math.random()*10000);R.setTime(R.getTime()+31104000000);$.cookie("TWPNIUCID",P,{domain:TWP.Data.cookie_domain,expires:R,path:"/"});}}if(Q.indexOf("beta")>-1){var S=$.cookie("x-split-override");if(S==null||typeof S=="undefined"){var R=new Date();R.setTime(R.getTime()+(1000*60*15));$.cookie("x-split-override","B",{domain:TWP.Data.cookie_domain,expires:R,path:"/"});$.cookie("X-WP-Split","B",{domain:TWP.Data.cookie_domain,expires:R,path:"/"});}}}return{init:function(){var Q="";for(var P=0;P0&&typeof J=="string")?J:null;},getUserType:function(){return(E.length>0&&typeof E=="string")?E:null;},getUserId:function(){return G;},getUserName:function(){return(typeof I=="string")?I:"";},getUserEmail:function(){return(D.length<0||D==false)?null:D;},getAuthentication:function(){return N;}};}();TWP.Util.User.init();})();(function(){window.TWP=window.TWP||{};TWP.Identity=TWP.Identity||{};TWP.server=TWP.server||window.location.href.match(/^.*?:\/\/.*?\//)[0];var A=(window.location.protocol.indexOf("https"))<0?false:true;TWP.Identity.omniture={sub:{"-1":"N/A","0":"Unsubscribed","1":"Subscribed"},mtr:{"-1":"Unmetered","1":"Metered","20":"Unmetered: content_type","21":"Unmetered: referer","22":"Unmetered: domain"},tracking:{"wp_evar64":"not available","wp_evar65":"not available","wp_evar66":"not available"}};TWP.Identity.setAuthenticationLink=function(){var H=document.getElementById("global-signin");var B=document.getElementById("global-registration");var D=null;var G=null;var F=window.location.href.split("?")[0];var E=this.objs;if(H&&B&&(TWP.server.match(/digitalink\.com|washingtonpost\.com|wpprivate\.com/ig)!=null)){if(TWP.Util.User.getAuthentication()){D=TWP.Util.User.getUserName();G=(typeof TWP.signedInProvider=="function")?TWP.signedInProvider():"Washington Post";G=(typeof G!="undefined")?G.toLowerCase():"";var C=((G.indexOf("facebook")>=0)?''+D+"";H.innerHTML=C;B.innerHTML='Sign Out';}else{H.innerHTML='Sign In';B.innerHTML='Register';}}};TWP.Identity.setHandlers=function(){try{$(window.document).on("onTwpLoginComplete",function(C){(typeof TWP_Debug!="undefined")&&TWP_Debug.pagedebug&&window.console&&console.log&&console.log(C.type+"fired!");C.stopPropagation();TWP.Util.User.init();TWP.Identity.setAuthenticationLink();try{$("body").css("overflow-y","");$(".simple-overlay").overlay().close();}catch(D){}});}catch(B){}};TWP.Identity.auth=function(){var B=new Array();B[0]={};B[1]={overlay:'
',overlayConfig:{top:260,mask:{color:"#000000",loadSpeed:200,opacity:0},bottom:"0px",left:"0px",closeOnClick:true,closeOnEsc:true,load:true},overflowCss:""};B[2]={overlay:'
',overlayConfig:{top:260,mask:{color:"#000000",loadSpeed:200,opacity:0.7},top:"20%",left:"center",closeOnClick:false,closeOnEsc:false,load:true},overflowCss:"hidden"};B[3]={overlay:'
',overlayConfig:{top:260,mask:{color:"#000000",loadSpeed:200,opacity:0.7},top:"20%",left:"center",closeOnClick:false,closeOnEsc:false,load:true},overflowCss:"hidden"};if(!A){$.ajax({type:"GET",url:TWP.signin.auth_api_url+(encodeURI(location.pathname+"?rplapisplit=1&referrer="+document.referrer)),dataType:"jsonp",timeout:2000,cache:"false"}).done(function(F,C){(typeof TWP_Debug!="undefined")&&TWP_Debug.pagedebug&&window.console&&console.log&&console.log("RegWall action: "+F.pwresp.action+"\nRegWall - url: "+F.pwresp.url+"\n");(typeof TWP_Debug!="undefined")&&TWP_Debug.pagedebug&&window.console&&console.log&&console.log(F);window.console&&console.log&&console.log("PAYWALL CHECK STATUS: "+C);window.console&&console.log&&console.log("PAYWALL ACTION: "+F.pwresp.action);window.console&&console.log&&console.log("PAYWALL URL: "+F.pwresp.url);window.console&&console.log&&console.log("PAYWALL SUB: "+TWP.Identity.omniture.sub[F.pwresp.sub]);window.console&&console.log&&console.log("PAYWALL METERED: "+TWP.Identity.omniture.mtr[F.pwresp.mtr]);window.console&&console.log&&console.log("PAYWALL METER COUNT: "+F.pwresp.mtrct);window.console&&console.log&&console.log("PAYWALL MODE: "+F.pwresp.mtfn);if(C=="success"&&F&&F.pwresp&&typeof B[F.pwresp.action].overlay!=="undefined"&&F.pwresp.action>0){var E=$(B[F.pwresp.action].overlay);var D=F.pwresp.url+encodeURI("?page_name="+TWP.Data["Tracking"].props.page_name+"§ion="+TWP.Data["Tracking"].props.section);E.find("iframe").attr("src",D);$("body").css("overflow-y",B[F.pwresp.action].overflowCss);$("body").prepend(E);$(E).overlay(B[F.pwresp.action].overlayConfig);$("#wp_Signin a.close").bind("click",function(){window.location.href="/";});}});}};TWP.Identity.init=function(){TWP.Identity.auth();TWP.Identity.setAuthenticationLink();TWP.Identity.setHandlers();};TWP.Identity.init();})();