var wapoSites=new Array();wapoSites[0]={"name":"TheRoot","url":"http://idvisitor.theroot.com/identity/","visId":null};wapoSites[1]={"name":"Slate","url":"http://idvisitor.slate.com/identity/","visId":null};wapoSites[2]={"name":"Washopedia","url":"http://idvisitor.expressnightout.com/identity/","visId":null};wapoSites[3]={"name":"Washington Post","url":"http://idvisitor.washingtonpost.com/identity/","visId":null};wapoSites[4]={"name":"Trove","url":"http://idvisitor.trove.com/identity/","visId":null};var $wpjQ=typeof $wpjQ&&$wpjQ||jQuery;eval($wpjQ('script[src$="wapolabs.nojq.full.js"]').html());var wapoUtilities,WapoUtil=function(){};WapoUtil.prototype.Get_Cookie=function(B){var H,C,F,G,E,D,A;H=document.cookie.split(";");E=false;D=/^(.*?)(=)(.*?)$/;A=H.length;while(A--){C=H[A].match(D);if(typeof (C)!=="undefined"&&C!==null){F=C[1].replace(/^\s+|\s+$/g,"");if(F===B){E=true;if(C[2]==="="){G=unescape(C[3].replace(/^\s+|\s+$/g,""));}return G;}}C=null;F="";}if(!E){return null;}};WapoUtil.prototype.Delete_Cookie=function(A,C,B){if(this.Get_Cookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}};WapoUtil.prototype.Set_Cookie=function(C,E,A,H,D,G){var B,F;B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24;}F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"");};WapoUtil.prototype.Get_Request_Parameter=function(D,B){var C,A;B=B+"=";if(D.length>0){C=D.indexOf(B);if(C!==-1){C+=B.length;A=D.indexOf("&",C);if(A===-1){A=D.length;}return unescape(D.substring(C,A));}return"null";}};WapoUtil.prototype.getParameter=function(B){var D,C,A;D=window.top.location.search.substring(1);B=B+"=";if(D.length>0){C=D.indexOf(B);if(C!==-1){C+=B.length;A=D.indexOf("&",C);if(A===-1){A=D.length;}return unescape(D.substring(C,A));}return"null";}};WapoUtil.prototype.getBaseDomainName=function(D){var C,A,B;C=D;A=D.lastIndexOf(".");if(A>-1){B=D.lastIndexOf(".",A-1);if(B>-1){C=D.substring(B+1);}}return C;};WapoUtil.prototype.checkVisitorId=function(B){var C,A;C=wapoUtilities.Get_Cookie("s_vi");if(C===null){A=document.createElement("iframe");A.height=1;A.width=1;A.style.display="none";A.src="http://www.washingtonpost.com/wp-srv/wapolabs/dw/readomniturecookie.html?"+B;document.getElementById("wapo_338542").appendChild(A);}};wapoUtilities=new WapoUtil();var JSON;if(!JSON){JSON={};}(function(){function f(n){return n<10?"0"+n:n;}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key);}if(typeof rep==="function"){value=rep.call(holder,key,value);}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i=2){this.eventHost="event."+A[A.length-2]+"."+A[A.length-1];}else{this.eventHost="event."+document.domain;}};WapoEvent.prototype.logEvent=function(E,C,A){var D={};D.event=E;D.app=C;D.referer=document.referer;D.url=window.location.href;this.addValue(D,"appdata",A);var B={type:"GET",dataType:"jsonp",url:"http://"+wapoEvent.eventHost+"/log.php",cache:false,data:D};return $wpjQ.ajax(B);};WapoEvent.prototype.addValue=function(C,A,B){if(typeof (B)!=="undefined"&&B!==null){C[A]=B;}};wapoEvent=new WapoEvent();function WapoSite(C,B,A){this.name=C;this.url=B;this.visId=A;}function WapoEnv(){this.wapolabs_js="/rw/sites/twpweb/js/wapo/wapolabs.nojq.full.js";this.waposites_js="/rw/sites/twpweb/js/wapo/wapo_sites.js";this.cdn_identity="//d2pe20ur0h0p8p.cloudfront.net/identity/1.5.2/";this.cdn_images_identity="//d2pe20ur0h0p8p.cloudfront.net/identity/1.5.2/";this.fb_key="41245586762";this.publicationName="Washington Post";this.site_base_domain="washingtonpost.com";this.site_path="/";this.jskit_div="js-kit-comments";this.jskit_class="js-kit-comments";this.jskit_consumer_key="prod.washpost.com";this.wapo_secure_protocol="https:";this.wapo_site_url="//id.washingtonpost.com/identity/";this.site_url="//www.washingtonpost.com/";this.wapo_public_protocol="http:";this.visitor_session_length="30";this.customLoginTrigger=false;this.init_xfbml=false;this.jskit_commenting_group="commenting";this.wapo_reg_url="https://ssl.washingtonpost.com/actmgmt/registration/login/commenting?destination=";this.commenting_edit_profile_url="https://ssl.washingtonpost.com/actmgmt/registration/group/commenting?destination=";this.param_name_jsonp_callback="jsonp_callback";this.param_name_nonce="wp_id_n";this.param_name_email_nonce="wp_em_n";this.meta_tag_groups="wapoGroups";this.meta_tag_optional_groups="wapoOptionalGroups";this.param_name_redirect="next_url";this.param_name_previous_url="previous_url";this.param_name_no_cancel="wp_no_cancel";this.param_name_regis_group_name="reg_group";this.param_name_login_id="loginId";this.param_name_show_registration="show_registration";this.param_name_registration_redirect="wp_regis_redirect"; this.param_name_login_redirect="wp_login_redirect";this.place_holder="ph";this.cookie_display="wapo_display";this.cookie_avatar="washingtonpost_avatar";this.cookie_groups="wapo_groups";this.cookie_vis_id="wapo_vis_id";this.cookie_login_id="wapo_login_id";this.cookie_previous_ip="wapo_saved_ip";this.cookie_last_ip="wapo_last_ip";this.cookie_omniture="s_vi";this.cookie_previous_omniture="wapo_saved_omnitureid";this.cookie_previous_ip="wapo_saved_ip";this.cookie_session_id="wapo_sess_id";this.cookie_wpni_id="wpniuser";this.event_name_login="wapoLogin";this.event_name_new_registration="wapoRegister";this.event_name_logout="wapoLogout";this.event_name_fb_async_init="wapoFbAsyncInit";}WapoEnv.prototype.Set_Unescaped_Cookie=function(C,E,A,H,D,G){var B,F;B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24;}F=new Date(B.getTime()+(A));document.cookie=C+"="+E+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"");};var wapoEnv=new WapoEnv();window.$wpjQ=typeof window.$wpjQ!=="undefined"&&window.$wpjQ||jQuery;$wpjQ(document).trigger("wapo_env_init");if(typeof wapoEvent!=="undefined"&&typeof wapoEvent.eventHost!=="undefined"){wapoEvent.eventHost="event.washingtonpost.com"; /*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ }var wapoVisitor;function WapoVisitor(){this.initProperties();for(var B=0;B1){A=wapoEnv.wapo_secure_protocol+wapoEnv.wapo_site_url+"siteRegistration/resetPassword?"+wapoEnv.param_name_nonce+"="+D[1]+"&"+wapoEnv.param_name_redirect+"="+escape(window.location.href)+"&"+wapoEnv.param_name_previous_url+"="+escape(window.location.href);}}else{if(D[0]==wapoEnv.param_name_email_nonce){if(D.length>1){A=wapoEnv.wapo_secure_protocol+wapoEnv.wapo_site_url+"siteRegistration/confirmEmail?"+wapoEnv.param_name_email_nonce+"="+D[1]+"&"+wapoEnv.param_name_redirect+"="+escape(window.location.href)+"&"+wapoEnv.param_name_previous_url+"="+escape(window.location.href);}}else{if(D[0]==wapoEnv.param_name_login_redirect){this.updateVisitorLogin();}}}}return A;};WapoVisitor.prototype.checkRegistration=function(){var C,A,B,D,E;C="";metaElements=document.getElementsByName(wapoEnv.meta_tag_groups);if(metaElements&&metaElements.length>0){if(this.wapoLoginId===null||this.wapoLoginId===""){C=wapoEnv.wapo_public_protocol+wapoEnv.wapo_site_url+"public/login/options?"+wapoEnv.param_name_redirect+"="+escape(window.location.href)+"&"+wapoEnv.param_name_previous_url+"="+escape(window.location.href)+"&"+wapoEnv.param_name_no_cancel+"=true";}else{B=metaElements[0].content;D=B.split("-");E=true;for(i=0;i'+"").appendTo("#wapolabs_wrapperLoginStatus");wapoVisitor.tbInit=true;}};WapoVisitor.prototype.loginFacebook=function(B){if(wapoVisitor.wapoLoginId===null){var A=wapoEnv.wapo_public_protocol+wapoEnv.wapo_site_url+"public/login/get_for_facebook"+"?format=json&jsonp=&"+wapoEnv.param_name_jsonp_callback+"=?&facebookUid="+B;$wpjQ.getJSON(A,new Function("data","if (data !== null && typeof(data."+wapoEnv.param_name_login_id+") !== 'undefined' && data."+wapoEnv.param_name_login_id+" !== null && typeof(data."+wapoEnv.param_name_show_registration+") !== 'undefined' && data."+wapoEnv.param_name_show_registration+" !== null) {"+"wapoVisitor.wapoLoginId = data."+wapoEnv.param_name_login_id+";"+"wapoVisitor.updateWaPoLogin(data."+wapoEnv.param_name_show_registration+", data."+wapoEnv.param_name_login_id+", 'false', 'false');"+"}"));}};WapoVisitor.prototype.getDependentLoginValues=function(){var D,A,C,B;if(this.wapoLoginId!=null){A=wapoUtilities.Get_Cookie(wapoEnv.cookie_display);if(A&&A!=null){C=A.split("|");if(C.length>0){this.displayName=C[0];if(this.displayName.substr(0,1)==='"'){this.displayName=this.displayName.substring(1);}this.displayName=this.displayName;}if(C.length>1){B=C[1];if(B.substr((B.length-1),1)==='"'){B=B.substring(0,B.length-1);}if(B!=wapoEnv.place_holder){this.picUrl=decodeURIComponent(B);}}if(C.length>2){B=C[2];if(B.substr((B.length-1),1)==='"'){B=B.substring(0,B.length-1);}this.providerUrl=decodeURIComponent(B);}}D=wapoUtilities.Get_Cookie(wapoEnv.cookie_groups);if(D&&D!=null){C=D.split("|");if(C.length>0){this.completedGroups=C[0];}if(C.length>1){this.unconfirmedGroups=C[1];}}}};WapoVisitor.prototype.init=function(){this.wapoLoginId=wapoUtilities.Get_Cookie(wapoEnv.cookie_login_id);if(this.wapoLoginId!==null&&this.wapoLoginId.length>0){this.getDependentLoginValues();}this.baseDomainName=wapoEnv.site_base_domain;this.wapoVisId=wapoUtilities.Get_Cookie(wapoEnv.cookie_vis_id);if(this.wapoVisId!==null){this.reconcileVisId();this.updateWaPoVisId(this.wapoVisId);}else{this.initVisId();}this.wapoLoginId=wapoUtilities.Get_Cookie(wapoEnv.cookie_login_id);if(this.wapoLoginId!==null&&this.wapoLoginId.length>0){this.getDependentLoginValues();}document.domain=this.baseDomainName;$wpjQ(document).trigger("wapoInit");this.checkPopUp();this.resetThickbox();};WapoVisitor.prototype.resetThickbox=function(){var A=function(){var B=$wpjQ("#wapoReset");if(B.length){B.trigger("click");}};if(this.tbInit===true){this.tbInit=false;}};WapoVisitor.prototype.setWapoVisId=function(){var E="-1";var A=true;for(var D=0;D0&&(previousOmnitureId==null||previousOmnitureId!=D)){B=wapoEnv.wapo_public_protocol+wapoEnv.wapo_site_url+"public/visitor/instance_datum.json?attributeName=omniture_vis_id&attributeValue="+escape(D);$wpjQ.ajax({dataType:"jsonp",jsonp:wapoEnv.param_name_jsonp_callback,url:B,success:function(G){wapoUtilities.Set_Cookie(wapoEnv.cookie_previous_omniture,G.retVal,(50*365),wapoEnv.site_path,wapoEnv.site_base_domain,false);}});}this.updateSessionId();};WapoVisitor.prototype.reconcileVisId=function(){currentVisId=wapoUtilities.Get_Cookie(wapoEnv.cookie_vis_id);if(currentVisId&&wapoSites.length>1){for(var B=0;B1){for(var B=0;B'+'/Register');}else{if(this.displayName===null||this.displayName===""){this.getDependentLoginValues();}$wpjQ("#wapoLogout").remove();$wpjQ("#wapoEditProfile").remove();$wpjQ("#helloLogin").remove();$wpjQ("#helloPic").remove();$wpjQ("#wapoRegistration").remove();$wpjQ("#wapoLogin").remove();$wpjQ("#wapolabs_wrapperLoginStatus").html('Hello '+''+this.displayName+""+"");if(!this.picUrl||this.picUrl===""){$wpjQ('').appendTo("#wapolabs_wrapperLoginStatus");}else{$wpjQ('User Profile Picture').appendTo("#wapolabs_wrapperLoginStatus");}if(!this.providerUrl||this.providerUrl===""){$wpjQ('').appendTo("#wapolabs_wrapperLoginStatus");}else{$wpjQ('Provider Brand').appendTo("#wapolabs_wrapperLoginStatus");}if(this.completedGroups!=null||this.unconfirmedGroups!=null){$wpjQ(' | '+''+'Edit Profile'+"").appendTo("#wapolabs_wrapperLoginStatus");}$wpjQ(' | '+''+'Log out'+"").appendTo("#wapolabs_wrapperLoginStatus");A=wapoEnv.wapo_public_protocol+wapoEnv.wapo_site_url+"public/login/get/"+this.wapoLoginId+"?format=json&jsonp=&"+wapoEnv.param_name_jsonp_callback+"=?"; }wapoVisitor.tbInit=true;return true;};WapoVisitor.prototype.updateWaPoLogin=function(E,C,A,D,F){this.wapoLoginId=C;this.getDependentLoginValues();if(typeof (A)==="undefined"){A="false";}if(typeof (D)==="undefined"){D="true";}if(typeof (F)!=="undefined"){$wpjq(document).trigger(F);}if(E==="true"){var B=getOptionalRegistrationGroups();document.getElementById("TB_iframeContent").src=wapoEnv.wapo_secure_protocol+wapoEnv.wapo_site_url+"siteRegistration?"+wapoEnv.param_name_no_cancel+"="+A+B;}else{$wpjQ(document).trigger("wapoRefreshDisplay");this.updateVisitorLogin();this.resetThickbox();if(typeof (wapoThickBoxCloseCallback)!=="undefined"&&D==="true"){wapoThickBoxCloseCallback();}}};WapoVisitor.prototype.wapoLogout=function(){var A=wapoEnv.wapo_secure_protocol+wapoEnv.wapo_site_url+"public/login/logout"+"?format=json&"+wapoEnv.param_name_login_id+"="+escape(this.wapoLoginId)+"&jsonp=&"+wapoEnv.param_name_jsonp_callback+"=?";$wpjQ.ajax({dataType:"jsonp",jsonp:wapoEnv.param_name_jsonp_callback,url:A,timeout:(2*1000),success:function(B){if(B!==null&&B.providerName!==null){if(B.providerName==="Facebook"&&typeof (FB)!=="undefined"){wapoVisitor.endLogout();FB.logout();}else{wapoVisitor.endLogout();}}},error:function(B,D,C){wapoVisitor.endLogout();}});};WapoVisitor.prototype.endLogout=function(){wapoUtilities.Delete_Cookie(wapoEnv.cookie_login_id,wapoEnv.site_path,wapoEnv.site_base_domain);wapoUtilities.Delete_Cookie(wapoEnv.cookie_groups,wapoEnv.site_path,wapoEnv.site_base_domain);wapoUtilities.Delete_Cookie(wapoEnv.cookie_display,wapoEnv.site_path,wapoEnv.site_base_domain);this.initProperties();$wpjQ(document).trigger(wapoEnv.event_name_logout);this.resetThickbox();if(typeof (wapoLogoutCallback)!=="undefined"){wapoLogoutCallback();}};function wapoInit(A){wapoVisitor=new WapoVisitor();wapoVisitor.windowLocation=A;if(!wapoEnv.customLoginTrigger){$wpjQ(document).bind("wapoLogin.default",function(){});}$wpjQ(document).bind("wapoInit.default",function(){$wpjQ(document).trigger("wapoRefreshDisplay");});$wpjQ(document).bind("wapoLogout.default",function(){$wpjQ(document).trigger("wapoRefreshDisplay");});$wpjQ(document).bind("wapoRegister.default",function(){});$wpjQ(document).bind("wapoRefreshDisplay.default",function(){wapoVisitor.includeSignInRegistration();});wapoVisitor.init();return wapoVisitor;}function getOptionalRegistrationGroups(){var B=$wpjQ("[name="+wapoEnv.meta_tag_optional_groups+"]");var A="";if(B&&B.length>0){A="&"+wapoEnv.param_name_regis_group_name+"="+B[0].content;}return A;}var wapoVisitor=wapoInit(window.location.href);WapoEnv.prototype.Get_Unescaped_Cookie=function(B){var H,C,F,G,E,D,A;H=document.cookie.split(";");E=false;D=/^(.*?)(=)(.*?)$/;A=H.length;while(A--){C=H[A].match(D);if(typeof (C)!=="undefined"&&C!==null){F=C[1].replace(/^\s+|\s+$/g,"");if(F===B){E=true;if(C[2]==="="){G=C[3].replace(/^\s+|\s+$/g,"");}return G;}}C=null;F="";}if(!E){return null;}};