if("undefined"!=typeof Storage){var e=localStorage.getItem("bcDFPTargetingParams");if(e)var t=JSON.parse(e),a=setInterval(function(){void 0!==window.googletag&&window.googletag.pubads&&(clearInterval(a),jQuery.each(t,function(e,t){window.googletag.pubads().setTargeting(t.key,t.value)}))},100)}var contextCampaign="";$.ajaxSetup({timeout:2e3});var jqxhr=$.get("https://contextual-function-apps.azurewebsites.net/api/PageAnalyzer_TAPURLMatch?code=1cPi4sMLz2FEHYI06DVVuPeDb0CCbn0qa0lKUPKQJf3GLX2GoNqP9A==&url="+window.location.href,function(e,t,a){(contextCampaign=e.replace(/"/g,"")).length>0&&googletag.cmd.push(function(){googletag.pubads().setTargeting("ct",contextCampaign),console.log("CONTEXTUAL TARGETING SET")}),console.log("C: "+e)}),isbot="";function getCookie(e){var t=("; "+document.cookie).split("; "+e+"=");if(2==t.length)return t.pop().split(";").shift()}function setCookie(e,t,a){var o=new Date;o.setTime(o.getTime()+864e5*a);var s="expires="+o.toUTCString();document.cookie=e+"="+t+";"+s+";path=/"}if(void 0!==getCookie("HSPVerifiedV5"))"0"===getCookie("HSPVerifiedV5")?isbot="0":"1"===getCookie("HSPVerifiedV5")&&(isbot="1");else{let o=new XMLHttpRequest;var s=navigator.userAgent,n=window.location.href,i=document.referrer;o.open("GET","https://bot-detection-function-app.azurewebsites.net/api/AnalyzeTraffic?code=VDCkYwLVtTtK4PltpW5XCQkvS53sWa0SqiyOdX6HPmsv/UaY8xFmlg==&referrer="+i+"&url="+n+"&ua="+s,!1),o.send(),200==o.status?setCookie("HSPVerifiedV5",isbot=o.response,6):setCookie("HSPVerifiedV5",isbot="1",.04166666)}function getQueryVariable(e){for(var t=window.location.search.substring(1).split("&"),a=0;a<t.length;a++){var o=t[a].split("=");if(o[0]==e)return o[1]}return!1}function setPageTargeting(){var e=location.pathname.substring(1);""==e&&(e="/");var t=location.hostname,a=getQueryVariable("segCode"),o="";document.querySelector('meta[name="specialty"]')&&(o=document.querySelector('meta[name="specialty"]').content);var s="";document.querySelector('meta[name="urlStem"]')&&(s=document.querySelector('meta[name="urlStem"]').content);var n="";document.querySelector('meta[name="loginStatus"]')&&(n=document.querySelector('meta[name="loginStatus"]').content),window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(function(){googletag.pubads().setTargeting("url",e),googletag.pubads().setTargeting("domain",t),googletag.pubads().setTargeting("isbot",isbot),console.log("Setting standard targeting: URL/DOMAIN/ISBOT"),a&&(googletag.pubads().setTargeting("segcode",a),console.log("Setting segCode targeting")),googletag.pubads().setTargeting("specialty",o),googletag.pubads().setTargeting("clientid",s),googletag.pubads().setTargeting("loginStatus",n),googletag.pubads().enableSingleRequest(),googletag.enableServices()})}function proclivityGAMAdCall(e){var t=!1;return $.ajax({type:"GET",url:"https://email-ads.azurewebsites.net/api/ProclivityAdLookup?code=Rhds_-a0UFv-HgzWhaDE6dTrXpisO9iQndUwadmVZ_QYAzFuOx-qFA==",data:{id:e,pid:"227",s:"(300x250,1),(300x250,1),(728x90,2),(320x50,1),(300x50,1)",u:window.location.href,ua:Navigator.userAgent,sid:"22701"},complete:function(e,a){""!=e.responseText&&(adResponse=JSON.parse(e.responseText)).ads.length>0?(DisplayProclivityAds(),t=!0):StandardAdFallback(),console.log("Proclivity Response: "+e.responseText)}}),t}function get_random(e){return e[Math.floor(Math.random()*e.length)]}var AllAdSlots={ads:[{pageSize:["desktop"],w:728,h:90,isTargeted:!1,GAMslotname:"/56049762/BCM-728x90-Top",divID:"topBanner",templates:["bcm-home","spec-home","spec-condproc","search","content-news","content-video","content-document"]},{pageSize:["mobile"],w:300,h:250,isTargeted:!1,GAMslotname:"/56049762/BCM-300x250-Top",divID:"topBanner",templates:["bcm-home","spec-home","spec-condproc","search","content-news","content-video","content-document"]},{pageSize:["desktop"],w:728,h:90,isTargeted:!1,GAMslotname:"/56049762/BCM-728x90-Middle",divID:"middle1",templates:["bcm-home","search","content-news","content-video"]},{pageSize:["mobile"],w:300,h:250,isTargeted:!1,GAMslotname:"/56049762/BCM-300x250-Middle",divID:"middle1",templates:["bcm-home","search","content-news"]},{pageSize:["desktop"],w:300,h:250,isTargeted:!1,GAMslotname:"/56049762/BCM-300x250-Right",divID:"right1",templates:["spec-home","spec-condproc","content-news"]},{pageSize:["mobile"],w:300,h:250,isTargeted:!1,GAMslotname:"/56049762/BCM-300x250-Right",divID:"right1",templates:["spec-home","spec-condproc","content-news"]},{pageSize:["desktop"],w:728,h:90,isTargeted:!1,GAMslotname:"/56049762/BCM-728x90-Bottom",divID:"bottomBanner",templates:["bcm-home","spec-home","spec-condproc","search","content-video","content-document","content-news"]},{pageSize:["mobile"],w:300,h:250,isTargeted:!1,GAMslotname:"/56049762/BCM-300x250-Bottom",divID:"bottomBanner",templates:["bcm-home","spec-home","spec-condproc","search","content-video","content-document","content-news"]}]},adSlots=[],pageSize=jQuery(window).width()>=768?"desktop":"mobile",pageType=document.querySelector('meta[name="pageType"]').content;adSlots.ads=AllAdSlots.ads.filter(function(e){return e.pageSize.includes(pageSize)&&e.templates.includes(pageType)});var adResponse=[],NPI="",proclivityReturned=!1;setPageTargeting();var profile=blueConicClient.profile.getProfile(),properties=["NPI"];function StandardAdFallback(){(adResponse==[]||null==adResponse.ads||0==adResponse.ads.length)&&(window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(function(){console.log("Proclivity returned 0 ads, falling back to standard DFP ad serving"),googletag.pubads().enableSingleRequest(),googletag.enableServices();for(let e=0;e<adSlots.ads.length;e++)console.log("Standard DFP Call defining slot: "+adSlots.ads[e].GAMslotname+",["+adSlots.ads[e].w+","+adSlots.ads[e].h+"],"+adSlots.ads[e].divID),googletag.defineSlot(adSlots.ads[e].GAMslotname,[adSlots.ads[e].w,adSlots.ads[e].h],adSlots.ads[e].divID).addService(googletag.pubads()).setTargeting("pos",adSlots.ads[e].divID);for(let t=0;t<adSlots.ads.length;t++)console.log("Standard DFP Call: Calling display ad for: "+adSlots.ads[t].divID),$(adSlots.ads[t].divID).show(),googletag.display(adSlots.ads[t].divID)}))}function DisplayProclivityAds(){var e=[];for(let t=0;t<adResponse.ads.length;t++){var a=adResponse.ads[t];console.log("looking for slot for "+a.w+"x"+a.h);for(let o=0;o<adSlots.ads.length;o++)if(!adSlots.ads[o].isTargeted&&adSlots.ads[o].w==a.w&&adSlots.ads[o].h==a.h){console.log("Slot found for "+adSlots.ads[o].GAMslotname),adSlots.ads[o].isTargeted=!0,adSlots.ads[o].asid=a.asid,adSlots.ads[o].cid=adResponse.cid,e.push(adSlots.ads[o]);break}}window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(function(){for(let t=0;t<e.length;t++)console.log("defining slot: "+e[t].GAMslotname+",["+e[t].w+","+e[t].h+"],"+e[t].divID),googletag.defineSlot(e[t].GAMslotname,[e[t].w,e[t].h],e[t].divID).addService(googletag.pubads()).setTargeting("cid",e[t].cid).setTargeting("asid",e[t].asid).setTargeting("segcode","proclivity").setTargeting("pos",e[t].divID),$(e[t].divID).show();googletag.pubads().enableSingleRequest(),googletag.enableServices();for(let a=0;a<e.length;a++)googletag.display(e[a].divID)})}function BCM_AdHelper(){var e=function e(t){var a=[];for(let o=0;o<t.ads.length;o++)for(let s=0;s<t.ads[o].templates.length;s++)a.push(t.ads[o].templates[s]);return a.filter((e,t,a)=>a.indexOf(e)===t)}(AllAdSlots);console.log("THIS PAGE TEMPLATE IS: "+pageType);for(let t=0;t<e.length;t++){var a=[];a.ads=AllAdSlots.ads.filter(function(a){return a.pageSize.includes("desktop")&&a.templates.includes(e[t])}),console.log(e[t]+" DESKTOP uses the following adslots: ");for(let o=0;o<a.ads.length;o++)console.log(a.ads[o].GAMslotname+" in div "+a.ads[o].divID);a.ads=AllAdSlots.ads.filter(function(a){return a.pageSize.includes("mobile")&&a.templates.includes(e[t])}),console.log(e[t]+" MOBILE uses the following adslots: ");for(let s=0;s<a.ads.length;s++)console.log(a.ads[s].GAMslotname+" in div "+a.ads[s].divID)}}profile.loadValues(properties,this,function(){void 0!=profile.getValue("NPI")&&(NPI=profile.getValue("NPI")),proclivityReturned=proclivityGAMAdCall(NPI)});