var aps=aps||{};aps.juiceMatchedUrl="www.sfchronicle.com/";var juiceservice = ('https:' == document.location.protocol ? 'https:' : 'http:') +'//aps.hearstnp.com/';/* PageID: 29839 */ var APSpageID = 29839;var APSGenerationID='';var APSResponsiveDesign = true;var aps = aps || {};var definedTags = {"networkCode":"36117602","adUnit":"hnp-sfchronicle.com","kvps":[{"key":"WcmID","value":"{window.omni_bizObjectId;}"}],"ads":[{"width":1,"height":4,"code":"Video_MOS_Multi","kvps":[{"key":"video_player","value":"mos"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["001x400x300","001x640x480","001x001x004"],"video":true,"companion_units":null},{"width":950,"height":30,"code":"AP951","kvps":[{"key":"DIV_ID","value":"AP951"},{"key":"position","value":"ATF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["1312x001x001","1312x1200x300","1312x980x40","1312x970x415","1312x970x250","1312x971x90","1312x970x90","1312x960x150","1312x950x30","1312x728x90","1312x002x001","0996x001x001","0996x980x40","0996x971x90","0996x970x415","0996x970x250","0996x970x90","0996x960x300","0996x960x150","0996x950x30","0996x728x90","0001x001x001"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"CP300","kvps":[{"key":"DIV_ID","value":"CP300"},{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0996x300x250","0001x00x00"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"DP300","kvps":[{"key":"DIV_ID","value":"DP300"},{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0996x300x250","0001x00x00"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"EP300","kvps":[{"key":"DIV_ID","value":"EP300"},{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0996x300x250","0001x00x00"],"video":false,"companion_units":null},{"width":728,"height":90,"code":"BP728","kvps":[{"key":"DIV_ID","value":"BP728"},{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["1312x1200x300","1312x970x250","1312x970x90","1312x728x90","0996x970x250","0996x970x90","0996x728x90","0001x00x00"],"video":false,"companion_units":null},{"width":320,"height":50,"code":"PMAD","kvps":[],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0001x320x50"],"video":false,"companion_units":null},{"width":501,"height":501,"code":"CONCERT1","kvps":[{"key":"position","value":"ATF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["1312x501x501","0654x501x501"],"video":false,"companion_units":null},{"width":501,"height":501,"code":"CONCERT2","kvps":[{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["1312x501x501","0654x501x501"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"AP300","kvps":[{"key":"DIV_ID","value":"AP300"},{"key":"position","value":"ATF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0001x004x001","0001x300x250"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"BP300","kvps":[{"key":"DIV_ID","value":"BP300"},{"key":"position","value":"BTF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["0996x300x250","0996x005x001","0654x300x250","0654x005x001","0001x300x250","0001x005x001"],"video":false,"companion_units":null},{"width":300,"height":250,"code":"GO300","kvps":[{"key":"page_type","value":"article_slideshow_overlay"},{"key":"position","value":"ATF"}],"rm":false,"interstitial":false,"oop":false,"sizeMappings":["1312x300x250","0996x300x250","0654x300x250","0001x300x250"],"video":false,"companion_units":null}],"responsiveMappings":56,"singleRequestMode":false};aps.scriptHash='0xB9F5C07E25D5BC7DCA5F9831EAD47B0B3CB7BEB2';aps.loadedModules=[{"name":"logs_and_events","description":"functions pertaining to logging and our event structure"},{"name":"common","description":"functions common to sync and async"},{"name":"domain_variables","description":"setup domain name variables for other modules"},{"name":"googlePubTagAsync","description":"google asynchronous page"},{"name":"initialUpdatePageLevelKVPS patch","description":"temporary patch to fix third party headers"},{"name":"sha256","description":"sha 256 hash implementation"},{"name":"wat_variables_patch","description":"patch which allows waiting on variables"},{"name":"Leaf GDPR","description":"Disable loading of ads when cookie is detected"},{"name":"PageUrl And Referrer","description":"PageUrl"},{"name":"page_type and divid","description":"page_type2 page_type3 and divid"},{"name":"Were-You-Seen kvp","description":"Adds a kvp type=seen when matched pathnamer"},{"name":"Richie","description":"some processing specific to Richie app"},{"name":"juice console loader","description":"loads juice console when query string present"},{"name":"SelectiveAdLoading","description":"allows selective ad loading"},{"name":"SelectiveThirdPartyLoading","description":"selective third party loader"},{"name":"Joice KVP Override jo","description":"allows setting a kvp"},{"name":"adRenderCallback","description":"ad callback for analytics or debug"},{"name":"interstitial","description":"support for interstitial ad types by code"},{"name":"news10-interstitial","description":"news10-interstitial"},{"name":"A9","description":"working with prebid"},{"name":"LoggedIn User KVP","description":"Set a KVP for DFP when user is authenticated"},{"name":"Propensity to Subscribe","description":"Identify users as subscribers, past subscribers, non-subscribers, and unknown"},{"name":"BadScriptLogger","description":"function called by our custom firefox"},{"name":"ICrossing URL hash","description":"ICrossing URL hash"},{"name":"GoogleUrlFilter","description":"addresses security violations"},{"name":"FillArb","description":"Build ad def for Arbitrage template"},{"name":"proximic","description":"sets kvp named prox_other using on page pxSegmentIDs variable"},{"name":"lotame","description":"lotame macys"},{"name":"blueconic segments","description":"blueconic segments"},{"name":"PublisherProvidedId","description":"call dfp with publisher id provided by blueconic"},{"name":"nlp","description":"nlp categories"},{"name":"perf_sec KVP","description":"Top-level section KVP"},{"name":"AB Testing","description":"ab kvp module"},{"name":"prebid.js","description":"Main script"},{"name":"Aardvark","description":"prebid version"},{"name":"AppNexus","description":"prebid version"},{"name":"AudienceNetwork","description":"prebid version"},{"name":"IndexExchange","description":"prebid version"},{"name":"OpenX","description":"prebid version"},{"name":"Pubmatic","description":"prebid version"},{"name":"Rubicon","description":"prebid version"},{"name":"Prebid Config","description":"prebid config"},{"name":"Browsi","description":null},{"name":"end of loading marker","description":"end of loading marker"}];window.aps=window.aps||{};
window.googletag=window.googletag||{};
window.pbjs=window.pbjs||{};
window.HDN=window.HDN||{};
(function(){aps.cmd=[];
aps.juiceLog=[];
aps.modules={};
aps.events=[];
aps.event={};
aps.app_events={};
aps.logtype={};
aps.implementSRA=true;
googletag.cmd=googletag.cmd||[];
pbjs.que=pbjs.que||[];
pbjs.bidderSettings=pbjs.bidderSettings||{};
HDN.dataLayer=HDN.dataLayer||{};
HDN.dataLayer.ads=HDN.dataLayer.ads||{};
aps.pageWidth=window.screen.width||top.window.innerWidth||window.width||-1;
window.DESKTOP=1;
window.MOBILE=2;
window.curent_device=(aps.pageWidth<768)?MOBILE:DESKTOP;
aps.cfg={advertisers:{46962802:"House PSA",46402162:"House PSA",53211082:"Google Adx",53212282:"Rubicon",47574562:"Index",46328242:"A9",53204482:"OpenX",53058082:"Sonobi",85442122:"Yieldbot",198604042:"AppNexus",99465802:"Facebook",47576002:"Kargo",4506751574:"Rtk",4401894681:"Yieldmo",79962922:"Pubmatic",169656562:"RhythmOne",4417528020:"TripleLift",203184442:"Gamut Media",169655602:"OpenX",195800602:"Sovrn",169656562:"Rubicon",},disablePersonalisation:false,logToConsole:(window.location.search.indexOf("console=1")!==-1)?true:false,nlpCat:[],stp:{at:-1,def:{timeout:2500,nextTimeout:1500,dfpCalled:false,ads:[],divids:[],pb:{biddersDone:0,},a9:{bidsReceived:false,},adRendered:false,}},dfp:{arbitrage:{enabled:(window.location.search.indexOf("arb=1")!==-1)?true:false,ad:{},ads:[],ids:[],},batchSRA:{delay:3000,enabled:(window.location.search.indexOf("batchsra=1")!==-1||document.location.hostname.toLowerCase()=="sfinsider.sfgate.com")?true:false,auto:false,waitingNext:false,hasScrolled:false,maxSlots:10,userInteractFor:1,atfFirst:true,},removeMissingDivs:true,},bid:{a9:{adUnits:[],bids:[],enabled:true,excludedSlots:["MW_1_TEXT","MW_2_TEXT","MW_3_TEXT"],config:{},apstag:{},initCalled:false,videoAdUnits:[],partners:[],},pb:{acceptablePageTypes:["channel","article","comments","blog","home page","search","undefined","homepage","page not found","Blogs"],bids:[],config:{},data:{},disabledOnMobile:["aardvark","appnexus","ix","openx","pubmatic","rubicon","yieldmo"],adUnits:[],adUnitIds:[],videoAdUnits:[],s2sBidders:[],bidders:[],biddersCount:0,biddersDone:0,settings:{},},disableMobile:false,enabled:(window.location.search.indexOf("pb=0")!==-1)?false:true,enableGDPR:false,excludedSlots:["CONCERT1","CONCERT2"],excludedDomains:["gametimect.com"],lessBidder:0,current_domain:"",current_device:curent_device,},vid:{mode:"apv",tagUrl:"",enabled:(typeof(HDN.dataLayer.ads.videoBidding)=="undefined")?true:HDN.dataLayer.ads.videoBidding,},excludeModules:[],};
aps.adPerformanceMetrics={};
aps.performanceMetrics={adUnit:"",networkCode:0,JuiceScriptLoading:0,JuiceScriptDoneLoading:0,FirstAdRendered:0,GoogleLoaded:0,TotalThirdPartyScripts:0,ThirdPartyScriptsLoaded:0,DefineTags:0,page_type2:"",matchedUrl:"",ThirdParty:{},iCrossing_userid:"",urlHash:""};
aps.getCookie=function(j){var l=j+"=";
var h=document.cookie.split(";");
for(var k=0;
k'+m+" : "+j[h].m+"";
e+=k
}var n=window.open("","wnd");
n.document.body.innerHTML=e
};
aps.formatDateTime=function(l){var e=(l.getHours()<10?"0":"")+l.getHours();
var i=(l.getMinutes()<10?"0":"")+l.getMinutes();
var k=(l.getSeconds()<10?"0":"")+l.getSeconds();
var j=l.getMilliseconds();
return e+":"+i+":"+k+": "+j
};
aps.getAdMetrics=function(e){var h=aps.adPerformanceMetrics[e];
if(typeof(h)=="undefined"){h={lineItemId:0,creativeId:0,DomId:e,hearstPlaceAd:0,googleDisplay:0,rendered:0,impressionViewable:0,refreshCalled:0,isEmpty:true,size:"",totalRenders:0,totalImpressions:0,pageInfo:aps.performanceMetrics};
aps.adPerformanceMetrics[e]=h
}return h
};
aps.registerModule=function(e){aps.modules[e]={};
return aps.modules[e]
};
aps.getThirdPartyMetrics=function(h){var e=aps.performanceMetrics.ThirdParty[h];
if(typeof(e)=="undefined"){e={start:0,stop:0,runtime:0,refresh_start:0,refresh_stop:0,refresh_runtime:0};
aps.performanceMetrics.ThirdParty[h]=e
}return e
};
aps.startThirdParty=function(e){aps.getThirdPartyMetrics(e).start=aps.getTimeElapsed()
};
aps.stopThirdParty=function(h){var e=aps.getThirdPartyMetrics(h);
e.stop=aps.getTimeElapsed();
e.runtime=(e.stop-e.start).toFixed(2)
};
aps.startThirdPartyRefresh=function(e){aps.getThirdPartyMetrics(e).refresh_start=aps.getTimeElapsed()
};
aps.stopThirdPartyRefresh=function(h){var e=aps.getThirdPartyMetrics(h);
e.refresh_stop=aps.getTimeElapsed();
e.refresh_runtime=(e.refresh_stop-e.refresh_start).toFixed(2)
};
aps.performanceMetrics.JuiceScriptLoading=aps.getTimeElapsed();
aps.performanceMetrics.SRA=aps.implementSRA?"true":"false";
aps.logInfo("start of juice script loading");
try{if(HDN.dataLayer.content.displayTemplate=="ard"){aps.cfg.dfp.batchSRA.enabled=true;
if(aps.cfg.bid.current_device==MOBILE){aps.cfg.dfp.batchSRA.userInteractFor=0;
aps.cfg.dfp.batchSRA.atfFirst=false
}}}catch(d){}try{if(HDN.dataLayer.ads.adMode=="arb"){aps.cfg.dfp.arbitrage.enabled=true;
aps.logInfo("Enabling Arbitrage Mode")
}}catch(d){}aps.startStep=function(){if(aps.cfg.stp.at==-1||aps.cfg.stp[aps.cfg.stp.at].adRendered){if(aps.cfg.stp.at>0){aps.cfg.stp.def.timeout=aps.cfg.stp.def.nextTimeout
}aps.cfg.stp.at++;
aps.cfg.stp[aps.cfg.stp.at]=JSON.parse(JSON.stringify(aps.cfg.stp.def));
if(!aps.cfg.bid.a9.enabled){aps.cfg.stp[aps.cfg.stp.at].a9.bidsReceived=true
}return true
}else{return false
}};
aps.nextBatchSRA=function(){if((!aps.cfg.dfp.batchSRA.enabled||aps.cfg.dfp.batchSRA.auto&&aps.cfg.dfp.batchSRA.waitingNext)||(aps.cfg.dfp.batchSRA.userInteractFor>(aps.cfg.stp.at+1))){if(aps.startStep()){window.defineTags(definedTags)
}}else{aps.logInfo("Batch SRA : waiting for scroll")
}};
aps.onScroll=function(){if(aps.cfg.dfp.batchSRA.hasScrolled){return
}if(aps.cfg.dfp.batchSRA.userInteractFor==(aps.cfg.stp.at+1)){aps.logInfo("Batch SRA : Scrolled");
aps.cfg.dfp.batchSRA.auto=true;
if(aps.cfg.dfp.batchSRA.waitingNext||aps.cfg.dfp.batchSRA.userInteractFor==0){if(aps.cfg.dfp.batchSRA.userInteractFor==0){aps.cfg.dfp.batchSRA.waitingNext=true
}aps.nextBatchSRA();
aps.cfg.dfp.batchSRA.hasScrolled=true
}}};
try{if(HDN.jwplayers){for(var g in HDN.jwplayers){if(!g.mute&&!g.startenabled){aps.cfg.vid.mode="ctp"
}}}}catch(c){}document.addEventListener("hdn.jwplayer",function(h){aps.logInfo("VideoEvent: "+h.details.eventAction);
console.log(h.details);
if(h.details.eventAction=="Video Progress 75%"){aps.logInfo("Requesting new video bids");
aps.cfg.vid.tagUrl="";
aps.fireEvent(aps.event.on_request_new_video_ads,{})
}},false);
if(aps.cfg.dfp.batchSRA.enabled){aps.logInfo("Batch SRA : linstening to Scroll event");
if(window.addEventListener){window.addEventListener("scroll",aps.onScroll,false);
window.addEventListener("click",aps.onScroll,false)
}else{if(window.attachEvent){window.attachEvent("onscroll",aps.onScroll);
window.attachEvent("onclick",aps.onScroll)
}}}})();(function(){aps.refreshAvailable=false;
aps.pageKVPsByDomID=[];
aps.hearstPlaceAdHasUpdatedKVPS=false;
aps.current_page_kvps={};
aps.adScripts=aps.adScripts||{};
aps.queuedWaitCount=aps.queuedWaitCount||0;
aps.queuedScriptCount=aps.queuedScriptCount||0;
aps.adScriptsLoaded=false;
aps.queryStringObj=null;
aps.serveAds=true;
aps.slotsSetup=false;
aps.faceBookInstantArticle=(JuicePageUrl.indexOf("juicemode=fbinstant")!==-1);
aps.shouldPlaceAd=function(adCode){return true
};
aps.shouldRunThirdParty=function(modulecode){return true
};
aps.loadGoogleService=function(async){window.onJuiceEvent_LoadingGPT&&window.onJuiceEvent_LoadingGPT();
if(!aps.googleLoaded){var gads=document.createElement("script");
if(async){gads.async=true
}gads.type="text/javascript";
gads.src="https://www.googletagservices.com/tag/js/gpt.js";
var node=document.getElementsByTagName("script")[0];
node.parentNode.insertBefore(gads,node)
}};
aps.gcontext={};
aps.gcontext._setTargeting=function(kvpKey,kvpValue){if(kvpKey!=""){aps.current_page_kvps[kvpKey]=kvpValue;
googletag.pubads().setTargeting(kvpKey,kvpValue)
}};
aps.gcontext.pubads=function(){this.setTargeting=function(kvpKey,kvpVal,logmsg){logmsg=logmsg||null;
if(aps.slotsSetup){aps.gcontext._setTargeting(kvpKey,kvpVal);
if(logmsg!=null){aps.logInfo(logmsg)
}}else{aps.registerEvent(aps.event.on_end_define_tags,function(parms){aps.gcontext._setTargeting(kvpKey,kvpVal);
if(logmsg!=null){aps.logInfo(logmsg)
}})
}};
this.clearTargeting=function(kvpKey){aps.current_page_kvps[kvpKey]=null;
googletag.pubads().clearTargeting(kvpKey)
};
return this
};
aps.runWhenSlotsReady=function(fn){if(aps.slotsSetup){fn()
}else{aps.registerEvent(aps.event.on_end_define_tags,function(parms){fn()
})
}};
aps.getQueryParameterByName=function(key){if(aps.qeueryStringObj==null){aps.qeueryStringObj=aps.queryStringToJSON()
}var qobj=aps.qeueryStringObj;
var keyToUse=key.replace("[]","");
if(!qobj.hasOwnProperty(keyToUse)){return null
}if(key.indexOf("[]")==-1){return qobj[keyToUse]
}if(typeof qobj[keyToUse]==="string"){var retval=[];
retval.push(qobj[keyToUse]);
return retval
}return qobj[keyToUse]
};
aps.queryStringToJSON=function(){var str=location.search.slice(1);
var pairs=str.split("&");
var result={};
pairs.forEach(function(pair){pair=pair.split("=");
var name=pair[0];
var value=pair[1];
if(name.length){if(result[name]!==undefined){if(!result[name].push){result[name]=[result[name]]
}result[name].push(value||"")
}else{result[name]=value||""
}}});
return(result)
};
aps.initialUpdatePageLevelKVPS=function(apsContext){if(!aps.hearstPlaceAdHasUpdatedKVPS){aps.hearstPlaceAdHasUpdatedKVPS=true;
aps.logInfo("calling updatePageLevelKVPS from hpa");
top.aps.updatePageLevelKVPS(apsContext)
}};
aps.updatePageLevelKVPS=function(apsContext){for(var i=0;
i0){var arFixedMappings=[];
var arViewports=[];
var viewPortIDX={};
for(var i=0;
i0){for(var i=0;
i=2)?arguments[1]:divID;
aps.codesByDomID[divID]=code
};
aps.isDivIDUniqueForAdPlacement=function(fname,divID){if(typeof(aps.codesByDomID[divID])!="undefined"){if(aps.codesByDomID[divID]=="passthrough"){return true
}aps.logWarning("A duplicate div id was specified ("+divID+") for "+fname+". The call was ignored.");
return false
}return true
};
aps.logPageKVPsforDiv=function(divID){aps.pageKVPsByDomID[divID]={};
var pageKVPs=aps.current_page_kvps;
var divKVPS=aps.pageKVPsByDomID[divID];
for(var keyVal in pageKVPs){if(!pageKVPs.hasOwnProperty(keyVal)){continue
}divKVPS[keyVal]=pageKVPs[keyVal]
}};
window.setDfpSearchValues=function(apsContext){if(typeof(aps)!="undefined"&&aps!=null){aps.key=aps.key||"";
aps.values=aps.values||"";
try{apsContext.pubads().setTargeting(aps.key,aps.values)
}catch(e){}}};
aps.run_once=function(fn,context){var result;
return function(){if(fn){result=fn.apply(context||this,arguments);
fn=null
}return result
}
};
aps.contentLoaded=function(win,fn){var done=false,top=true,doc=win.document,root=doc.documentElement,add=doc.addEventListener?"addEventListener":"attachEvent",rem=doc.addEventListener?"removeEventListener":"detachEvent",pre=doc.addEventListener?"":"on",init=function(e){if(e.type=="readystatechange"&&doc.readyState!="complete"){return
}(e.type=="load"?win:doc)[rem](pre+e.type,init,false);
if(!done&&(done=true)){fn.call(win,e.type||e)
}},poll=function(){try{root.doScroll("left")
}catch(e){setTimeout(poll,50);
return
}init("poll")
};
if(doc.readyState=="complete"){fn.call(win,"lazy")
}else{if(doc.createEventObject&&root.doScroll){try{top=!win.frameElement
}catch(e){}if(top){poll()
}}doc[add](pre+"DOMContentLoaded",init,false);
doc[add](pre+"readystatechange",init,false);
win[add](pre+"load",init,false)
}};
aps.getChildElementByNameAndTag=function(elm,name,tagName){var nodes=elm.childNodes;
for(var i=0;
i-1){aps.logInfo("Skippig ad:"+ad.code);
return sizes
}for(var j=0;
japs.pageWidth){continue
}if(widthfound==30000){widthfound=split
}if(widthfound==split){var adSize=map[1]+"x"+map[2];
if(availables.indexOf(adSize)>-1){sizes.push([parseInt(map[1]),parseInt(map[2])])
}}}return sizes
}
})();(function(){var b=this;
b.getHostName=function(d){var c=d.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);
if(c!=null&&c.length>2&&typeof c[2]==="string"&&c[2].length>0){return c[2]
}else{return null
}};
b.getDomain=function(f){var d=b.getHostName(f);
var c=d;
if(d!=null){var e=d.split(".").reverse();
if(e!=null&&e.length>1){c=e[1]+"."+e[0];
if(e.length>2&&e[2].toLowerCase()=="m"){c="m."+c
}}}return c
};
if(typeof(aps.current_domain)=="undefined"){try{aps.current_domain=b.getDomain(document.URL)
}catch(a){aps.logException("unable to resolve domain name",a);
aps.current_domain="undefined"
}}aps.cfg.bid.current_domain=aps.current_domain;
if(aps.cfg.bid.current_domain.indexOf("m.")==0){aps.cfg.bid.current_domain=aps.cfg.bid.current_domain.substr(2)
}})();(function(){aps.divIDPostfix="ju1c3-TWFobmEgTWFobmE=";
aps.scriptName="googleAsync";
aps.leaderboardLineItemID=null;
aps.page=null;
aps.slotsByDivID=[];
aps.interstitialAdDefs=[];
aps.adsByCode=[];
aps.codesByDomID=[];
aps.domIsLoaded=false;
aps.dynamicSlots=[];
aps.refreshableSlots=[];
aps.normalAdSlots=[];
aps.dynamicAdSlots=[];
aps.dfpInititalization=false;
aps.callsByDomID=[];
aps.renderInfo=[];
aps.isIFrameDynamicPage=(top!=self);
aps.refreshWaitCounter=0;
aps.refreshWaitScripts={};
aps.disabledWaitScripts={};
aps.refreshViewableOnly=false;
aps.videoAdTag=null;
aps.perf_sec="video";
if(aps.cfg.bid.enabled){googletag.cmd.push(function(){googletag.pubads().disableInitialLoad()
})
}aps.unQueueCommands=function(){for(var a=0;
a0){var d=googletag.pubads().getSlots();
if(!aps.cfg.stp[0].dfpCalled){for(var k in d){if(d[k].getSlotElementId()=="A300"){if(document.getElementById("A300")==null&&b<20){aps.logInfo("waiting for div A300 - "+b++);
setTimeout(function(i){aps.enableGoogleServices(b)
},10);
return
}}}}var g="";
for(var l in d){e=d[l].getSlotElementId();
if(aps.cfg.stp[aps.cfg.stp.at].ads.indexOf(e)){var k=d[l];
var c=document.getElementById(e);
if(c==null){aps.adsByCode[e].batchRequest="done";
k.requestStatus="destroyed";
h.push(k);
g=(g=="")?e:g+", "+e
}else{if(aps.adsByCode[e].batchRequest=="requested"){aps.adsByCode[e].batchRequest="called";
j.push(k);
aps.cfg.stp[aps.cfg.stp.at].divids.push(c.id);
var a=aps.getAdDefinitionByCode(c.id);
if(typeof a.placed=="undefined"){hearstPlaceAd(c.id);
if(typeof loadAd_UrlLocation=="undefined"){loadAd_UrlLocation=juiceservice
}}}}}}if(h.length>0){aps.logInfo("Div(s) "+g+" not on page : destroyed");
googletag.destroySlots(h)
}}}aps.logInfo("prebid set targeting");
aps.updatePageLevelKVPS(aps.gcontext);
pbjs.setTargetingForGPTAsync(aps.cfg.stp[aps.cfg.stp.at].divids);
aps.fireEvent(aps.event.on_before_enable_google_services);
aps.logInfo("Calling DFP: "+aps.cfg.stp[aps.cfg.stp.at].divids);
googletag.pubads().refresh(j);
aps.cfg.stp[aps.cfg.stp.at].dfpCalled=true;
aps.logInfo("googleServices done");
if(!aps.cfg.stp[aps.cfg.stp.at].adRendered){aps.cfg.stp[aps.cfg.stp.at].adRendered=true;
for(var f=0;
f0||h.length>0)){if(j.length==0){aps.cfg.dfp.batchSRA.waitingNext=true;
aps.logInfo("Batch SRA : next step");
aps.nextBatchSRA()
}else{aps.cfg.dfp.batchSRA.waitingNext=true;
if(aps.cfg.dfp.batchSRA.auto){aps.logInfo("Batch SRA : waiting to next step in "+aps.cfg.dfp.batchSRA.delay+" ms");
setTimeout(function(){aps.nextBatchSRA()
},aps.cfg.dfp.batchSRA.delay)
}else{aps.nextBatchSRA()
}}}};
window.defineTags=function(a){if(aps.cfg.stp.at==-1){aps.nextBatchSRA();
return
}if(!aps.serveAds){return
}if(aps.cfg.stp.at==1&&aps.cfg.dfp.arbitrage.enabled&&typeof(aps.cfg.dfp.arbitrage.ad.code)=="undefined"){aps.logInfo("Arbitrage - waiting ads to be loaded");
return
}if(aps.cfg.dfp.batchSRA.enabled){aps.logInfo("Batch SRA mode - step : "+aps.cfg.stp.at)
}aps.logInfo("defineTags");
if(aps.cfg.stp.at==0){aps.logInfo("loading async google");
aps.loadGoogleService(true);
googletag.cmd.push(function(){aps.logInfo("google ready");
aps.performanceMetrics.GoogleLoaded=aps.getTimeElapsed();
aps.performanceMetrics.matchedUrl=aps.juiceMatchedUrl;
googletag.pubads().collapseEmptyDivs();
googletag.pubads().enableSingleRequest();
googletag.enableServices()
});
aps.loadAsyncScripts();
aps.page=a;
aps.page_kvps=a.kvps;
googletag.cmd.push(function(){try{var c=JSON.parse(GetCookie("location_data"));
if(c.is_eu){aps.cfg.disablePersonalisation=true
}}catch(b){}if(aps.cfg.disablePersonalisation){aps.logInfo("disabling personalizedAds");
googletag.pubads().setRequestNonPersonalizedAds(1)
}googletag.pubads().addEventListener("slotRenderEnded",function(f){if(typeof f.slot.getSlotId!="undefined"){if(typeof f.slot.getSlotId().getDomId!="undefined"){hearstUpdateSlotRenderInfo(f);
aps.adRenderCallback&&aps.adRenderCallback(f)
}var d=f.slot.getSlotId().m;
if(d=="MAD"){if(f.size[0]!=320||f.size[1]!=50){aps.logInfo("Fixing: MAD having wrong size: "+f.size);
var h=document.getElementById("MAD").firstChild;
h.style.width="320px";
h.style.height="50px"
}}if(!aps.cfg.stp[aps.cfg.stp.at].adRendered){aps.cfg.stp[aps.cfg.stp.at].adRendered=true;
for(var g=0;
g1){f.impressionViewable=aps.getTimeElapsedFromStamp(f.refreshCalled)
}else{f.impressionViewable=aps.getTimeElapsed()
}d.impressionViewable=true;
aps.fireEvent(aps.event.on_ad_impression_viewable,{code:g})
}}})
})
}googletag.cmd.push(function(){var g=0;
var h={};
aps.cfg.stp[aps.cfg.stp.at].ads=aps.cfg.stp[aps.cfg.stp.at].ads||[];
window.onJuiceEvent_StartDefineTags&&window.onJuiceEvent_StartDefineTags();
aps.fireEvent(aps.event.on_begin_define_tags);
aps.logInfo("defining tags started");
if(aps.performanceMetrics.DefineTags==0){aps.performanceMetrics.DefineTags=aps.getTimeElapsed();
aps.performanceMetrics.adUnit=a.adUnit;
aps.performanceMetrics.networkCode=a.networkCode
}aps.definedTagArr=aps.definedTagArr||{};
for(var f=0;
f0){if(aps.cfg.dfp.arbitrage.ads[aps.cfg.stp.at].indexOf(b.code)>=0){c=true
}}}}}}if(c){if(window.location.search.indexOf("fluid=1")!==-1){j=googletag.defineSlot("/"+a.networkCode+"/"+a.adUnit,["fluid"],b.newDivID)
}else{j=googletag.defineSlot("/"+a.networkCode+"/"+a.adUnit,[b.width,b.height],b.newDivID)
}b.adSizeDefined=[b.width,b.height];
aps.logInfo(b.code+" slot defined");
aps.definedTagArr[b.code]=b;
h[b.code]=j;
b.batchRequest="requested";
g++
}}}if(j!=null){aps.normalAdSlots[b.code]=j;
aps.cfg.stp[aps.cfg.stp.at].ads.push(j);
aps.slotsByDivID[b.newDivID]=j;
if(APSResponsiveDesign==true&&!b.oop){aps.setupResponsiveMappings(j,b)
}j.addService(googletag.pubads());
setDFPSlotTargeting(b,j,false)
}}if(g==0){aps.logInfo("Batch SRA mode - no more slots to process");
return
}setDfpSearchValues(aps.gcontext);
aps.fireEvent(aps.event.on_update_page_level_targeting);
aps.logInfo("defining tags ended : enabling google services");
aps.slotsSetup=true;
window.onJuiceEvent_endDefineTags&&window.onJuiceEvent_endDefineTags();
aps.fireEvent(aps.event.on_end_define_tags,{slots:h});
aps.refreshAvailable=true;
window.onJuiceRefreshable&&window.onJuiceRefreshable();
if(!aps.cfg.bid.enabled){aps.enableGoogleServices(0)
}})
};
window.hearstUpdateSlotRenderInfo=function(k){var p=k.slot||null;
var q=k.slot.getSlotId().getDomId()||null;
var m=k.lineItemId||null;
if(m==null&&k.yieldGroupIds.length>0){m=k.yieldGroupIds[0]
}var h=k.creativeId||null;
var j=k.isEmpty;
var b=k.size||null;
var d=k.advertiserId||null;
var g=k.companyIds||[];
var f=aps.getAdMetrics(q);
f.lineItemId=m;
f.creativeId=h;
f.isEmpty=j;
f.totalRenders++;
if(aps.performanceMetrics.FirstAdRendered==0){aps.performanceMetrics.FirstAdRendered=aps.getTimeElapsed()
}if(f.totalRenders>1){f.rendered=aps.getTimeElapsedFromStamp(f.refreshCalled)
}else{f.rendered=aps.getTimeElapsed()
}if(b!=null){f.size=b[0]+" x "+b[1]
}var c=(d==null)?"No ad":"Direct";
if(typeof(aps.cfg.advertisers[d])!="undefined"){c=aps.cfg.advertisers[d]
}if(d==53211082&&g.length>0){if(typeof(g[0])!="undefined"){c="ExB/"+aps.cfg.advertisers[g[0]]
}}var a=aps.getAdDefinitionByCode(aps.codesByDomID[q]);
a.renderCount++;
a.isLoading=false;
aps.logInfo(a.code+" ["+c+" : "+m+"] rendered into div "+q);
try{a.creativeURL=p.getContentUrl()
}catch(i){a.creativeURL=""
}aps.fireEvent(aps.event.on_ad_rendered,{adDefinition:a,newid:q,lineitem:m,size:b,isEmpty:j});
if(b!=null&&aps.leaderboardLineItemID==null){if(b[0]==300){aps.leaderboardLineItemID=m
}}aps.renderInfo[q]={lineItem:m,creative:h,isEmpty:j,size:b};
if(a.isDynamic==true){var o=a.oldDivID;
var n=a.newDivID;
var r=(b!=null)?b[0]:0;
var l=(b!=null)?b[1]:0;
setTimeout(function(){aps.fireEvent(aps.event.on_dynamic_ad_rendered,{oldid:o,newid:n,cx:r,cy:l});
window.onJuiceEvent_DynamicAdRendered&&window.onJuiceEvent_DynamicAdRendered(o,n,r,l)
},5)
}};
window.hearstGetVideoAdTagSize=function(a){var f="";
if(a.sizeMappings!=undefined&&a.sizeMappings.length>0){var d=[];
for(var c=0;
c1&&parseInt(b[2],10)>4){d.push(parseInt(b[1],10)+"x"+parseInt(b[2],10))
}}f="?sz="+d.join("%7C")
}else{f="?sz="+encodeURIComponent(a.width+"x"+a.height)
}return f
};
window.hearstGetVideoAdTag=function(b){if(aps.videoAdTag==null){aps.logInfo("hearstGetVideoAdTag called with no video tag defined : ignoring ");
return null
}var a=aps.videoAdTag;
if(typeof(a)=="undefined"){aps.logInfo("hearstGetVideoAdTag called with non-defined ad slot "+b+" : ignoring ");
return null
}if(a.video==false){aps.logInfo("hearstGetVideoAdTag called non video defined ad slot "+b);
return null
}aps.fireEvent(aps.event.on_hearst_place_ad,{adDefinition:a});
var g=hearstGetVideoAdTagSize(a);
var h="https://pubads.g.doubleclick.net/gampad/ads";
h+=g;
h+="&iu="+encodeURIComponent(definedTags.networkCode+"/"+definedTags.adUnit);
h+="&url="+encodeURIComponent(top.location.protocol+"//"+JuicePageUrl);
h+="&impl=s";
h+="&gdfp_req=1";
h+="&env=vp";
h+="&output=xml_vast3";
h+="&page_type="+aps.page_type2;
h+="&unviewed_position_start=1";
h+="&description_url="+encodeURIComponent(top.location.protocol+"//"+JuicePageUrl);
h+="&vpos=preroll";
h+="&ad_safe=medium";
if(a.companion_units!=null&&a.companion_units!=""){h+="&ciu_szs="+encodeURIComponent(a.companion_units)
}else{h+="&ciu_szs="
}var c="";
c+="distributor_domain=";
if(aps.current_domain.indexOf("m.")==0){c+=aps.current_domain.substr(2)
}else{c+=aps.current_domain
}c+="&perf_sec="+aps.perf_sec;
c+="&page_type2="+aps.page_type2;
c+="&page_type3="+(encodeURIComponent(aps.getVideoTagPageType3(b)));
c+="&pageurl="+encodeURIComponent(top.location.protocol+"//"+JuicePageUrl);
c+="&referrer="+encodeURIComponent(document.referrer);
c+="&urlhash="+aps.performanceMetrics.urlHash;
c+="&pw=__player-width__&ph=__player-height__";
c+=(aps.cfg.vid.tagUrl=="")?"":"&"+aps.cfg.vid.tagUrl;
for(var d=0;
d0){h+=" &cust_params="+encodeURIComponent(c)
}h+=" &correlator="+new Date().getTime();
aps.logInfo(" hearstgetvideoadtag:"+h);="" return="" h="" };="" aps.getvideotagpagetype3="function(a){var" c="" ;="" if(typeof(aps.topwindow.omni_ssvariant)!="undefined" ){c="_" +aps.topwindow.omni_ssvariant="" }try{aps.page_type2="self.getOmniContentType()" }catch(b){}return="" a+"_"+aps.page_type2+c="" aps.placedynamicduringpageload="function(b){var" a="aps.getAdDefinitionByCode(b);" a.isdynamic="true;" hearstplacead(b)="" window.hearstplacedynamicad="function(){var" b="arguments[0],d;" var="" if(typeof(a)="="undefined"){aps.logWarning("hearstPlaceDynamicAd" called="" with="" non-defined="" ad="" slot="" "+b+"="" :="" ignoring="" ");="" }if(!aps.shouldplacead(b)){a.refreshable="false;" }if(arguments.length="=1){d=aps.getNextDynamicAdDivID(b);" a.olddivid="b;" a.newdivid="d;" document.getelementbyid(b).id="d;" aps.callsbydomid[a.newdivid]="1;" aps.loginfo("hearstplacedynamicad="" one="" parameter="" new="" dom="" id="" "+d)="" }else{d="arguments[1];" if(!aps.isdividuniqueforadplacement("hearstplacedynamicad",d)){return="" }if(document.getelementbyid(arguments[1])="=null){var" d="arguments[1];" if(c<10){c++;="" settimeout(function(){aps.logwarning("div="" did="" not="" exist="" -="" retrying="" "+c);="" hearstplacedynamicad(b,d,c)="" },100)="" }return="" }a.olddivid="d;" }aps.loginfo("hearstplacedynamicad="" "+b+"into="" div="" of="" "+a.newdivid);="" aps.adsbycode[a.newdivid]="a;" aps.markdividasunique(a.newdivid,a.code);="" aps.cmd.push(function(){aps.waitforscriptstoload();="" g="googletag.defineSlot("/"+f.networkCode+"/"+f.adUnit,[a.width,a.height],a.newDivID);" aps.setupresponsivemappings(g,a);="" g.addservice(googletag.pubads());="" setdfpslottargeting(a,g,false);="" aps.fireevent(aps.event.on_update_page_level_targeting);="" g.settargeting("scroll_position",a.rendercount);="" aps.slotsbydivid[a.newdivid]="g;" aps.dynamicadslots[a.newdivid]="g;" a.rendercount++;="" aps.fireevent(aps.event.on_set_dynamic_ad_targeting,{slot:g,addefinition:a});="" aps.dynamicslots.push(g);="" aps.logpagekvpsfordiv(a.newdivid);="" aps.fireevent(aps.event.on_before_display_ad,{addefinition:a,slot:aps.slotsbydivid[a.newdivid]});="" googletag.display(a.newdivid);="" aps.getadmetrics(a.newdivid).googledisplay="aps.getTimeElapsed();" aps.markinterstitialasrefreshable(b);="" googletag.pubads().refresh([g])="" })="" window.hearstplacead="function(){var" divid="(arguments.length==2)?arguments[1]:null;" }}a.placed="true;" aps.getadmetrics(b).hearstplacead="aps.getTimeElapsed();" if(!aps.shouldplacead(b)){a.refreshable="false;" }if(a.code="="OOP"){a.oop=true" }else{a.oop="false" }aps.fireevent(aps.event.on_hearst_place_ad,{addefinition:a});="" if(a.interstitial){aps.loginfo("hearstplacead="" "+b);="" }if(!a.interstitial&&!a.rm){if(divid!="null){aps.logInfo("hearstPlaceAd" calling="" hearstplacedynamicad="" "+divid);="" hearstplacedynamicad(b,divid);="" }else{if(!a.oop){d="true" }}}if(!aps.isdividuniqueforadplacement("hearstplacead",b)){return="" }aps.loginfo("hearstplacead="" aps.markdividasunique(b);="" aps.callsbydomid[b]="0;" if(document.getelementbyid(b)="=null){aps.logInfo("hearstPlaceAd" on="" page:="" "+b)="" }if(d){aps.refreshableslots.push(b)="" }if(document.getelementbyid(b)!="null){try{aps.cmd.push(function(){aps.waitForScriptsToLoad();" aps.initialupdatepagelevelkvps(aps.gcontext);="" aps.logpagekvpsfordiv(b);="" googletag.display(b);="" aps.getadmetrics(b).googledisplay="aps.getTimeElapsed()" }catch(c){aps.logexception("hearstplacead="" exception="" for="" "+b,c)="" }}};="" aps.markinterstitialasrefreshable="function(b){if(b=="GO300"){return" }if(aps.isadcoderefreshable(b)){return="" }var="" if(!a.interstitial){return="" }aps.refreshableslots.push(b)="" aps.isadcoderefreshable="function(a){for(var" b0){var a=0;
self.refreshCheck=setInterval(function(){if(a>50){if(a>50){aps.logError("hearstRefreshAds wait - timed out waiting for a script");
aps.disableFailedWaitScripts()
}aps.refreshWaitCounter=0
}if(aps.refreshWaitCounter<=0){window.clearInterval(self.refreshCheck);
aps.logInfo("hearstRefreshAds wait complete : "+a+" iterations");
aps.logInfo(b);
googletag.cmd.push(function(){if(aps.cfg.bid.enabled){aps.cfg.stp[aps.cfg.stp.at].dfpCalled=true;
pbjs.setTargetingForGPTAsync()
}googletag.pubads().refresh(c)
})
}a++
},50)
}else{aps.logInfo(b);
googletag.cmd.push(function(){googletag.pubads().refresh(c)
})
}};
window.hearstRefreshAds=function(){var a=(arguments.length==1)?arguments[0]:aps.refreshableSlots;
var n=[];
var m=this;
var l="";
var h=[];
var k=[];
var g=0;
if(!aps.refreshAvailable){aps.logInfo("hearstRefreshAds called premature : rejected");
return
}if(arguments.length==1){aps.logInfo("refresh ads called : (specific list) "+a.join(", "))
}else{var f=[];
for(var d=0;
d0){aps.logInfo("Skipping refresh as we are still waiting on third parties to return.");
return
}aps.refreshWaitCounter=0;
aps.updatePageLevelKVPS(aps.gcontext);
aps.fireEvent(aps.event.on_update_page_level_targeting);
aps.fireEvent(aps.event.on_before_refresh_ads);
a=h;
for(c=0;
c0){aps.refreshSlotsWithWaitCounter(n,l)
}};
window.hearstRefreshInterstitialAds=function(a){var f=[];
var b=[];
aps.logInfo("hearstRefreshInterstitialAds called: "+a.join(", "));
if(!aps.refreshAvailable){aps.logInfo("hearstRefreshInterstitialAds called premature : rejected");
return false
}for(var d=0;
d0){aps.refreshSlotsWithWaitCounter(f,b.join(", "))
}};
aps.contentLoaded(window,aps.domLoaded)
})();(function(){aps.topWindow=(aps.scriptName=="googleAsync")?window:top;
aps.topAps=aps.topWindow.aps;
aps.initialUpdatePageLevelKVPS=function(a){if(!aps.hearstPlaceAdHasUpdatedKVPS){aps.hearstPlaceAdHasUpdatedKVPS=true;
aps.logInfo("calling updatePageLevelKVPS from hpa");
aps.topAps.updatePageLevelKVPS(a)
}}
})();aps.hash=aps.hash||{};
aps.codec=aps.codec||{};
aps.bitArray={bitSlice:function(b,d,c){b=aps.bitArray._shiftRight(b.slice(d/32),32-(d&31)).slice(1);
return(c===undefined)?b:aps.bitArray.clamp(b,c-d)
},extract:function(b,d,c){var f,e=Math.floor((-d-c)&31);
if((d+c-1^d)&-32){f=(b[d/32|0]<<(32-e))^(b[d/32+1|0]>>>e)
}else{f=b[d/32|0]>>>e
}return f&((1<0&&d){b[c-1]=aps.bitArray.partial(d,b[c-1]&2147483648>>(d-1),1)
}return b
},partial:function(b,c,a){if(b===32){return c
}return(a?c|0:c<<(32-b))+b*1099511627776
},getPartial:function(a){return Math.round(a/1099511627776)||32
},equal:function(c,d){if(aps.bitArray.bitLength(c)!==aps.bitArray.bitLength(d)){return false
}var f=0,e;
for(e=0;
e=32;
g-=32){f.push(c);
c=0
}if(g===0){return f.concat(b)
}for(d=0;
d>>g);
c=b[d]<<(32-g)
}e=b.length?b[b.length-1]:0;
h=aps.bitArray.getPartial(e);
f.push(aps.bitArray.partial(g+h&31,(g+h>32)?c:f.pop(),1));
return f
},_xor4:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]
},byteswapM:function(b){var c,e,d=65280;
for(c=0;
c>>24)|((e>>>8)&d)|((e&d)<<8)|(e<<24)
}return b
}};
aps.codec.hex={fromBits:function(a){var c="",b;
for(b=0;
b>>8>>>8>>>8);
e<<=8
}return decodeURIComponent(escape(d))
},toBits:function(c){c=unescape(encodeURIComponent(c));
var b=[],a,d=0;
for(a=0;
a9007199254740991){throw ("Cannot hash more than 2^53 - 1 bits")
}if(typeof Uint32Array!=="undefined"){var d=new Uint32Array(a);
var g=0;
for(f=512+k-((512+k)&511);
f<=h;
f+=512){this._block(d.subarray(16*g,16*(g+1)));
g+=1
}a.splice(0,16*g)
}else{for(f=512+k-((512+k)&511);
f<=h;
f+=512){this._block(a.splice(0,16))
}}return this
},finalize:function(){var d,a=this._buffer,c=this._h;
a=aps.bitArray.concat(a,[aps.bitArray.partial(1,1)]);
for(d=a.length+2;
d&15;
d++){a.push(0)
}a.push(Math.floor(this._length/4294967296));
a.push(this._length|0);
while(a.length){this._block(a.splice(0,16))
}this.reset();
return c
},_init:[],_key:[],_precompute:function(){var c=0,e=2,a,d;
function b(f){return(f-Math.floor(f))*4294967296|0
}for(;
c<64;
e++){d=true;
for(a=2;
a*a<=e;
a++){if(e%a===0){d=false;
break
}}if(d){if(c<8){this._init[c]=b(Math.pow(e,1/2))
}this._key[c]=b(Math.pow(e,1/3));
c++
}}},_block:function(t){var q,s,c,d,e=this._h,r=this._key,f=e[0],g=e[1],j=e[2],l=e[3],m=e[4],n=e[5],o=e[6],p=e[7];
for(q=0;
q<64;
q++){if(q<16){s=t[q]
}else{c=t[(q+1)&15];
d=t[(q+14)&15];
s=t[q&15]=((c>>>7^c>>>18^c>>>3^c<<25^c<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+t[q&15]+t[(q+9)&15])|0
}s=(s+p+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(o^m&(n^o))+r[q]);
p=o;
o=n;
n=m;
m=l+s|0;
l=j;
j=g;
g=f;
f=(s+((g&j)^(l&(g^j)))+(g>>>2^g>>>13^g>>>22^g<<30^g<<19^g<<10))|0
}e[0]=e[0]+f|0;
e[1]=e[1]+g|0;
e[2]=e[2]+j|0;
e[3]=e[3]+l|0;
e[4]=e[4]+m|0;
e[5]=e[5]+n|0;
e[6]=e[6]+o|0;
e[7]=e[7]+p|0
}};(function(){aps.waitForScriptsToLoad=function(){};
aps.scriptLoaderStarted=false;
aps.requiredGPTScriptCount=aps.requiredGPTScriptCount||0;
aps.loadAsyncScripts=function(){if(aps.topWindow!=self){return
}aps.logInfo("loadingAsyncScripts: "+aps.queuedScriptCount);
aps.performanceMetrics.TotalThirdPartyScripts=aps.queuedScriptCount;
for(var a in aps.adScripts){if(aps.adScripts.hasOwnProperty(a)){aps.queueAsyncScript(aps.adScripts[a])
}}aps.scriptLoaderStarted=true;
aps.testAsyncWaitFunctions();
aps.initializeScriptLoadChecking()
};
aps.queueAsyncScript=function(a){a.loadstart=new Date();
if(a.testFunction!=null){return
}var b=a;
a.callback=function(){if(!b.complete){b.loadend=new Date();
b.complete=true;
aps.logInfo(b.name+" loaded : "+(b.loadend-b.loadstart));
aps.fireEvent(aps.event.on_script_loaded,{scriptDetails:b})
}};
aps._loadScript2(a)
};
aps.testAsyncWaitFunctions=function(){for(var b in aps.adScripts){if(aps.adScripts.hasOwnProperty(b)){if(aps.adScripts[b].testFunction!=null&&aps.adScripts[b].complete==false){if(aps.adScripts[b].testFunction()===true){var a=aps.adScripts[b];
a.loadend=new Date();
a.complete=true;
aps.logInfo(a.name+" loaded : "+(a.loadend-a.loadstart));
aps.fireEvent(aps.event.on_script_loaded,{scriptDetails:aps.adScripts[b]})
}}}}};
aps._testAsyncStatus=function(){var a=aps.adScripts;
aps.testAsyncWaitFunctions();
var c=0;
for(var b in aps.adScripts){if(aps.adScripts.hasOwnProperty(b)){if(aps.adScripts[b].complete&&aps.adScripts[b].requiredForGPT){c++
}}}if(c==aps.requiredGPTScriptCount){aps.adScriptsLoaded=true
}return aps.adScriptsLoaded
};
aps.initializeScriptLoadChecking=function(){var c=this;
var b=0;
var a=aps.adScripts;
aps.adScriptsLoaded=false;
aps.logInfo("initializeScriptLoadChecking");
c.loadCheck=function(){if(b>50){aps.logError("ScriptLoadChecking timed out waiting for a script");
aps.adScriptsLoaded=true
}else{aps._testAsyncStatus()
}if(aps.adScriptsLoaded==true){aps.logInfo("ScriptLoadChecking complete : "+b+" iterations");
aps.performanceMetrics.ThirdPartyScriptsLoaded=aps.getTimeElapsed();
window.clearInterval(c.loadCheck);
aps.fireEvent(aps.event.on_third_party_complete);
googletag.cmd.push(function(){aps.unQueueCommands()
})
}else{b++;
setTimeout(c.loadCheck,50)
}};
setTimeout(c.loadCheck,50)
};
aps.queueScriptAsync=function(d,e,c,a){var b={name:d,scriptID:null,path:e,testFunction:null,complete:false,loadstart:null,loadend:null,appCallback:a,requiredForGPT:c};
aps.adScripts[d]=b;
aps.queuedScriptCount++;
aps.queuedWaitCount++;
if(c){aps.requiredGPTScriptCount++
}if(aps.scriptLoaderStarted){aps.queueAsyncScript(b)
}return b
};
aps.queueScriptAsyncID=function(e,c,f,d,a){var b={name:e,scriptID:c,path:f,testFunction:null,complete:false,loadstart:null,loadend:null,appCallback:a,requiredForGPT:d};
aps.adScripts[e]=b;
aps.queuedScriptCount++;
aps.queuedWaitCount++;
if(d){aps.requiredGPTScriptCount++
}if(aps.scriptLoaderStarted){aps.queueAsyncScript(b)
}return b
};
aps.queueWaitFunction=function(b,c){var a={name:b,scriptID:null,path:null,testFunction:c,complete:false,loadstart:null,loadend:null,appCallback:null,requiredForGPT:true};
aps.adScripts[b]=a;
aps.queuedWaitCount++;
aps.requiredGPTScriptCount++;
if(aps.scriptLoaderStarted){aps.queueAsyncScript(a)
}return a
};
aps._loadScript2=function(a){var c=a.path;
if(!c||!(typeof c==="string")){return
}var b=document.createElement("script");
b.type="text/javascript";
b.async=true;
if(a.scriptID!=null){b.id=a.scriptID
}if(b.addEventListener){b.addEventListener("load",function(){try{a.callback.apply(a)
}catch(d){aps.logException("_loadScript2",d)
}if(a.appCallback!=null){a.appCallback.apply(a)
}},false)
}else{b.onreadystatechange=function(){if(b.readyState in {loaded:1,complete:1}){b.onreadystatechange=null;
console.log(oCallback);
try{a.callback.apply(a)
}catch(d){aps.logException("_loadScript2",d)
}if(a.appCallback!=null){a.appCallback.apply(a)
}}}
}b.src=c;
document.getElementsByTagName("head")[0].appendChild(b)
}
})();(function(){if(document.location.hostname.match(/((homeguides|smallbusiness|work|healthyeating|livehealthy)\.(chron|sfgate)\.com)/)){if(document.cookie.split(";").filter(function(a){return a.indexOf("region=EU")>=0
}).length==1){aps.logInfo("region EU detected, disabling personalized ads");
aps.cfg.disablePersonalisation=true;
if(document.location.href.indexOf("gdpr=true")>-1){aps.cfg.bid.enableGDPR=true
}}}else{if(document.location.href.indexOf("?is_eu=1")>-1){aps.logInfo("region EU (test) detected, disabling personalized ads");
aps.cfg.disablePersonalisation=true
}}})();(function(){var b=this;
b.StripAndPreserveQuerystringVars=function(e,d){if(typeof(e)=="undefined"){return""
}var c=e.split("&");
var f=[];
c.forEach(function(g){g=g.split("=");
if(d.indexOf(g[0])!=-1){f.push(g[0]+"="+g[1])
}});
if(f.length>0){return"?"+f.join("&")
}return""
};
b.setPageTargettedUrl=function(d,c,f){var g=c.split("?");
var e="";
if(f.length==0){e=g[0]
}else{e=g[0]+b.StripAndPreserveQuerystringVars(g[1],f)
}aps.gcontext.pubads().setTargeting(d,e);
aps.logInfo("page kvp: "+d+"="+e)
};
b.setPageTargettedUrl("PageUrl",JuicePageUrl,["Testpage","Cmpid","Ipid"]);
var a=document.referrer.replace(/^(http(?:s)?:\/\/)/,"").split("/")[0];
b.setPageTargettedUrl("referrer",a,[])
})();(function(){var b=this;
b.aps=aps;
b.refreshed=[];
b.codeFromSlot=function(d){for(var c in aps.slotsByDivID){if(aps.slotsByDivID.hasOwnProperty(c)){if(aps.slotsByDivID[c]==d){return aps.codesByDomID[c]
}}}return"undefined"
};
b.setSlotTargeting=function(h,c){var g=(typeof(b.refreshed[c])=="undefined")?"":"_R";
var f="";
if(aps.faceBookInstantArticle){aps.page_type2="instant article"
}else{if(typeof(aps.topWindow.omni_SSVariant)!="undefined"){f="_"+aps.topWindow.omni_SSVariant
}try{aps.page_type2=b.getOmniContentType()
}catch(d){}}h.setTargeting("page_type2",aps.page_type2);
h.setTargeting("page_type3",c+"_"+aps.page_type2+f+g);
b.refreshed[c]=true
};
aps.registerEvent(aps.event.on_before_display_ad,function(d){if(aps.isIFrameDynamicPage&&aps.scriptName=="googleSync"){b.setSlotTargeting(aps.cfg.stp[aps.cfg.stp.at].ads[0],b.codeFromSlot(aps.cfg.stp[aps.cfg.stp.at].ads[0]))
}else{var c=d.adDefinition;
var e=d.slot;
if(typeof(d.slot)!="undefined"){b.setSlotTargeting(e,c.code)
}}});
aps.registerEvent(aps.event.on_before_refresh_ad,function(c){b.setSlotTargeting(c.slot,b.codeFromSlot(c.slot))
});
b.getOmniContentType=function(){if(typeof(aps.topWindow.s)!="undefined"){if(typeof(aps.topWindow.s.prop24)!="undefined"){return aps.topWindow.s.prop24
}}if(typeof(aps.topWindow.ess)!="undefined"){if(typeof(aps.topWindow.ess.prop24)!="undefined"){return aps.topWindow.ess.prop24
}}if(typeof(top.aps.awOmniContentType)=="undefined"){if(typeof(top.omni_blogname)!="undefined"){top.aps.awOmniContentType=b._getBlogOmniType()
}else{top.aps.awOmniContentType=b._getWCMOmniContentType()
}}return top.aps.awOmniContentType
};
b.getQueryParam=function(c){c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var d=new RegExp("[\\?&]"+c+"=([^&#]*)"),e=d.exec(top.location.search);
return e==null?"":decodeURIComponent(e[1].replace(/\+/g," "))
};
b._getWCMOmniContentType=function(){if(window.location.href.indexOf("cmfThirdParty")<0){b.awOmniPagename="";
b.awOmniPagetitle="";
b.awOmniChannel;
b.awOmniHier1;
b.awOmniServer=top.document.location.host;
b.awOmniSSL1;
b.awOmniSSL2;
b.awOmniSSL3;
b.awOmniSSL4;
b.awOmniNumResults;
b.awOmniSearchTerms;
b.awOmniPrintContent="online";
b.awOmniAuthorTitle="";
b.awOmniPubDate;
b.awOmniTitle="";
b.awOmniID="";
b.awOmniContentType="";
b.awOmniAuthor="";
b.awOmniDaysSincePub;
b.awOmniQuery="";
b.awOmniDomain;
b.awOmniHeadline="";
b.awOmniPageNumber="";
b.awOmniPremiumStatus="";
b.awOmniPremiumAuthStatus="";
b.awOmniPremiumEndDate="";
b.awOmniPubSource="";
b.awOmniBoolPremiumEvent=false;
b.awOmniFullURL=top.document.URL.toLowerCase();
b.awStrRelativePath;
b.awStrPageURL="";
b.awStrChannelPath;
b.awStrPageFile;
b.awStrVertical;
b.awControllerName=getQueryParam("controllerName").toLowerCase();
b.awStrGAAcct2="";
b.awBoolIs404=false;
b.awGetDomainName=function(f){var e=f.match(/:\/\/(.[^/]+)/)[1].replace("www.","").split(".");
return e[0]
};
b.awParseURL=function(){var j=awOmniFullURL;
var i;
var f;
var g=j.indexOf("?")+1;
var h=j.indexOf(".com")+5;
var e=new Array;
awOmniDomain=j.substr(0,h);
if(g>0){awOmniQuery=j.substring(g);
awStrRelativePath=j.substring(0,g-1)
}else{awStrRelativePath=j
}awStrPageURL=awStrRelativePath;
awStrRelativePath=awStrRelativePath.substr(h);
if(typeof b.s_mainDomain=="undefined"){if(location.hostname.split(".").length>2){b.s_mainDomain=top.location.protocol+"//www."+location.hostname.split(".")[1]+"."+location.hostname.split(".")[2]+"/"
}else{b.s_mainDomain=top.location.protocol+"//"+top.location.hostname+"/"
}}i=awGetDomainName(awOmniDomain);
if(i!==awGetDomainName(s_mainDomain)){awStrRelativePath=i+"/"+awStrRelativePath
}f=awStrRelativePath.indexOf(".")==-1;
if(f){if(i!=="29-95"||awStrRelativePath.indexOf("/comic/")==-1&&awStrRelativePath.indexOf("/story/")==-1&&awStrRelativePath.indexOf("/photo/")==-1){if(awStrRelativePath.charAt(awStrRelativePath.length-1)!=="/"){awStrRelativePath+="/"
}if(awOmniDomain==s_mainDomain&&(awStrRelativePath=="home/"||awStrRelativePath.length==1)){awStrRelativePath="home"
}else{awStrRelativePath+="index"
}}}e=awStrRelativePath.split("/");
awStrChannelPath=e[0];
if(awStrChannelPath.indexOf(".")!==-1){awStrChannelPath="home"
}for(z=0;
z1){awStrPageFile=e[e.length-2]+":"+awStrPageFile
}awOmniPagename=awOmniPagename=="home"?"HomePage":awOmniPagename;
awOmniPagetitle=awOmniPagename=="HomePage"?"HomePage":awStrPageFile;
return awOmniPagename
};
b.omni_categorize=function(h){if(typeof h!="undefined"){var g,f;
var e=new Array;
h=h.toLowerCase();
e=h.split(" :: ");
f=e.length;
awOmniSSL1=awOmniChannel=awOmniSSL2=awOmniSSL3=awOmniSSL4=e[0];
if(f>1){awOmniSSL2=awOmniSSL3=awOmniSSL4=awOmniSSL1+":"+e[1]
}if(f>2){awOmniSSL3=awOmniSSL4=awOmniSSL2+":"+e[2]
}if(f>3){awOmniSSL4=awOmniSSL3+":"+e[3]
}awOmniHier1=awOmniSSL4.replace(/:/g,",");
if(f>4){for(g=4;
g1){return e.toLowerCase().replace(/^(.)|\s(.)/g,function(f){return f.toUpperCase()
})
}}};
b.processByLine=function(f){var e=f;
if(e.length>2){if(e.substr(0,3).toUpperCase()=="BY "){e=e.substr(3)
}}return toProperCase(e)
};
b.linkTrack=function(h,e,f){try{s_hdn.linkTrackVars="campaign";
s_hdn.campaign=e;
if(typeof f=="undefined"){s_hdn.tl(h,"o")
}else{s_hdn.tl(h,"o",f)
}}catch(g){if(b.console!=undefined){console.log(g)
}}};
awParseURL();
if(typeof omni_bizObjectId!="undefined"){awOmniID=omni_bizObjectId
}if(typeof omni_authorName!="undefined"){awOmniAuthor=processByLine(omni_authorName)
}if(typeof omni_authorTitle!="undefined"){awOmniAuthorTitle=omni_authorTitle.toLowerCase().indexOf("associated press")>-1?"AP":omni_authorTitle
}if(typeof omni_publicationDate!="undefined"){awOmniPubDate=omni_publicationDate;
var d=new Date;
var c=new Date(awOmniPubDate.replace(/-/g,"/"));
awOmniDaysSincePub=Math.ceil((d.getTime()-c.getTime())/(1000*60*60*24))
}if(typeof omni_title!="undefined"){awOmniTitle=omni_title
}else{if(typeof omni_blogposttitle!="undefined"){awOmniTitle=omni_blogposttitle
}else{if(awOmniPagetitle.length>0){awOmniTitle=awOmniPagetitle
}}}if(typeof omni_breakingNewsFlag!="undefined"&&typeof omni_localNewsFlag!="undefined"){if(omni_breakingNewsFlag!="1"&&omni_localNewsFlag=="1"){awOmniPrintContent="print"
}}if(typeof omni_channelPath!="undefined"){awStrChannelPath=omni_channelPath.toLowerCase();
if(awStrChannelPath=="local :: sound publishing"){awStrGAAcct2="UA-52608-55"
}}if(typeof omni_className!="undefined"){awOmniContentType=omni_className
}else{if(awControllerName.length>0){awOmniContentType=awControllerName
}else{if(awOmniTitle.toLowerCase()=="page not found"){awOmniContentType="page not found"
}else{if(awOmniQuery.substring(0,2)=="s\x3d"){awOmniContentType="search"
}}}}if(typeof omni_premiumStatus!="undefined"){awOmniPremiumStatus=omni_premiumStatus;
awOmniBoolPremiumEvent=true
}if(typeof omni_premiumEndDate!="undefined"){awOmniPremiumEndDate=omni_premiumEndDate
}if(typeof omni_sourceSite!="undefined"){awOmniPubSource=omni_sourceSite
}if(typeof omni_paywallSite!="undefined"){awOmniPremiumAuthStatus="Logged Out";
if(typeof edbTokens!=="undefined"&&edbTokens.productToken!==null){awOmniPremiumAuthStatus="Logged In"
}}switch(awOmniContentType){case"article":if(awOmniFullURL.toLowerCase().indexOf("articlegallery")!==-1){awOmniPageNumber="article slideshow photo:1";
awOmniContentType="article slideshow"
}awOmniHeadline=awOmniTitle+(awOmniAuthorTitle.length>0?" - "+awOmniAuthorTitle:"");
break;
case"slideshow":awStrChannelPath=awStrChannelPath.length>0?awStrChannelPath+" :: "+awOmniContentType:awOmniContentType;
break;
case"collection":awStrChannelPath=awStrChannelPath.length>0?awStrChannelPath+" :: "+awOmniContentType:awOmniContentType;
break;
case"search":awOmniNumResults=0;
awOmniSearchTerms=Bootstrapper.getQueryParam("query");
if(!awOmniSearchTerms){awOmniSearchTerms=Bootstrapper.getQueryParam("s")
}if(awOmniSearchTerms){awOmniSearchTerms="searchbox:kwd:"+awOmniSearchTerms
}awStrChannelPath="search";
if(Bootstrapper.getQueryParam("channel").length>1){awStrChannelPath+=" :: "+(Bootstrapper.getQueryParam("inlineLink")=="1"?"inline":"searchbox")+" :: "+Bootstrapper.getQueryParam("channel")
}break;
case"video":awStrChannelPath=awStrChannelPath.length>0?awStrChannelPath+" :: "+awOmniContentType:awOmniContentType;
break;
case"page not found":awOmniDaysSincePub="";
awBoolIs404=true;
break;
case"channel":awOmniDaysSincePub="";
if(awOmniPagename=="HomePage"){awOmniContentType="home page"
}break;
default:awOmniContentType="other"
}return awOmniContentType
}else{return"undefined"
}};
b._getBlogOmniType=function(){var p;
var i;
var n;
var r=document.location.host;
var s;
var t;
var u;
var v;
var h;
var w="";
var o="";
var j="Blogs";
var e="";
var q="";
var k;
var g="";
var m="";
var l=document.URL.toLowerCase();
var f="";
var c=new Object;
c.SuperCategory="";
c.Category="";
c.AuthorType="reader";
c.Usage="blog";
c.Section="";
c.Voice="";
var B;
var A="";
var x;
var y;
var d=false;
this.toProperCase=function C(D){if(D!="undefined"){if(D.length>1){return D.toLowerCase().replace(/^(.)|\s(.)/g,function(E){return E.toUpperCase()
})
}}};
if(typeof(omni_blogID)!="undefined"){o=omni_blogID
}if(typeof(omni_blogauthor)!="undefined"){e=C(omni_blogauthor)
}if(typeof(omni_blogauthortype)!="undefined"){c.AuthorType=omni_blogauthortype
}if(typeof(omni_blogposttitle)!="undefined"){d=(omni_blogposttitle.toLowerCase()=="page not found");
w=omni_blogposttitle;
if(w.charAt(w.length-1)==" "){w=w.substr(0,w.length-1)
}}if(typeof(omni_blogname)!="undefined"){g=omni_blogname
}if(typeof(omni_blogcategory2)!="undefined"){c.Category=omni_blogcategory2
}if(c.Category.length>0){if(typeof(omni_blogcategory)!="undefined"){c.SuperCategory=omni_blogcategory
}}else{if(typeof(omni_blogcategory)!="undefined"){c.Category=omni_blogcategory
}}if(typeof(omni_blogusage)!="undefined"){c.Usage=omni_blogusage
}if(typeof(omni_section)!="undefined"){c.Section=omni_section
}if(typeof(omni_voices)!="undefined"){c.Voice=omni_voices
}this.abParseURL=function(){var G=l;
if(G.indexOf("#")>-1){G=G.split("#")[0]
}var E=G.indexOf("?")+1;
var F=G.indexOf(".com")+5;
k=G.substr(0,F);
if(E>0){q=G.substring(E);
B=G.substring(0,E-1)
}else{B=G
}A=B;
B=B.substr(F);
if(B.charAt(B.length-1)=="/"){B=B.substr(0,B.length-1)
}var D=new Array();
D=B.split("/");
x=D[0];
y=D[D.length-1];
if(x==y){y="index"
}if(top.document.location.hostname=="insidescoopsf.sfgate.com"){x="insidescoop"
}return x+":"+y
};
this.abAssignSections=function(){if(c.SuperCategory.length>0){i=c.SuperCategory;
s=c.SuperCategory;
t=s+":"+c.Category;
u=t+":blogs";
v=u+":"+g.toLowerCase()
}else{i=c.Category;
s=c.Category;
t=s+":blogs";
u=t+":"+g.toLowerCase();
v=u;
if(c.Voice.length>0){v=v+":"+c.Voice.toLowerCase()
}}n=v.replace(/:/g,",")
};
p="Blogs-"+abParseURL();
if(c.Category==""){abCategorizeBlog(x,c)
}abAssignSections();
if(w==""||w==g){w="Blog index page"
}if(c.Section.length>0){g=g+":"+c.Section
}w=g+":"+w;
o=g+"--"+o;
h=c.AuthorType;
g=g+"("+c.AuthorType+")";
w=w+"("+c.AuthorType+")";
w=w.replace(/'/g,"");
m=w;
if(e){if(e.indexOf(",")!=-1){e=e.substring(0,e.indexOf(","))
}}if(d){return"undefined"
}else{return j
}};
aps.page_type2="undefined";
if(aps.faceBookInstantArticle){aps.page_type2="instant article"
}else{try{aps.page_type2=b.getOmniContentType()
}catch(a){}}aps.performanceMetrics.page_type2=aps.page_type2;
aps.logInfo("page_type2: "+aps.page_type2)
})();(function(){if(document.location.pathname.toLowerCase().indexOf("were-you-seen")>-1){aps.gcontext.pubads().setTargeting("type","seen");
aps.logInfo("page kvp: type: seen")
}})();(function(){if(APSpageUrl){if(APSpageUrl.indexOf("staging.richie")==0||APSpageUrl.indexOf("richie")==0||APSpageUrl.indexOf("papp")==0){aps.logInfo("Richie app: disabling bidders");
aps.cfg.bid.enabled=false;
aps.cfg.excludeModules=["nlp","ab_testing","blueconic","PublisherProvidedId"]
}}})();(function(){aps.registerEvent(aps.event.on_dom_loaded,function(a){var b=aps.getQueryParameterByName("juiceconsole");
if(b!=null){setTimeout(function(){var c=document.createElement("script");
c.src="//mis.hearstnp.com/juice/Bookmarklets/debug.js"+"?bustcache="+new Date().getTime();
document.body.appendChild(c)
},parseInt(b,10))
}})
})();(function(){aps.specifiedAdSlots={};
aps.usingSelectiveAdSlotLoading=false;
aps.selectiveAdSlotCookieName="Ju13ceSelectiveAdsList";
aps.shouldPlaceAd=function(c){if(!aps.usingSelectiveAdSlotLoading){return true
}return(typeof(aps.specifiedAdSlots[c])!="undefined")
};
aps.saveSelectiveLoadingAdSlotList=function(){var c=[aps.selectiveAdSlotCookieName,"=",JSON.stringify(aps.specifiedAdSlots),"; domain=.",window.location.host.toString(),"; path=/;"].join("");
document.cookie=c
};
aps.clearSelectiveLoadingAdSlots=function(){aps.specifiedAdSlots={};
aps.saveSelectiveLoadingAdSlotList()
};
aps.addSlotToSelectiveLoadingList=function(c){aps.specifiedAdSlots[c]=true;
aps.saveSelectiveLoadingAdSlotList()
};
aps.removeSlotFromSelectiveLoadingList=function(c){if(typeof(aps.specifiedAdSlots[c])!="undefined"){delete aps.specifiedAdSlots[c];
aps.saveSelectiveLoadingAdSlotList()
}};
var b=aps.getQueryParameterByName("sadslot[]");
if(b!=null){aps.usingSelectiveAdSlotLoading=true;
for(var a=0;
a-1){return false
}if(!aps.usingSelective3rdLoading){return true
}return(typeof(aps.specified3rdParties[c])!="undefined")
};
aps.add3rdToSelectiveLoadingList=function(c){aps.specified3rdParties[c]=true
};
var a=aps.getQueryParameterByName("sad3rd[]");
if(a!=null){aps.usingSelective3rdLoading=true;
for(var b=0;
b2&&d[f][e]===g)){return true
}}return false
};
var c=function(d,e,g){var f=d.length;
while(f--){if(d[f]&&d[f].hasOwnProperty(e)&&(arguments.length>2&&d[f][e]===g)){d.splice(f,1)
}}return d
};
if(!a(definedTags.kvps,"key","news10")){if(!b()){return
}else{aps.logInfo("news 1.0 detected via meta tag")
}}else{aps.logInfo("news 1.0 detected via kvp")
}aps.registerEvent(aps.event.on_init_ad_definition,function(d){switch(d.adDefinition.code){case"OOP":case"MAD":case"A300":case"B300":case"S300":d.adDefinition.interstitial=true;
aps.logInfo(d.adDefinition.code+" marked as interstitial");
break
}})
})();(function(){if(aps.cfg.bid.current_device==MOBILE){if(aps.cfg.bid.pb.disabledOnMobile.indexOf("a9")>-1){aps.logInfo("a9 disabled on mobile devices");
return
}}if(aps.shouldRunThirdParty("a9")&&aps.cfg.bid.enabled&&aps.current_domain!="greenstate.com"){!function(d,b,f,i,j,c,e){if(b[d]){return
}function h(a,g){b[d]._Q.push([a,g])
}b[d]={init:function(){h("i",arguments)
},fetchBids:function(){h("f",arguments)
},setDisplayBids:function(){},_Q:[]};
c=f.createElement(i);
c.async=!0;
c.src=j;
e=f.getElementsByTagName(i)[0];
e.parentNode.insertBefore(c,e)
}("apstag",window,document,"script","https://c.amazon-adsystem.com/aax2/apstag.js");
if(aps.cfg.bid.excludedDomains.indexOf(aps.current_domain)>-1){aps.logInfo("Domain excluded from bidders (A9): "+aps.current_domain)
}else{if(aps.cfg.disablePersonalisation&&!aps.cfg.bid.enableGDPR){return
}aps.cfg.bid.a9.partners["1ayvuv4"]="AppNexus";
aps.cfg.bid.a9.partners["2kotmo"]="DistrictM";
aps.cfg.bid.a9.partners["1gqg3k"]="Oath";
aps.cfg.bid.a9.partners["bgbtvk"]="OpenX";
aps.cfg.bid.a9.partners["1m2fm68"]="Pubmatic";
aps.cfg.bid.a9.partners["t7ludc"]="Rubicon";
aps.cfg.bid.a9.config.pubID="3070";
aps.cfg.bid.a9.config.adServer="googletag";
aps.cfg.bid.a9.config.bidTimeout=aps.cfg.stp.def.timeout||2500;
aps.cfg.bid.a9.apstag=apstag;
aps.cfg.bid.a9.checkInitCalled=function(){if(!aps.cfg.bid.a9.initCalled){aps.cfg.bid.a9.initCalled=true;
aps.logInfo("init A9");
apstag.init(aps.cfg.bid.a9.config)
}};
if(aps.current_domain=="gametimect.com"){aps.cfg.bid.a9.config.blockedBidders=["1m2fm68","bgbtvk","1ayvuv4","t7ludc","1sq5vcw","2kotmo","1238um8","kbyu4g","1juiv40","fw5c00","1fepczk","xnfchs","1x5zdhc","70ibr4","16j2cqo","orsc8w","1oacd8g","acdgcg","19uxhc0","s3ngu8","1rm7hts","1gqg3k"]
}aps.registerEvent(aps.event.on_before_refresh_ads,function(a){aps.logInfo("A9 updateSlotsKVPs");
aps.startThirdPartyRefresh("A9");
aps.logInfo("Start A9 refresh");
aps.cfg.stp[aps.cfg.stp.at].a9.bidsReceived=false;
apstag.fetchBids({slots:aps.cfg.bid.a9.adUnits,timeout:aps.cfg.stp[aps.cfg.stp.at].timeout},function(b){var c=googletag.pubads().getSlots();
aps.cfg.bid.a9.handleDisplayBids(b,c)
});
aps.stopThirdPartyRefresh("A9")
});
aps.registerEvent(aps.event.on_end_define_tags,function(a){aps.cfg.bid.a9.adUnits[aps.cfg.stp.at]=aps.cfg.bid.a9.buildAdSlots(a.slots);
aps.cfg.bid.a9.getDisplayBids(aps.cfg.bid.a9.adUnits[aps.cfg.stp.at]);
if(aps.cfg.bid.a9.videoAdUnits.length==0){aps.cfg.bid.a9.videoAdUnits=aps.cfg.bid.a9.buildDisplaySlots(a.slots);
aps.cfg.bid.a9.getVideoBids()
}});
googletag.cmd.push(function(){googletag.pubads().addEventListener("slotRenderEnded",function(a){var b=aps.cfg.bid.a9.keySlots(googletag.pubads().getSlots());
var c=b[a.slot.getSlotElementId()];
if(c.J){if(c.J.advertiserId==46328242){aps.logInfo("*** "+c.j.m+" WIN A9")
}}["amznbid","amzniid"].forEach(function(d){c.setTargeting(d,"")
})
})
});
aps.cfg.bid.a9.keySlots=function(a){return a.reduce(function(b,c){var d=c.getSlotElementId();
b[d]=c;
return b
},{})
};
aps.cfg.bid.a9.handleDisplayBids=function(a,b){aps.logInfo("A9 bids received");
aps.cfg.stp[aps.cfg.stp.at].a9.bidsReceived=true;
googletag.cmd.push(function(){apstag.setDisplayBids();
var c=aps.cfg.bid.a9.keySlots(b);
a.forEach(function(d){if(c[d.slotID]&&d.amznbid!="2"){aps.logInfo("BID: "+d.slotID+" A9/"+(aps.cfg.bid.a9.partners[d.amznp]||"A9")+":"+d.amznbid);
aps.cfg.bid.a9.bids.push({slotid:d.slotID,bid:d.amznbid,bidder:aps.cfg.bid.a9.partners[d.amznp]||"A9"})
}})
});
if(aps.cfg.stp[aps.cfg.stp.at].pb.biddersDone>=(aps.cfg.bid.pb.biddersCount-aps.cfg.bid.lessBidder)){aps.logInfo("all bids received");
aps.enableGoogleServices(0)
}};
aps.cfg.bid.a9.buildAdSlots=function(d){var c=[];
for(var e in d){var a=aps.definedTagArr[e];
if(a.batchRequest!="requested"){continue
}if(aps.cfg.bid.a9.excludedSlots.indexOf(a.code)>-1||aps.cfg.bid.excludedSlots.indexOf(a.code)>-1){aps.logInfo("A9: Skipping "+a.code);
continue
}if(!a.video){var b={};
b.slotID=a.code;
b.slotName="/"+definedTags.networkCode+"/"+definedTags.adUnit+"/"+a.code;
b.sizes=aps.setAdSize(a);
if(b.sizes.length>0){c.push(b)
}}}return c
};
aps.cfg.bid.a9.getDisplayBids=function(a){if(aps.cfg.disablePersonalisation&&!aps.cfg.bid.enableGDPR){return
}if(!(aps.cfg.bid.disableMobile&&(aps.current_domain.indexOf("m.")==0))){aps.a9Requesting=a;
aps.cfg.stp[aps.cfg.stp.at].a9.bidsReceived=false;
googletag.cmd.push(function(){aps.cfg.bid.a9.checkInitCalled();
aps.logInfo("calling A9 display");
apstag.fetchBids({slots:aps.a9Requesting,timeout:aps.cfg.bid.a9.config.bidTimeout},function(b){var c=googletag.pubads().getSlots();
aps.cfg.bid.a9.handleDisplayBids(b,c)
})
})
}};
aps.cfg.bid.a9.buildDisplaySlots=function(d){var c=[];
for(var a=0;
a0){googletag.cmd.push(function(){aps.cfg.bid.a9.checkInitCalled();
aps.logInfo("calling A9 video");
apstag.fetchBids({slots:aps.cfg.bid.a9.videoAdUnits,timeout:aps.cfg.bid.a9.config.bidTimeout},function(a){aps.cfg.bid.a9.handleVideoBids(a)
})
})
}};
aps.cfg.bid.a9.handleVideoBids=function(a){aps.logInfo("A9 video bid received: "+a.length);
if(a.length>0){aps.cfg.vid.tagUrl+=a[0].qsParams;
aps.logInfo("A9 video "+aps.cfg.bid.a9.partners[a[0].amznp]||"A9"+" "+a[0].qsParams);
aps.cfg.bid.a9.bids.push({slotid:a[0].slotID,bid:a[0].amznbid,bidder:aps.cfg.bid.a9.partners[a[0].amznp]||"A9"})
}};
aps.registerEvent(aps.event.on_request_new_video_ads,function(){aps.cfg.bid.a9.getVideoBids()
})
}}})();(function(){aps.registerEvent(aps.event.on_before_enable_google_services,function(c){var a=!1;
if(aps.current_domain=="expressnews.com"||aps.current_domain=="houstonchronicle.com"){try{if(GetCookie("hrstctok")!=null){a=1
}}catch(b){}}else{if(aps.current_domain=="sfchronicle.com"){try{if(JSON.parse(sessionStorage.getItem("sync-subscriberPlans-status"))["hasActivePlans"]==true){a=1
}}catch(b){}}}if(a){googletag.cmd.push(function(){aps.logInfo("user authenticated");
googletag.pubads().setTargeting("category","premuser")
})
}})
})();(function(){var a="";
switch(aps.current_domain){case"houstonchronicle.com":case"chron.com":a="hou";
break;
case"expressnews.com":case"mysanantonio.com.com":a="sa";
break;
case"sfchronicle.com":case"sfgate.com":a="sf";
break;
case"timesunion.com":a="tu";
break;
default:return;
break
}aps.registerEvent(aps.event.on_before_enable_google_services,function(h){var d=false;
var l=false;
var j=[];
try{if(typeof(localStorage)!=undefined){var f=JSON.parse(localStorage.getItem("hnp_subs"));
var b=1;
var e=null;
if(f!=null){for(var g in f){if(f.hasOwnProperty(g)){e=f[g];
if(e.hasOwnProperty("sub_status_"+b)){var i=a;
if(e["sub_status_"+b]=="Active"){i=i+"_a_"
}else{i=i+"_ex_"
}i=i+e["sub_product_"+b]+"_";
i=i+e["sub_product_code_"+b];
j.push(i)
}}b++
}}}}catch(c){}var k=a+"_na";
if(j.length>=1){k=j.join(",")
}googletag.cmd.push(function(){aps.logInfo("swgt = "+k);
googletag.pubads().setTargeting("swgt",k)
})
})
})();(function(){window.onHearstLogBadScript=function(c,a){window.bad_scripts=window.bad_scripts||[];
var b=c.split(" ")[0];
window.bad_scripts.push(b);
console.log("Script with a problem: "+b);
console.log("line nuember: "+a)
}
})();!function(){var b=function(Q,S){function U(c,d){return c<>>32-d
}function W(h,i){var j,k,l,m,n;
return l=2147483648&h,m=2147483648&i,j=1073741824&h,k=1073741824&i,n=(1073741823&h)+(1073741823&i),j&k?2147483648^n^l^m:j|k?1073741824&n?3221225472^n^l^m:1073741824^n^l^m:n^l^m
}function Y(d,e,f){return d&e|~d&f
}function aa(d,e,f){return d&f|e&~f
}function ac(d,e,f){return d^e^f
}function ae(d,e,f){return e^(d|~f)
}function ag(c,d,e,k,l,m,n){return c=W(c,W(W(Y(d,e,k),l),n)),W(U(c,m),d)
}function ai(c,d,f,k,l,m,n){return c=W(c,W(W(aa(d,f,k),l),n)),W(U(c,m),d)
}function ak(c,d,g,k,l,m,n){return c=W(c,W(W(ac(d,g,k),l),n)),W(U(c,m),d)
}function am(c,d,h,k,l,m,n){return c=W(c,W(W(ae(d,h,k),l),n)),W(U(c,m),d)
}function ao(j){for(var k,l=j.length,m=l+8,n=(m-m%64)/64,o=16*(n+1),p=Array(o-1),q=0,r=0;
l>r;
){k=(r-r%4)/4,q=r%4*8,p[k]=p[k]|j.charCodeAt(r)<>>29,p
}function aq(f){var g,h,i="",j="";
for(h=0;
3>=h;
h++){g=f>>>8*h&255,j="0"+g.toString(16),i+=j.substr(j.length-2,2)
}return i
}function at(e){e=e.replace(/\r\n/g,"\n");
for(var f="",g=0;
gh?f+=String.fromCharCode(h):h>127&&2048>h?(f+=String.fromCharCode(h>>6|192),f+=String.fromCharCode(63&h|128)):(f+=String.fromCharCode(h>>12|224),f+=String.fromCharCode(h>>6&63|128),f+=String.fromCharCode(63&h|128))
}return f
}void 0===S&&(S=""),void 0===Q&&(Q=10000000000*Math.random()+"||"+window.location.href+"||"+(new Date).getTime()+"||"+S);
var av,ax,ay,az,aA,aB,aC,aD,aE,aF=Array(),aG=7,R=12,T=17,V=22,X=5,Z=9,ab=14,ad=20,af=4,ah=11,aj=16,al=23,an=6,ap=10,ar=15,au=21;
for(Q=at(Q),aF=ao(Q),aB=1732584193,aC=4023233417,aD=2562383102,aE=271733878,av=0;
av-1){var q=document.cookie.indexOf("=",n);
if(q>0){m=false;
q++;
var o=document.cookie.indexOf(";",q);
o=o>0?o:document.cookie.length;
j=document.cookie.slice(q,o)
}}var l=false,k;
if(m){n=document.cookie.indexOf("_cc_id");
if(n>-1){var r=document.cookie.indexOf("=",n);
if(r>0){l=true;
r++;
var p=document.cookie.indexOf(";",r);
p=p>0?p:document.cookie.length;
k=document.cookie.slice(r,p)
}}}var i="//ad"+j;
i=i+"/5/c="+g+"/pe=y/callback="+h;
if(l){i=i+"/pid="+k
}aps.logInfo("lotame url: "+i);
return i
};
if(b!==""){aps.startThirdParty("lotame");
window.extractPid=function(g){var h=g.Profile.pid;
aps.logInfo("lotame extractPid: "+g.Profile.pid);
googletag.cmd.push(function(){aps.gcontext.pubads().setTargeting("lpid",h)
});
getAudId=function(m,k,l){if(!m){return
}for(var j=0;
j=l){break
}}};
aps.cfg.dfp.lotameIds=[];
getAudId(g.Profile.Audiences.Audience,"lotame",100);
getAudId(g.Profile.Audiences.ThirdPartyAudience,"lotame",100-aps.cfg.dfp.lotameIds.length);
aps.logInfo("lotame: "+aps.cfg.dfp.lotameIds);
googletag.cmd.push(function(){aps.gcontext.pubads().setTargeting("lotame",aps.cfg.dfp.lotameIds)
});
aps.stopThirdParty("lotame")
};
var f=d.get_cc_extr_url(b,"extractPid");
aps.queueScriptAsync("lotame ",f,true,null)
}}})();(function(){if(aps.shouldRunThirdParty("blueconic")){var a=this;
aps.registerEvent(aps.event.on_update_page_level_targeting,function(d){if(typeof localStorage.bcDFPTargetingParams!=="undefined"){aps.logInfo("Blueconic segments detected");
try{var b=window.JSON.parse(localStorage.bcDFPTargetingParams);
if(b[0]["key"]=="audiences"&&b[0]["value"].length>0){aps.gcontext.pubads().setTargeting("bc_audiences",b[0]["value"]);
aps.logInfo("Blueconic data: "+localStorage.bcDFPTargetingParams)
}else{aps.logInfo("Empty blueconic segment detected")
}}catch(c){aps.logInfo("error parsing blueconic data")
}}else{aps.logInfo("Blueconic segments not detected")
}})
}})();(function(){if(aps.shouldRunThirdParty("PublisherProvidedId")){googletag.cmd.push(function(){var d="; "+document.cookie;
var c=d.split("; BCSessionID=");
if(c.length==2){var b=c.pop().split(";").shift();
var a=aps.codec.hex.fromBits(aps.hash.sha256.hash(b));
aps.logInfo("PublisherProvidedId: "+b+" hash: "+a);
googletag.pubads().setPublisherProvidedId(a)
}else{aps.logInfo("PublisherProvidedId: BCSessionID not detected")
}})
}})();(function(){if(aps.shouldRunThirdParty("nlp")){aps.getHDNnlpWithId=function(f,d){var e=[];
try{var a=HDN.dataLayer.content["keyNlp"+f];
for(var c=0;
c0){d.push(k)
}k=aps.getHDNnlpWithId("Event","e");
if(k.length>0){d.push(k)
}k=aps.getHDNnlpWithId("Location","l");
if(k.length>0){d.push(k)
}k=aps.getHDNnlpWithId("Organization","o");
if(k.length>0){d.push(k)
}k=aps.getHDNnlpWithId("Person","p");
if(k.length>0){d.push(k)
}k=aps.getHDNnlpWithId("Unknown","u");
if(k.length>0){d.push(k)
}k=aps.getHDNnlpWithId("WorkOfArt","w");
if(k.length>0){d.push(k)
}aps.gcontext.pubads().setTargeting("nlp_entities",d);
aps.logInfo("nlp_entities: "+d.toString())
}catch(e){aps.logInfo("nlp_categories: exception")
}})
}})();(function(){if(aps.shouldRunThirdParty("perf_sec")){var a=this;
a.getWCMPath=function(){if(typeof window.omni_channelPath=="undefined"){return null
}var c=window.omni_channelPath.toLowerCase();
c=c.replace(new RegExp(" :: ","g"),":");
var b=(window.location.search.indexOf("articleComments")!==-1);
if(omni_className=="article"||omni_className=="slideshow"){c=c+":"+omni_className;
if(b){c=c+" comments"
}}return c
};
a.getGSAPath=function(){if(window.location.search.indexOf("/search/")!==-1){return"search"
}return null
};
a.getWordpressPath=function(){if(typeof window.omni_blogname=="undefined"){return null
}var b=window.omni_blogcategory.toLowerCase();
if(typeof window.omni_blogcategory2!="undefined"){if(window.omni_blogcategory2!=""){b=b+":blog:"+window.omni_blogcategory2
}}b=b+":"+window.omni_blogname;
return b
};
aps.startThirdParty("perf_sec");
aps.queueWaitFunction("perf_sec_check",function(){var b=null;
b=a.getWCMPath();
b=(b!=null)?b:a.getGSAPath();
b=(b!=null)?b:a.getWordpressPath();
if(b!=null){aps.perf_sec=b;
googletag.cmd.push(function(){aps.logInfo("perf_sec: "+b);
googletag.pubads().setTargeting("perf_sec",b)
});
aps.stopThirdParty("perf_sec")
}return(b!=null)
})
}})();(function(){if(aps.shouldRunThirdParty("ab_testing")){var a=this;
a.setNPABTEST=function(){if(aps.hasOwnProperty("abtest")){googletag.cmd.push(function(){aps.logInfo("npabtest : "+aps.abtest);
googletag.pubads().setTargeting("ab",aps.abtest)
})
}else{aps.logInfo("npabtest not detected.")
}};
aps.setNPABTEST=a.setNPABTEST;
aps.registerEvent(aps.event.on_before_enable_google_services,function(b){a.setNPABTEST()
})
}})();(function () {
/* prebid.js v1.23.0
Updated : 2018-09-05 */
!(function(u){var s=window.pbjsChunk;window.pbjsChunk=function(e,t,n){for(var r,i,o,a=0,d=[];a