//Creative template: Webs - 3x3 - Video Player
window.supportsAds = true;

!function(){try{document.getElementsByClassName("right-rail")[0].classList.remove("left-align-children")}catch(e){}}();

//motorola userid3p override
!function(){try{window.adInfo&&window.adInfo.partner&&"motorolawidget"==window.adInfo.partner&&(window.adInfo.userid3p="active")}catch(a){}}();

/*================
 Move top slot on mWeb
==================*/
!function(){try{var e,t,n,a=serverAdsOnPageLite.top.adUnitCode;if(t=document.getElementById("top"),-1!=a.indexOf("country_home")&&-1!=a.indexOf("mweb")&&((e=document.getElementsByClassName("nearby-locations")[0]).parentNode.insertBefore(t,e),t.style.padding="16px 0px 16px 0px",t.style.background="white",n=document.getElementsByClassName("zone-centerWell1")[0],e.parentNode.insertBefore(n,e)),-1!=a.indexOf("local_home")&&-1!=a.indexOf("mweb")&&(e=document.getElementsByClassName("cur-con-weather-card")[0]).parentNode.insertBefore(t,e),-1!=a.indexOf("local_home")&&-1!=a.indexOf("/web")){e=document.getElementsByClassName("sunrise-sunset")[0];var o=document.getElementById("native");e.parentNode.insertBefore(o,e)}}catch(r){}}();

/*================
GAMERA
=================*/
(function() {
	
  let aw_user='',aw_session='',aw_page='',country='',aw_gam_code='',aw_partner='',aw_wx_seg='';
	try{
		if (window.raine && window.raine.pageview){
			aw_user = window.raine.pageview.user.id;
			aw_session = window.raine.pageview.session.id;
			aw_page = window.raine.pageview.page.group;
			aw_gam_code = window.raine.pageview.ads.code;
			country = window.raine.pageview.user.country.toLowerCase();
		}
		if (window.adInfo){
			aw_partner = window.adInfo.partner || 'accuweather';
			aw_wx_seg = window.adInfo.wx_seg || '';
		}
	} catch (e){}
	
	if (country != 'us' || '' == 'true'){
		return;
	}
	window.gamera = window.gamera || {};
	window.gamera.cmd = window.gamera.cmd || [];
	window.gamera.cmd.push(function() {
		window.gamera.addDimensions({
			"aw_site":aw_gam_code.split('/')[2],
			"aw_wxGeo":aw_gam_code.split('/')[3],
			"aw_page":aw_page,
			"aw_partner":aw_partner,
			"aw_wx_seg":aw_wx_seg
	    });
      try{
		window.adInfo.cohort =  window?.gamera?.getOnPageSegments()?.join(",") || window.adInfo.cohort || undefined;
    window.adInfo.iabatax = window?.gamera?.getPrebidSegments()?.user?.data[0]?.segment?.map(a => a.id).join(',') || window.adInfo.iabatax || undefined;
	} catch (e){}	
	});
	const s = document.createElement("script");
	const el = document.getElementsByTagName("script")[0];
	s.setAttribute('id', '__gamera__');
	s.setAttribute('async', 'true');
	s.src = 'https://metrics.rapidedge.io/gamera.js?domain=accuweather.com&ltv=1&tpcs=1';
	el.parentNode.insertBefore(s, el);		
})();

/*================
CONTENT Key-VALUES
=================*/
(function(){	
	if (!window.adInfo){
		return;
	}
	var au = '/6581/web/us/video_player/weather/current';
	
	window.adInfo.content = window.adInfo.content || '';
	var addtokv = function(prop){
		if (window.adInfo.content != ''){
			window.adInfo.content += ",";
		}
		window.adInfo.content += prop;
	};
	
	try{
		
		const urlParams = new URLSearchParams(window.location.search);
	
		//"name" from the allergies pages
		if (au.indexOf('allergies') != -1){
			if (urlParams.get('name')){ 
				addtokv(urlParams.get('name')); 
			}
		}
	} catch (e){}
	
	
	//full url for content-landing
	try{
		const url = window.location.href;
		if (au.indexOf('content_landing') != -1){
			if (url.indexOf('/business') != -1) {addtokv("business");}
			if (url.indexOf('/climate') != -1) {addtokv("climate");}
			if (url.indexOf('/health-wellness') != -1) {addtokv("health-wellness");}
			if (url.indexOf('/space-news') != -1) {addtokv("space-news");}
			if (url.indexOf('/leisure-recreation') != -1) {addtokv("leisure-recreation");}
			if (url.indexOf('/sports') != -1) {addtokv("sports");}
			if (url.indexOf('/travel') != -1) {addtokv("travel");}
		}
	} catch (e){}
  
  try{
			if (window.location.hash.indexOf("adventurecast") != -1){
				addtokv("adventurecast");
			}
	} catch (e){}
	
})();



