(function(){

if (!('IntersectionObserver' in window) ||
    !('IntersectionObserverEntry' in window) ||
    !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
    try{window.collapseConnatix();}catch(e){}
return;
}


var ctx_Success = true;
var ctx_ll_config = {rootMargin: "0px 0px 100px 0px"};
try{
let ctx_container = document.getElementById('connatix');
let ctx_observer = new IntersectionObserver(
(entries, observer) => { 
entries.forEach(entry => {

if (entry.isIntersecting) {


//Begin CTX Code
    

	!function(n){if(!window.cnxps){window.cnxps={},window.cnxps.cmd=[];var t=n.createElement('iframe');t.display='none',t.onload=function(){var n=t.contentWindow.document,c=n.createElement('script');c.src='https://cd.connatix.com/connatix.playspace.js',c.setAttribute('async','1'),c.setAttribute('type','text/javascript'),n.body.appendChild(c)},n.head.appendChild(t)}}(document);
	
	var au = '/6581/web/eur/video_player/news_info/news';
	try{
		if (window.serverAdsOnPage){
			for (var i=0;i<window.serverAdsOnPage.length;i++){
        		if (window.serverAdsOnPage[i].adType == 'top'){
					au = window.serverAdsOnPage[i].adUnitCode;
          		  	break;
				}                                               
      	  	}
		}
	} catch (e){}

 if(au.indexOf('mweb') == -1){
    ctx_ll_config = {rootMargin: "0px 0px 0px 0px"};                              
	}
                                                        
	
	
	try{
		au = au.replace('/6581/','');
		au = au.replace('/video_player/','/top/');
    	au = au.replace('/top/','/-/');
	} catch (e){}
	
	var s = document.createElement("script");
	s.id = '4d1da129cb6a4a748d6e48ade9a68b62';
	s.type = 'text/javascript';
	var code = 'cnxps.cmd.push(function(){cnxps({playerId:"df85ee0a-00ac-4645-9bcd-11f400206bc9",storyId:"",customParam1:"'+au+'",customParam2:"",customParam3:"'+window.adInfo.userid3p+'",customParam4:"",customParam5:"'+window.adInfo.partner+'"}).render("4d1da129cb6a4a748d6e48ade9a68b62");});';
	    try {
	      s.appendChild(document.createTextNode(code));
	      document.body.appendChild(s);
	    } catch (e) {
	      s.text = code;
	      document.body.appendChild(s);
	    }
	try {
	if ('No' == 'Yes'){
		var track = new Image();
		track.src = 'https://securepubads.g.doubleclick.net/pcs/view?xai=AKAOjss0NQ2w0jDG2rYb4YLvtSZmXNeGAIx3m7CnwOngnXyV1gXcKxQw0rNPl2S0gNYJuhzc8a5m19g-xQ2lWyJUbSCIxXsmw1SE5UfU5oN9VwEted2HMNrztdqolBP18-mhmgveEqKNnVRKkt6-N1W4MMcwuku3V5ncN092ZmIitEZz02pYKLvrPvfVgJjCqCHsrO16SHyGTPRNk2OKGojgER-UuGp2Crglsf3Jq7YDz9agelYVPm-FqJSlYmPQGzzgPHT5bn2iyc0MMabaQ-VJi5rjwwIVTOTR32fYELLatVDp6ocQRrR0d9zbhR4dbgLOS_N2FDKiydmsAKicnC4LCM4T2zflEYtMNUFvChmd5g&sai=AMfl-YRMRaJmqZrWQH98NSQkSoQZjdh7HnCl8RPQG_lRCCooPJkRcY9o-r_Cr-hCZbpALfR_9uaFrW_5gDAXfv91bW54c6WbdePD_5jbdWNhI12o4Au_95pOh8cGpbCqDQ&sig=Cg0ArKJSzG0QrTflpRNUEAE&uach_m=[UACH]&urlfix=1&adurl=';
	}
	} catch (e){}	


//End CTX Code

    observer.unobserve(entry.target);
   }
  });
}, ctx_ll_config);

ctx_observer.observe(ctx_container);
} catch (e) {
	ctx_Success = false;
}
if (ctx_Success == false){
	try{window.collapseConnatix();}catch(e){}
}
                                                         
})();	
                                                         
(function(){
	const rcWidgets = [
		{platform:'mweb', position:'middle', au:'admin', className:'revcontent content-module rc-1x2 lazyload', elementId:'rc-widget-6d4495', widgetId:'272292'},
		{platform:'mweb', position:'bottom', au:'admin', className:'revcontent content-module rc-1x6 lazyload', elementId:'rc-widget-9b4330', widgetId:'271054'},
		{platform:'mweb', position:'middle', au:'news_info', className:'revcontent content-module rc-1x2 lazyload', elementId:'rc-widget-6d4495', widgetId:'272292'},
		{platform:'mweb', position:'bottom', au:'news_info', className:'revcontent content-module rc-1x6 lazyload', elementId:'rc-widget-9b4330', widgetId:'271054'},
		{platform:'mweb', position:'middle', au:'lifestyle', className:'revcontent content-module rc-1x2 lazyload', elementId:'rc-widget-6d4495', widgetId:'272292'},
		{platform:'mweb', position:'bottom', au:'lifestyle', className:'revcontent content-module rc-1x6 lazyload', elementId:'rc-widget-7471c5', widgetId:'272291'},
		{platform:'mweb', position:'middle', au:'weather', className:'revcontent content-module rc-1x2 lazyload', elementId:'rc-widget-6d4495', widgetId:'272292'},
		{platform:'mweb', position:'bottom', au:'weather', className:'revcontent content-module rc-1x6 lazyload', elementId:'rc-widget-7471c5', widgetId:'272291'},
		{platform:'web', position:'middle', au:'admin', className:'revcontent content-module rc-3x1 lazyload', elementId:'rc-widget-96e9fd', widgetId:'272292'},
		{platform:'web', position:'bottom', au:'admin', className:'revcontent content-module rc-3x2 lazyload', elementId:'rc-widget-54caf5', widgetId:'271054'},
		{platform:'web', position:'middle', au:'news_info', className:'revcontent content-module rc-3x1 lazyload', elementId:'rc-widget-96e9fd', widgetId:'272292'},
		{platform:'web', position:'bottom', au:'news_info', className:'revcontent content-module rc-3x2 lazyload', elementId:'rc-widget-54caf5', widgetId:'271054'},
		{platform:'web', position:'middle', au:'lifestyle', className:'revcontent content-module rc-3x1 lazyload', elementId:'rc-widget-96e9fd', widgetId:'272292'},
		{platform:'web', position:'bottom', au:'lifestyle', className:'revcontent content-module rc-3x2 lazyload', elementId:'rc-widget-97791e', widgetId:'272291'},
		{platform:'web', position:'middle', au:'weather', className:'revcontent content-module rc-3x1 lazyload', elementId:'rc-widget-96e9fd', widgetId:'272292'},
		{platform:'web', position:'bottom', au:'weather', className:'revcontent content-module rc-3x2 lazyload', elementId:'rc-widget-97791e', widgetId:'272291'}			
	];
	
	const ctaLinks = document.getElementsByClassName("more-cta-links");
	if (ctaLinks.length < 2) {
		return;
	}
	
	const au = '/6581/web/eur/video_player/news_info/news';
	let rcWidgetConfig = -1;
	for (let i=0,l=rcWidgets.length; i<l; i++){
		if (au.indexOf(rcWidgets[i].platform) != -1 && au.indexOf(rcWidgets[i].au) != -1 && rcWidgets[i].position == 'bottom') {
			rcWidgetConfig = i;
			break;
		}
	}
	
	if (rcWidgetConfig == -1){
		return;
	}
	
	const rcDiv = document.createElement("div");
	rcDiv.setAttribute('class', rcWidgets[rcWidgetConfig].className);
	rcDiv.setAttribute('id', rcWidgets[rcWidgetConfig].elementId);
	rcDiv.setAttribute('data-widget-host', 'habitat');
	rcDiv.setAttribute('data-disable-demand', 'true');
	rcDiv.setAttribute('data-endpoint', '//trends.revcontent.com');
	rcDiv.setAttribute('data-widget-id', rcWidgets[rcWidgetConfig].widgetId);
	rcDiv.setAttribute('data-rc-widget', '');	
	
	const ctaLink = ctaLinks[ctaLinks.length - 1];
	const parentDiv = ctaLink.parentNode;
	try{
		parentDiv.insertBefore(rcDiv, ctaLink);
	} catch (e){
		return;
	}
	
	
	function loadRevcontentScript() {
		const scriptEl = document.querySelector('script#revcontent-delivery');
		if (!scriptEl) {
			const s = document.createElement("script");
			const el = document.getElementsByTagName("script")[0];
			s.setAttribute('id', 'revcontent-delivery');
			s.src = "https://assets.revcontent.com/master/delivery.js";
			el.parentNode.insertBefore(s, el);
		}
	}
	
	if (!('IntersectionObserver' in window) ||
	    !('IntersectionObserverEntry' in window) ||
	    !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
	loadRevcontentScript();
	} else {
		const rc_ll_config = {rootMargin: "0px 0px 250px 0px"};
		try{
			const rc_container = document.getElementById(rcWidgets[rcWidgetConfig].elementId);
			let rc_observer = new IntersectionObserver(
				(entries, observer) => { 
					entries.forEach(entry => {
						if (entry.isIntersecting) {
							observer.unobserve(entry.target);
							loadRevcontentScript();
						}
					});
				}, rc_ll_config);
				rc_observer.observe(rc_container);
		} catch (e) {}
	}
})();