/*********
Longitude 
**********/
!function(){let e="/6581/web/us/video_player/weather/current",t=e.split("/"),a=document.getElementById("connatix"),r=!1;if(void 0===a||null==a){if((a=document.createElement("div")).id="connatix",a.setAttribute("class","content-module"),"alerts"==t[6]&&"us"==t[3])document.getElementsByClassName("page-content")[0].appendChild(a);else if("minutecast"==t[6]&&"us"==t[3])r=document.getElementsByClassName("base-map-cta")[0];else{if("wintercast"!=t[6]||"us"!=t[3])return;r=document.getElementById("house-ad-1")}}try{if(-1==window.adInfo.lang.indexOf("en")){a.remove();return}}catch(i){}switch(t[6]){case"country_home":r=document.getElementsByClassName("base-map-cta")[0];break;case"video_wall":a.remove();return;case"local_home":r=document.getElementsByClassName("daily-list")[0];break;case"radar":case"daily":r="mweb"==t[2]?document.getElementById("middle"):document.getElementById("native");break;case"hourly":let l=document.getElementsByClassName("hour");l.length>3&&(r=l[3]);break;case"extended":let n=document.getElementsByClassName("daily-wrapper");n.length>5&&(r=n[2]);break;case"minutecast":"web"==t[2]&&(r=document.getElementById("native"));break;case"air_quality":r=document.getElementById("native")}try{r&&r.parentNode.insertBefore(a,r)}catch(p){}window.watchAWNowLive=function(){if(document.getElementById("live_fallback")&&document.getElementById("live_fallback").children.length>0){window.startLiveFallbackPlayer();return}window.interruptStartLive()};let o=document.createElement("div");o.setAttribute("class","video-player-wrapper"),o.innerHTML='<h2 class="video-title">AccuWeather NOW</h2><div id="lngtd_outstream"></div><div class="cta-container"><div class="thumb-info-wrapper" onclick="watchAWNowLive()"><div class="icon-play"></div><div class="thumb-info"><div class="thumb-title">Watch Live</div></div></div></div>';let d="#lngtd_outstream{background-image: url(https://www.awxcdn.com/adc/AW-Now.jpg);background-size: 100%;background-repeat: no-repeat;width:100%;aspect-ratio:16/9}.video-player-wrapper,.video-title{color:hsla(0,0%,100%,.6);font-size:.75rem;background-color:#fff}.video-player-wrapper .cta-container h3,.video-title{font-weight:700;text-transform:uppercase;color:rgba(0,0,0,.6)}.video-player-wrapper{border-radius:6px}.video-title{letter-spacing:.5px;padding:20px 0 12px 20px}.video-player-wrapper .cta-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px;padding:20px}.video-player-wrapper .cta-container .thumb-info-wrapper{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;cursor:pointer}.video-player-wrapper .cta-container .thumb-info-wrapper .icon-play{-ms-flex-negative:0;background:url(https://www.awxcdn.com/adc-assets/images/components/content/video-player/play_dark_circle.svg) 50%/cover no-repeat;flex-shrink:0;height:40px;margin-right:12px;width:40px}.video-player-wrapper .cta-container .thumb-info-wrapper .thumb-info .thumb-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;font-size:16px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:normal;color:rgba(0,0,0,.6)}.video-player-wrapper #lngtd_live_player,.video-player-wrapper #lngtd_player{border-radius:0}.weather-warning .video-player-wrapper{margin-top:16px}.weather-warning .video-player-wrapper .video-title,.weather-warning .video-player-wrapper .cta-container{padding-left:0}.weather-warning .video-player-wrapper #lngtd_live_player,.weather-warning .video-player-wrapper #lngtd_player,.weather-warning .video-player-wrapper #lngtd_outstream{border-radius:6px}",s=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css";let m=document.createElement("script");-1!=e.indexOf("mweb")?m.src="https://lngtd.com/accuweather_mweb_os.js":(m.src="https://lngtd.com/accuweather_web_os.js",d+=".video-player-wrapper #lngtd_player,.video-player-wrapper #lngtd_outstream,.video-player-wrapper #lngtd_live_player{min-height:357px}"),m.setAttribute("async","true");try{c.styleSheet?c.styleSheet.cssText=d:c.appendChild(document.createTextNode(d)),s.appendChild(c),s.appendChild(m),a.appendChild(o),a.style.minHeight="auto"}catch(w){}}();

      
/*********
Google Multiplex 
**********/
 !function(){let e="/6581/web/us/video_player/weather/current";if(-1!=e.indexOf("/us/"))return;let t=parseInt("0"),a=!1,l=!1,n="9224325968",s=parseInt("0"),i="width:970px;margin:0 auto 20px auto;",o="width:930px;height:450px",r="background-color: #fff;color: rgba(0, 0, 0, .6);font-size: .75rem;font-weight: 700;letter-spacing: .5px;margin-bottom: 1px;padding: 20px 20px 12px;text-transform:uppercase;";-1!=e.indexOf("/mweb/")?(l=!0,n="3311122915",o="display:block;",i="margin:0 auto 20px auto;",r="background-color: #fff;color: rgba(0, 0, 0, 1);font-size: 1.375rem;font-weight: 700;letter-spacing: .5px;padding: 20px 20px 12px;"):(-1!=e.indexOf("/ios/")||-1!=e.indexOf("/android/"))&&(a=!0,n=-1!=e.indexOf("/android/")?"7100865123":"1443647090",o="display:block;",i="",r="background-color: #fff;color: rgba(0, 0, 0, 1);font-size: 1.375rem;font-weight: 700;letter-spacing: .5px;padding: 20px 20px 12px;");let d=document.createElement("script");d.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5771594739411148",d.setAttribute("crossorigin","anonymous"),d.async=!0;let p=document.createElement("ins");p.setAttribute("class","adsbygoogle"),p.setAttribute("style",o),(l||a)&&p.setAttribute("data-ad-format","autorelaxed"),p.setAttribute("data-ad-client","ca-pub-5771594739411148"),p.setAttribute("data-ad-slot",n);let c=document.createElement("div");c.setAttribute("style","display:block;background:#fff;padding:10px 20px"),c.appendChild(d),c.appendChild(p);let g=document.createElement("h2");g.setAttribute("style",r),g.innerHTML="Around The Web";let $=document.createElement("div");a?$.setAttribute("class","full-mobile-width multiplex"):$.setAttribute("class","content-module glacier-ad ad multiplex"),$.setAttribute("style",i),$.appendChild(g),$.appendChild(c);let u=document.head||document.getElementsByTagName("head")[0],b=e=>{let t=document.createElement("style");return t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),u.appendChild(t)};function m(){b('.multiplex{display:block} .multiplex:has(ins[data-ad-status="unfilled"]){display:none}'),console.log("multiplex loaded");try{if(a)document.getElementsByClassName("zone-centerWell2")[0].appendChild($);else if(l){let e=document.getElementsByClassName("page-content")[0];e.appendChild(document.getElementById("bottom")),e.appendChild($)}else{let t=document.getElementsByClassName("breadcrumbs");t.length>1?t[1].parentNode.insertBefore($,t[1]):t[0].parentNode.insertBefore($,t[0])}(adsbygoogle=window.adsbygoogle||[]).push({})}catch(n){}}"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(s=!1);let x=document.getElementById("bottom");if(x||(x=document.getElementsByClassName("zone-centerWell2")[0]),s)new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(m(),t.unobserve(e.target))})},{rootMargin:"0px 0px 500px 0px"}).observe(x);else if(t)try{window.googletag.cmd.push(()=>{let e=t=>{window.googletag.pubads().removeEventListener("slotRenderEnded",e),m()};window.googletag.pubads().addEventListener("slotRenderEnded",e)})}catch(f){m()}else m()}();


/***
	LinkedIn Games
	***/
	!function(){
		
		const au = '/6581/web/us/video_player/weather/current';
		/*if (window.location.hash.indexOf('linkedin') == -1){
			return;
		}*/
		
		if (au.indexOf('/web/us/video_player/news_info/country_home') == -1 ){
			return;
		}
  
  	if (adInfo.userid3p != "active"){
     return;
    }
		
		window.addEventListener('message',function(event){
			if (event.origin === 'https://www.linkedin.com'){
				if (event.data.message === 'openSignInPopUpWindow'){
					const linkedInLoginUrl = event.data.loginUrl ?? 'https://www.linkedin.com/uas/login';
					window.open(linkedInLoginUrl,'width=100,height=600');
				} 
				if (event.data.message === 'loginSuccess'){
					document.getElementById("linkedInGames").src = document.getElementById("linkedInGames").src;
				} 
			}
		});
		
const html = `<div class="indices-newsfeed full-mobile-width ">
	<div class="spaced-content indices-newsfeed__title">
		<span>Today's Puzzle Games</span>
	</div>
	<div class="indices-body">
		<div class="indices-touts">
			<a class="story" style="min-height:auto;cursor:pointer;" onclick="playLinkedInGame('pinpoint')">
				<img style="width:100%" src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAAMGGxbkBCr8GSryswNRYzmSZLA.png" />
			</a>
			<a class="story" style="min-height:auto;cursor:pointer;" onclick="playLinkedInGame('crossclimb')">
				<img style="width:100%" src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAANgViDOAk1VzRd-srvrVW30Tcw.png" />
			</a>
			<a class="story" onclick="playLinkedInGame('queens')" style="min-height:auto;cursor:pointer;">
				<img style="width:100%"src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAANk-eD3hWMd6SPucqE5e8ila1A.png" />
			</a>
		</div>
	</div>
	<div class="indices-body" id="linkedInGamesContainer">
			<iframe style="margin:0;padding:0;border:none;width:100%;height:0" id="linkedInGames"></iframe>	
	</div>
</div>`;
		
window.playLinkedInGame = function(game) {
	document.getElementById('linkedInGames').src="https://www.linkedin.com/games/view/"+game+"?parentCode=accuweather";
	document.getElementById('linkedInGames').style.height="683px";
}
		
		const awAdSlot = document.getElementsByClassName('zone-centerWell1');
		const div = document.createElement("div");
		div.innerHTML = html;
		if (awAdSlot.length){
			awAdSlot[0].appendChild(div);
		}
	}();      
      

//TripleLift Native Width Fix
!function(){try{window.googletag.cmd.push(()=>{let e=t=>{"native"==t.slot.getSlotElementId()&&(window.googletag.pubads().removeEventListener("slotRenderEnded",e),setTimeout(function(){if(document.getElementsByClassName("accuweather_d_weather_native_pbjs").length){let e=document.getElementsByClassName("native")[0];e.getElementsByTagName("div")[0].style.width="100%",e.getElementsByTagName("iframe")[0].style.width=e.clientWidth+"px"}},300))};window.googletag.pubads().addEventListener("slotRenderEnded",e)})}catch(e){}}();
      
//remove criteo fast bid
try{localStorage.removeItem('criteo_fast_bid');localStorage.removeItem('criteo_fast_bid_expires');} catch (e){}
      
//Tracker
(function(){try { if ('No' == 'Yes'){ const t=new Image();t.src='https://securepubads.g.doubleclick.net/pcs/view?xai=AKAOjsvPuyv9oMYl3F9I6vAUAs-wPbn43g30m6IkKomc18VQxq5p9dHvpzi9HOfLpwDPIWBe9iSxiQLq1HSGm9fbr9XPvIOZcupf0K7nTzNB3DNIxT4hYqx5HGYSMhoiH0lobzTyM6Eu4EreFMBoHEVCVCZQW4-BJB04wBASkbEz4-KhG9Aj08X-ahLwWbyJfGjn4_Luwist-VTbuP8tL-9fF6J34JyPVKfgCWl5vvFClG3EV5BlTkaOoapDVhS5zwSlqEUsWXcpzw3KRegnAVLQFjW3ZdJ3MOXq-gzRg1qfcQftdm16CHo59bAbguSeCj2_yp4M6TgRCsPvPtnEcuxkuhc2Cki111M3pU_pXjLxNcxufgXGpTK_Krlbi_LJu6-K8cezhFmr91fo3bsZHev66qQchc9EzT44C8Xc0lerjpiI&sai=AMfl-YTPR3yUv43FswoO4HsbYEzqNN1dfaS8_dO0-ob62y-YPw-1NXVe_QuoU7N3S_5Pol4ETEJy8eIPIUe-TF0qfYzqGT8Eq7Soygbd3sH78yKr5DDA1iIbcVrcdX8&sig=Cg0ArKJSzMelPlQVKIrQEAE&uach_m=%5BUACH%5D&urlfix=1&adurl=';}} catch (e){}})();