PageSourceSearch

https://protectionreporter.co.uk/js/2022_js_dfp.js?v=0edcc3cf763edb4f2820238471b5e171

js protectionreporter.co.uk collected 2026-09-29 21:28:40 UTC 73,225 bytes, 2,132 lines download raw bytes

1var	NoSubscribe	=	true;
2var sHPTOCSS	=	'';
3var	hasPopUp	=	0;
4var	device		=	"desktop";
5
6var googletag = googletag || {};
7googletag.cmd = googletag.cmd || [];
8
9function createCookie(name,value,days) {
10    if (days) {
11        var date = new Date();
12        date.setTime(date.getTime()+(days*24*60*60*1000));
13        var expires = "; expires="+date.toGMTString();
14    }
15    else var expires = "";
16    document.cookie = name+"="+value+expires+"; path=/";
17};
18
19function readCookie(name) {
20    var nameEQ = name + "=";
21    var ca = document.cookie.split(';');
22    for(var i=0;i < ca.length;i++) {
23        var c = ca[i];
24        while (c.charAt(0)==' ') c = c.substring(1,c.length);
25        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
26    }
27    return null;
28};
29
30var fbCookieValue = readCookie("fb");
31
32if (fbCookieValue) {
33	$("#footer-banner").show();//$("#footer-banner").remove();
34	$(".footer .wrapper").css("padding-bottom", "0px");
35};
36
37
38if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
39	device	=	"mobile";
40};
41
42if (device == null) {
43	if (readCookie("DT") == null) {
44		createCookie("DT","1",1);
45		var iCookieDT = readCookie("DT");
46	} else if (readCookie("DT") == "") {
47		createCookie("DT","1",1);
48		var iCookieDT = readCookie("DT");
49	} else if (readCookie("DT") == "1") {
50		createCookie("DT","1",1);
51		var iCookieDT = readCookie("DT");
52	}
53	device		=	"desktop";
54	popbanner	=	"true";
55} else if (device == false) {
56	if (readCookie("DT") == null) {
57		createCookie("DT","1",1);
58		var iCookieDT = readCookie("DT");
59	} else if (readCookie("DT") == "") {
60		createCookie("DT","1",1);
61		var iCookieDT = readCookie("DT");
62	} else if (readCookie("DT") == "1") {
63		createCookie("DT","1",1);
64		var iCookieDT = readCookie("DT");
65	}
66	device		=	"desktop";
67	popbanner	=	"true";
68} else if (device == "desktop") {
69	if (readCookie("DT") == null) {
70		createCookie("DT","1",1);
71		var iCookieDT = readCookie("DT");
72	} else if (readCookie("DT") == "") {
73		createCookie("DT","1",1);
74		var iCookieDT = readCookie("DT");
75	} else if (readCookie("DT") == "1") {
76		createCookie("DT","1",1);
77		var iCookieDT = readCookie("DT");
78	}
79	device		=	"desktop";
80	popbanner	=	"true";
81} else {
82	if (readCookie("DT") == "1") {
83		createCookie("DT","0",1);
84		var iCookieDT = readCookie("DT");
85	} else if (readCookie("DT") == null) {
86		createCookie("DT","0",1);
87		var iCookieDT = readCookie("DT");
88	} else if (iCookieDT == "") {
89		createCookie("DT","0",1);
90		var iCookieDT = readCookie("DT");
91	} else {
92		var iCookieDT = readCookie("DT");
93	}
94	popbanner	=	"true";
95	if (readCookie("DT") == "2") {
96		device	=	"desktop";
97	} else {
98		device	=	"mobile";
99	}
100};
101
102var Billboard1Height =	0;
103var Billboard2Height =	0;
104var Billboard3Height =	0;
105var Billboard4Height =	0;
106var Billboard5Height =	0;
107
108function goToPodcast() {
109
110	$('iframe').contents().find('a').click(function(event) {
111
112		var	BannerAlt	=	$(this).find('img').attr("alt");
113		
114		if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
115			var podcastOffset	=	50;
116		} else {
117			var podcastOffset	=	100;	
118		};
119		
120		switch (BannerAlt) {
121			case	'barclayspodcast':
122				//event.preventDefault();
123
124				$('#barclayspodcast').show();
125				$('#barclayspodcast').removeClass('barclays-podcast-pulse');
126				//setTimeout(function() {
127					//$('html, body').animate({
128					//	scrollTop: $("#barclayspodcast").offset().top -podcastOffset
129					//}, 50);
130					$('#barclayspodcast').addClass('barclays-podcast-pulse');
131				//}, 0);
132			break;
133		};
134	});
135};
136
137switch (device) {
138	case	'desktop':
139	
140		googletag.cmd.push(function() {
141
142			var	iNewsID			=	$('#news-id').val();
143			
144			var REFRESH_KEY		=	'refresh';
145			var REFRESH_VALUE	=	'true';
146			
147			googletag.pubads().disableInitialLoad();
148			googletag.pubads().collapseEmptyDivs();
149			googletag.pubads().enableSingleRequest();
150			googletag.enableServices();
151			
152			HPTOAltTagTrackerZone				=	googletag.defineSlot('/' + DFPFolder
152Name + '/' + HPTOAltTagTrackerZoneName, [2, 2], HPTOAltTagTrackerZoneID)
153													.addService(googletag.pubads());
154			
155			DFPDesktopBookendLeftZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBookendLeftZoneName,  [[120, 601], [120, 1080], [300, 1080], [160, 1080]], DFPDesktopBookendLeftZoneID)
156													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
157													.setTargeting('test', 'event')
158													.addService(googletag.pubads());
159			
160			DFPDesktopBookendLeftTrackerZone	=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBookendLeftTrackerZoneName, [3, 1], DFPDesktopBookendLeftTrackerZoneID)
161													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
162													.setTargeting('test', 'event')
163													.addService(googletag.pubads());
164		
165			DFPDesktopBookendRightZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBookendRightZoneName, [[120, 602], [120, 1081], [300, 1081], [160, 1081]], DFPDesktopBookendRightZoneID)
166													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
167													.setTargeting('test', 'event')
168													.addService(googletag.pubads());
169			
170			DFPDesktopBookendRightTrackerZone	=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBookendRightTrackerZoneName, [3, 2], DFPDesktopBookendRightTrackerZoneID)
171													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
172													.setTargeting('test', 'event')
173													.addService(googletag.pubads());
174													
175			DFPDesktopBillboard1Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard1ZoneName, [[970, 250], [980, 60], [980, 250], [980, 251]], DFPDesktopBillboard1ZoneID)
176													.addService(googletag.pubads());
177			
178			DFPDesktopBillboard2Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard2ZoneName, [[970, 250], [980, 60], [980, 250], [980, 252]], DFPDesktopBillboard2ZoneID)
179													.addService(googletag.pubads());
180			
181			DFPDesktopBillboard3Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard3ZoneName, [[970, 250], [980, 60], [980, 250], [980, 253]], DFPDesktopBillboard3ZoneID)
182													.addService(googletag.pubads());										
183			
184			DFPDesktopBillboard4Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard4ZoneName, [[970, 250], [980, 60], [980, 250], [980, 254]], DFPDesktopBillboard4ZoneID)
185													.addService(googletag.pubads());
186
187
188			DFPDesktopMPU1Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU1ZoneName, [[300, 250],[300, 600],[300, 601],[300, 251],[300, 230]], DFPDesktopMPU1ZoneID)
189													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
190													.setTargeting('test', 'event')
191													.addService(googletag.pubads());
192
193			DFPDesktopMPU3Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU3ZoneName, [[300, 250],[300, 600],[300, 602],[300, 252]], DFPDesktopMPU3ZoneID)
194													.setTargeting(REFRESH_KEY, REFRESH_VALUE)
195													.addService(googletag.pubads());
196
197			// DFPDesktopBillboard1TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard1TrackerZoneName, [1, 1], DFPDesktopBillboard1TrackerZoneID)
198			// 										.addService(googletag.pubads());
199			
200			// DFPDesktopBillboard2TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard2TrackerZoneName, [1, 1], DFPDesktopBillboard2TrackerZoneID)
201			// 										.addService(googletag.pubads());
202			
203			// DFPDesktopBillboard3TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard3TrackerZoneName, [1, 1], DFPDesktopBillboard3TrackerZoneID)
204			// 										.addService(googletag.pubads());
205			
206			// DFPDesktopHP1TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopHP1TrackerZoneName, [1, 1], DFPDesktopHP1TrackerZoneID)
207			// 										.addService(googletag.pubads());
208			
209			// DFPDesktopMPU1TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU1TrackerZoneName, [1, 1], DFPDesktopMPU1TrackerZoneID)
210			// 										.addService(googletag.pubads());
211			
212			// DFPDesktopMPU3TrackerZone			=	googletag.defineSlot('/' + DFPFolder
212Name + '/' + DFPDesktopMPU3TrackerZoneName, [1, 1], DFPDesktopMPU3TrackerZoneID)
213			// 										.addService(googletag.pubads());
214													
215			// DFPDesktopPodCastTrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopPodCastTrackerZoneName, [1, 1], DFPDesktopPodCastTrackerZoneID)
216			// 										.addService(googletag.pubads());
217										
218		
219			var TakeOverRight		=	0;
220			var	TakeOverRightHeight	=	0;
221			var TakeOverLeft		=	0;
222			var	TakeOverLeftHeight	=	0;
223			
224			googletag.pubads().addEventListener('slotRenderEnded', function(event) {
225				
226				var sHPTOCSS	=	'';
227				
228				// HPTO Alt Tag  Tracker Checks
229	
230				if (HPTOAltTagTrackerZone === event.slot) {
231					
232					console.log(' ');
233					console.log('HPTO Alt Tag Tracker Campaign ID: ', event.campaignId);
234					console.log('HPTO Alt Tag Tracker Creative ID: ', event.creativeId);
235					console.log('HPTO Alt Tag Tracker Is empty?: ', event.isEmpty);
236					console.log('HPTO Alt Tag Tracker Line Item ID: ', event.lineItemId);
237		
238					var containsHPTOAltTagTracker1 = event.isEmpty;
239		
240					if (containsHPTOAltTagTracker1  === false) {
241			
242						var sHPTOCSS			=	$('#' + HPTOAltTagTrackerZoneID + ' iframe').contents().find('img').attr("alt");
243		
244						$('#hpto-alt').val(sHPTOCSS);
245						
246						// switch (sHPTOCSS) {
247						// 	case	'hpto':
248						
249						// 		var sPodCast			=	$('iframe').contents().find('img').attr("alt");
250								
251						// 		switch (sPodCast) {
252						// 			case	'barclayspodcast':
253						// 				$('#barclayspodcast').show();
254						// 			break;
255						// 			default:
256						// 				$('#barclayspodcast').hide();
257						// 			break;
258						// 		};
259						// 	break;
260						// 	default:
261						// 		$('#barclayspodcast').show();
262						// 	break;
263						// };
264					
265					} else {
266						// $('#barclayspodcast').show();	
267					};
268					
269				 	loadExtraZones(sHPTOCSS);
270					
271				};
272				
273				// Bookend Left Check
274					
275				if (DFPDesktopBookendLeftZone === event.slot) {
276	
277					console.log(' ');
278					console.log('Bookend Left Campaign ID: ', event.campaignId);
279					console.log('Bookend Left Creative ID: ', event.creativeId);
280					console.log('Bookend Left Is empty?: ', event.isEmpty);
281					console.log('Bookend Left Line Item ID: ', event.lineItemId);
282		
283					var containsBookendLeft = event.isEmpty;
284		
285					if (containsBookendLeft  === false) {
286		
287						TakeOverLeft		=	event.size[0];
288						TakeOverLeftHeight	=	event.size[1];
289					
290						var sBookEndCSS = $('#' + DFPDesktopBookendLeftZoneID + ' iframe').contents().find('img').attr("alt");
291					
292						if (!sBookEndCSS) {
293			
294						} else {
295							
296							if ( sBookEndCSS.indexOf('#') > -1 )  {
297								$("body").css('background-color', sBookEndCSS);
298								$("#top-ad").css('background-color', sBookEndCSS);	
299							} else {
300								$("body").addClass(sBookEndCSS);
301								$("#top-ad").addClass(sBookEndCSS);
302							} 
303		
304						};
305		
306					};
307		
308				};
309				
310				// Bookend Left Tracker Check
311					
312				if (DFPDesktopBookendLeftTrackerZone === event.slot) {
313					
314					console.log(' ');
315					console.log('Bookend Tracker Left Campaign ID: ', event.campaignId);
316					console.log('Bookend Tracker Left Creative ID: ', event.creativeId);
317					console.log('Bookend Tracker Left Is empty?: ', event.isEmpty);
318					console.log('Bookend Tracker Left Line Item ID: ', event.lineItemId);
319					
320					var containsBookendTrackerLeft = event.isEmpty;
321		
322					if (containsBookendTrackerLeft  === false) {
323		
324						var sBookEndCSS = $('#' + DFPDesktopBookendLeftTrackerZoneID + ' iframe').contents().find('img').attr("alt");
325						
326						if (!sBookEndCSS) {
327		
328						} else {
329							
330							$("body").addClass(sBookEndCSS);
331							$("#top-ad").addClass(sBookEndCSS);
332						};
333		
334					};
335					
336				};
337				
338				// Bookend Right Check
339				
340				if (DFPDesktopBookendRightZone === event.slot) {
341					
342					console.log(' ');
343					console.log('Bookend Right Campaign ID: ', event.campaignId);
344					console.log('Bookend Right Creative ID: ', event.creativeId);
345					console.log('Bookend Right Is empty?: ', event.isEmpty);
346					console.log('Bookend Right Line Item ID: ', event.lineItemId);
347		
348					var containsBookendRight = event.isEmpty;
349		
350					if (containsBookendRight  === false) {
351		
352						TakeOverRight			=	event.size[0];
353						TakeOverRightHeight		=	event.size[1];
354						
355						if (TakeOverRightHeight == 1201) {
356							$('#corner-slider').remove();
357						};
358		
359					};
360					
361				};
362				
363				// Bookend Right Tracker Check
364				
365				if (DFPDesktopBookendRightTrackerZone === event.slot) {
366						
367					console.log(' ');
368					console.log('Bookend Tracker Right Campaign ID: ', event.campaignId);
369					console.log('Bookend Tracker Right Creative ID: ', event.creativeId);
370					console.log('Bookend Tracker Right Is empty?: ', event.isEmpty);
371					console.log('Bookend Tracker Right Line Item ID: ', event.lineItemId);
372					
373					var containsBookendTrackerRight = event.isEmpty;
374		
375					if (containsBookendTrackerRight  === false) {
376		
377						var sBookEndCSS = $('#' + DFPDesktopBookendRightTrackerZoneID + ' iframe').contents().find('img').attr("alt");
378						
379						if (!sBookEndCSS) {
380		
381						} else {
382							
383							$("body").addClass(sBookEndCSS);
384							$("#top-ad").addClass(sBookEndCSS);
385						};
386		
387					};
388					
389				};
390				
391				var TakeOverWidth = TakeOverLeft + TakeOverRight;
392					
393				var WindowWidth	=	$(window).width();
394				var PageWidth	=	$('.section.bg-white').width() + 64;
395
396				if (WindowWidth < PageWidth + TakeOverWidth) {
397					
398					var newPageWidth	=	WindowWidth - 320;
399					
400					if (newPageWidth < 1044 &&  newPageWidth > 767) {
401						$('.section.bg-white').css('maxWidth', newPageWidth + 'px')
402						$('.container').css('maxWidth', newPageWidth + 'px')	
403					};
404					
405				} else {
406					$('.section.bg-white').css('maxWidth', '1044px');
407					$('.container').css('maxWidth', '1044px')
408				};
409
410				var	BookendWidth				=	PageWidth + TakeOverWidth;
411				
412				$(".bookend-zone").css(
413					'width', BookendWidth + 'px'
414				).css(
415					'max-width', BookendWidth + 'px'
416				).css(
417					'margin-left', '-' + (BookendWidth/2) + 'px'
418				);
419				
420				$(window).on("resize",function(e){
421					
422					var TakeOverWidth = TakeOverLeft + TakeOverRight;
423					
424					var WindowWidth	=	$(window).width();
425					var PageWidth	=	$('.section.bg-white').width() + 64;
426				
427					if (TakeOverWidth > 240) {
428						
429						if (WindowWidth < PageWidth + TakeOverWidth) {
430							
431							var newPageWidth	=	WindowWidth - 320;
432							
433							if (newPageWidth < 1044 &&  newPageWidth > 767) {
434								$('.section.bg-white').css('maxWidth', newPageWidth + 'px')
435								$('.container').css('maxWidth', newPageWidth + 'px')	
436							};
437							
438						} else {
439							$('.section.bg-white').css('maxWidth', '1044px');
440							$('.container').css('maxWidth', '1044px')
441						};
442						
443						var	BookendWidth				=	PageWidth + TakeOverWidth;
444						
445						$(".bookend-zone").css(
446							'width', BookendWidth + 'px'
447						).css(
448							'max-width', BookendWidth + 'px'
449						).css(
450							'margin-left', '-' + (BookendWidth/2) + 'px'
451						);
452			
453					};
454					
455				});
456				
457				// Billboard 1 Checks
458				
459				if (DFPDesktopBillboard1Zone === event.slot) {
460				
461					console.log(' ');
462					console.log('Billboard 1 Campaign ID: ', event.campaignId);
463					console.log('Billboard 1 Creative ID: ', event.creativeId);
464					console.log('Billboard 1 Is empty?: ', event.isEmpty);
465					console.log('Billboard 1 Line Item ID: ', event.lineItemId);
466		
467					var containsBillboard1 = event.isEmpty;
468		
469					if (containsBillboard1  === false) {
470						
471						goToPodcast();
472						
473						Billboard1Width		=	event.size[0];
474						Billboard1Height	=	event.size[1];
475						
476						if (Billboard1Height === undefined) {
477							Billboard1Height = 0;
478						};
479						
480						$(window).on("load resize",function(e){
481							
482							Billboard1ZoneWidth	=	$('#bb-1').width();
483							
484							if (Billboard1ZoneWidth < 980) {
485							
486								Billboard1ScaleValue	=	Billboard1ZoneWidth / Billboard1Width;			
487								Billboard1HeightValue	=	Billboard1Height * Billboard1ScaleValue;
488								
489							} else {
490								
491								Billboard1ScaleValue	=	1.00;
492								Billboard1HeightValue	=	250;
493						
494							};
495							$('.ad-billboard-1 iframe').css({
496								'-webkit-transform': 'scale(' + Billboard1ScaleValue + ')',
497								'-moz-transform': 'scale(' + Billboard1ScaleValue + ')',
498								'-ms-transform': 'scale(' + Billboard1ScaleValue + ')',
499								'-o-transform': 'scale(' + Billboard1ScaleValue + ')',
500								'transform': 'scale(' + Billboard1ScaleValue + ')',
501								'transform-origin': 'top left'
502							});
503							$('.ad-billboard-1').css({
504								'height': Billboard1HeightValue + 'px'
505							});
506							$('#bb-1').css({
507								'height': Billboard1HeightValue + 'px'
508							});
509							
510						});
511		
512					};
513					
514				};
515				
516				// Billboard 2 Checks
517				
518				if (DFPDesktopBillboard2Zone === event.slot) {
519			
520					console.log(' ');
521					console.log('Billboard 2 Campaign ID: ', event.campaignId);
522					console.log('Billboard 2 Creative ID: ', event.creativeId);
523					console.log('Billboard 2 Is empty?: ', event.isEmpty);
524					console.log('Billboard 2 Line Item ID: ', event.lineItemId);
525		
526					var containsBillboard2 = event.isEmpty;
527		
528					if (containsBillboard2  === false) {
529						
530						goToPodcast();
531					
532						Billboard2Width		=	event.size[0];
533						Billboard2Height	=	event.size[1];
534		
535						if (Billboard2Height === undefined) {
536							Billboard2Height = 0;
537						};
538						
539						$(window).on("load resize",function(e){
540		
541							Billboard2ZoneWidth	=	$('#bb-2').width();
542							
543							if (Billboard2ZoneWidth < 980) {
544							
545								Billboard2ScaleValue	=	Billboard2ZoneWidth / Billboard2Width;			
546								Billboard2HeightValue	=	Billboard2Height * Billboard2ScaleValue;
547								
548							} else {
549								
550								Billboard2ScaleValue	=	1.00;
551								Billboard2HeightValue	=	250;
552						
553							};
554							$('.ad-billboard-2 iframe').css({
555								'-webkit-transform': 'scale(' + Billboard2ScaleValue + ')',
556								'-moz-transform': 'scale(' + Billboard2ScaleValue + ')',
557								'-ms-transform': 'scale(' + Billboard2ScaleValue + ')',
558								'-o-transform': 'scale(' + Billboard2ScaleValue + ')',
559								'transform': 'scale(' + Billboard2ScaleValue + ')',
560								'transform-origin': 'top left'
561							});
562							$('.ad-billboard-2').css({
563								'height': Billboard2HeightValue + 'px'
564							});
565							$('#bb-2').css({
566								'height': Billboard2HeightValue + 'px',
567								'margin-top': '20px',
568								'margin-bottom': '40px'
569							});
570							
571						});
572					};
573				};
574				
575				// Billboard 3 Checks
576				
577				if (DFPDesktopBillboard3Zone === event.slot) {
578			
579					console.log(' ');
580					console.log('Billboard 3 Campaign ID: ', event.campaignId);
581					console.log('Billboard 3 Creative ID: ', event.creativeId);
582					console.log('Billboard 3 Is empty?: ', event.isEmpty);
583					console.log('Billboard 3 Line Item ID: ', event.lineItemId);
584		
585					var containsBillboard3 = event.isEmpty;
586		
587					if (containsBillboard3  === false) {
588
589						goToPodcast();
590								
591						Billboard3Width		=	event.size[0];
592						Billboard3Height	=	event.size[1];
593		
594						if (Billboard3Height === undefined) {
595							Billboard3Height = 0;
596						};
597						
598						$(window).on("load resize",function(e){
599							
600							Billboard3ZoneWidth	=	$('#bb-3').width();
601							
602							if (Billboard3ZoneWidth < 980) {
603							
604								Billboard3ScaleValue	=	Billboard3ZoneWidth / Billboard3Width;			
605								Billboard3HeightValue	=	Billboard3Height * Billboard3ScaleValue;
606								
607							} else {
608								
609								Billboard3ScaleValue	=	1.00;
610								Billboard3HeightValue	=	250;
611						
612							};
613							$('.ad-billboard-3 iframe').css({
614								'-webkit-transform': 'scale(' + Billboard3ScaleValue + ')',
615								'-moz-transform': 'scale(' + Billboard3ScaleValue + ')',
616								'-ms-transform': 'scale(' + Billboard3ScaleValue + ')',
617								'-o-transform': 'scale(' + Billboard3ScaleValue + ')',
618								'transform': 'scale(' + Billboard3ScaleValue + ')',
619								'transform-origin': 'top left'
620							});
621							$('.ad-billboard-3').css({
622								'height': Billboard3HeightValue + 'px'
623							});
624							$('#bb-3').css({
625								'height': Billboard3HeightValue + 'px',
626								'margin-top': '20px',
627								'margin-bottom': '40px'
628							});
629						
630						});
631					};
632				};
633				
634				// Billboard 4 Checks
635				
636				if (DFPDesktopBillboard4Zone === event.slot) {
637
638					console.log(' ');
639					console.log('Billboard 4 Campaign ID: ', event.campaignId);
640					console.log('Billboard 4 Creative ID: ', event.creativeId);
641					console.log('Billboard 4 Is empty?: ', event.isEmpty);
642					console.log('Billboard 4 Line Item ID: ', event.lineItemId);
643					
644					var containsBillboard4 = event.isEmpty;
645		
646					if (containsBillboard4  === false) {
647						
648						goToPodcast();
649					
650						Billboard4Width		=	event.size[0];
651						Billboard4Height	=	event.size[1];
652						
653						if (Billboard4Height === undefined) {
654							Billboard4Height = 0;
655						};
656						
657						$(window).on("load resize",function(e){
658		
659							Billboard4ZoneWidth	=	$('#bb-4').width();
660							
661							if (Billboard4ZoneWidth < 980) {
662							
663								Billboard4ScaleValue	=	Billboard4ZoneWidth / Billboard4Width;			
664								Billboard4HeightValue	=	Billboard4Height * Billboard4ScaleValue;
665								
666							} else {
667								
668								Billboard4ScaleValue	=	1.00;
669								Billboard4HeightValue	=	250;
670						
671							};
672							$('.ad-billboard-4 iframe').css({
673								'-webkit-transform': 'scale(' + Billboard4ScaleValue + ')',
674								'-moz-transform': 'scale(' + Billboard4ScaleValue + ')',
675								'-ms-transform': 'scale(' + Billboard4ScaleValue + ')',
676								'-o-transform': 'scale(' + Billboard4ScaleValue + ')',
677								'transform': 'scale(' + Billboard4ScaleValue + ')',
678								'transform-origin': 'top left'
679							});
680							$('.ad-billboard-4').css({
681								'height': Billboard4HeightValue + 'px'
682							});
683							$('#bb-4').css({
684								'height': Billboard4HeightValue + 'px',
685								'margin-top': '20px',
686								'margin-bottom': '40px'
687							});
688							
689						});
690					};
691				};
692				
693				// MPU/Halfpage 1 Checks
694				
695				if (DFPDesktopMPU1Zone === event.slot) {
696			
697					console.log(' ');
698					console.log('MPU/Half Page 1 Campaign ID: ', event.campaignId);
699					console.log('MPU/Half Page 1 Creative ID: ', event.creativeId);
700					console.log('MPU/Half Page 1 Is empty?: ', event.isEmpty);
701					console.log('MPU/Half Page 1 Line Item ID: ', event.lineItemId);
702		
703					var containsMPU1 = event.isEmpty;
704		
705					if (containsMPU1  === false) {
706						
707						goToPodcast();
708					
709						MPU1Width			=	event.size[0];
710						MPU1Height			=	event.size[1];
711						
712						if (MPU1Height < 250) {
713							//$('#wgt-recent-news').insertAfter('#wgt-subscribe');
714							$('#wgt-latest-event').show();
715						};
716						
717						if(window.location.hash) {
718							var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
719							switch (hash) {
720								case	'barclayspodcast':
721									$("#barclayspodcast").show();
722									setTimeout(function() {
723										$('html, body').animate({
724											scrollTop: $("#barclayspodcast").offset().top -100
725										}, 500);
726										$('#barclayspodcast').addClass('barclays-podcast-pulse');
727									}, 0);
728								break;
729							}
730						};
731		
732					};
733					
734				};
735				
736				// MPU/Halfpage 3 Checks
737				
738				if (DFPDesktopMPU3Zone === event.slot) {
739					
740					console.log(' ');
741					console.log('MPU/Half Page 3 Campaign ID: ', event.campaignId);
742					console.log('MPU/Half Page 3 Creative ID: ', event.creativeId);
743					console.log('MPU/Half Page 3 Is empty?: ', event.isEmpty);
744					console.log('MPU/Half Page 3 Line Item ID: ', event.lineItemId);
745					
746					var containsMPU3 = event.isEmpty;
747		
748					if (containsMPU3  === false) {
749						
750						goToPodcast();
751						
752						MPU3Width			=	event.size[0];
753						MPU3Height			=	event.size[1];
754					};
755				};
756
757			});
758
759			//alert(DFPSiteSection);
760
761			switch (sHPTOCSS) {
762				case 'hpto':
763					if (iNewsID != 0) {
764						googletag.pubads()
765						.setTargeting("pageID", [DFPSiteSection])
766						.setTargeting("articleID", [DFPArticleID])
767						.setTargeting("articleContent", [DFPArticleContent])
768						.refresh([
769							HPTOAltTagTrackerZone,
770							DFPDesktopBookendLeftZone,
771							DFPDesktopBookendLeftTrackerZone,
772							DFPDesktopBookendRightZone,
773							DFPDesktopBookendRightTrackerZone,
774							DFPDesktopBillboard1Zone,
775							DFPDesktopBillboard2Zone,
776							DFPDesktopBillboard3Zone,
777							DFPDesktopBillboard4Zone,
778							DFPDesktopMPU1Zone,
779							DFPDesktopMPU3Zone
780							// DFPDesktopBillboard1TrackerZone,
781							// DFPDesktopBillboard2TrackerZone,
782							// DFPDesktopBillboard3TrackerZone,
783							// DFPDesktopHP1TrackerZone,
784							// DFPDesktopMPU1TrackerZone,
785							// DFPDesktopMPU3TrackerZone,
786							// DFPDesktopPodCastTrackerZone
787						]);
788					} else {
789						googletag.pubads()
790						.setTargeting("pageID", [DFPSiteSection])
791						.setTargeting("articleID", [DFPArticleID])
792						.setTargeting("articleContent", [DFPArticleContent])
793						.refresh([
794							HPTOAltTagTrackerZone,
795							DFPDesktopBookendLeftZone,
796							DFPDesktopBookendLeftTrackerZone,
797							DFPDesktopBookendRightZone,
798							DFPDesktopBookendRightTrackerZone,
799							DFPDesktopBillboard1Zone,
800							DFPDesktopBillboard2Zone,
801							DFPDesktopBillboard3Zone,
802							DFPDesktopBillboard4Zone,
803							DFPDesktopMPU1Zone,
804							DFPDesktopMPU3Zone
805							// DFPDesktopBillboard1TrackerZone,
806							// DFPDesktopBillboard2TrackerZone,
807							// DFPDesktopBillboard3TrackerZone,
808							// DFPDesktopHP1TrackerZone,
809							// DFPDesktopMPU1TrackerZone,
810							// DFPDesktopMPU3TrackerZone,
811							// DFPDesktopPodCastTrackerZone
812						]);
813					};
814				break;
815				default:
816					if (iNewsID != 0) {
817						googletag.pubads()
818						.setTargeting("pageID", [DFPSiteSection])
819						.setTargeting("articleID", [DFPArticleID])
820						.setTargeting("articleContent", [DFPArticleContent])
821						.refresh([
822							HPTOAltTagTrackerZone,
823							DFPDesktopBookendLeftZone,
824							DFPDesktopBookendLeftTrackerZone,
825							DFPDesktopBookendRightZone,
826							DFPDesktopBookendRightTrackerZone,
827							DFPDesktopBillboard1Zone,
828							DFPDesktopBillboard2Zone,
829							DFPDesktopBillboard3Zone,
830							DFPDesktopBillboard4Zone,
831							DFPDesktopMPU1Zone,
832							DFPDesktopMPU3Zone
833							// DFPDesktopBillboard1TrackerZone,
834							// DFPDesktopBillboard2TrackerZone,
835							// DFPDesktopBillboard3TrackerZone,
836							// DFPDesktopHP1TrackerZone,
837							// DFPDesktopMPU1TrackerZone,
838							// DFPDesktopMPU3TrackerZone,
839							// DFPDesktopPodCastTrackerZone
840						]);
841					} else {
842						googletag.pubads()
843						.setTargeting("pageID", [DFPSiteSection])
844						.setTargeting("articleID", [DFPArticleID])
845						.setTargeting("articleContent", [DFPArticleContent])
846						.refresh([
847							HPTOAltTagTrackerZone,
848							DFPDesktopBookendLeftZone,
849							DFPDesktopBookendLeftTrackerZone,
850							DFPDesktopBookendRightZone,
851							DFPDesktopBookendRightTrackerZone,
852							DFPDesktopBillboard1Zone,
853							DFPDesktopBillboard2Zone,
854							DFPDesktopBillboard3Zone,
855							DFPDesktopBillboard4Zone,
856							DFPDesktopMPU1Zone,
857							DFPDesktopMPU3Zone
858							// DFPDesktopBillboard1TrackerZone,
859							// DFPDesktopBillboard2TrackerZone,
860							// DFPDesktopBillboard3TrackerZone,
861							// DFPDesktopHP1TrackerZone,
862							// DFPDesktopMPU1TrackerZone,
863							// DFPDesktopMPU3TrackerZone,
864							// DFPDesktopPodCastTrackerZone
865						]);
866					};
867				break;
868			};
869
870		});
871		
872		function loadExtraZones(sHPTOCSS) {
873			console.log('HPTO CSS:' + sHPTOCSS);
874			var sHPTOCSS	=	$('#hpto-alt').val();
875			console.log('HPTO CSS:' + sHPTOCSS);
876			switch (sHPTOCSS) {
877				case	'hpto':
878					console.log("No ads");
879					$('#ab-1').remove();
880					$('#footer-banner').remove();
881					$('.ad-mpu-4').remove();
882					$('#mc-widget').show();
883					if (iNewsID != 0) {
884						console.log("Remove MPU2");
885						$('#mpu-video-2').remove();
886					};
887				break;
888				default:
889					console.log("Yes ads");
890					
891					$('#barclayspodcast').show();
892						
893					var	iNewsID			=	$('#news-id').val();
894					
895					var REFRESH_KEY		=	'refresh';
896					var REFRESH_VALUE	=	'true';
897					
898					if (iNewsID != 0) {
899						
900						console.log("Remove MPU2");
901				
902						if ($('.surveyContainer').length == 0 ) {
903						
904							var PCount		=	$(".wrap-column-1").find("p").length;
905							
906							console.log("P Count : " + PCount);
907							
908							if (PCount < 2) {
909								//console.log("P Count Half " + PCountHalf);
910								var	PCountHalf	=	Math.round(PCount) - 1;
911							} else {
912								//console.log("P Count Half " + PCountHalf);
913								var	PCountHalf	=	Math.round(PCount / 2) - 1;
914								
915								if (PCountHalf == 3) {
916									PCountHalf	=	2;
917								}
918							};
919							
920							//console.log("P Count Half " + PCountHalf);
921						
922							$('.mpu-video-zone').insertAfter($('.wrap-column-1 p').eq(PCountHalf));
923							$('.ad-mpu-video-2').css('margin-bottom', '1.5rem');
924							
925							$('#wgt-popular-this-week').show();
926						
927							switch (device) {
928								case	'desktop':
929							
930									var	Article1Height	=	$('.wrap-column-1').height();
931									var	Article1Width	=	$('.wrap-column-1').width();
932									
933									if (Article1Height > 900) {
934										//$('#wgt-recent-news').insertAfter('#wgt-subscribe');
935										$('#wgt-cpd-news').insertAfter('#wgt-subscribe');
936										//$('#wgt-latest-event').show();
937									};
938									
939									if (Article1Height < 1800) {
940										$('#formComments').insertAfter('.wrap-column-1');
941										//$('.pst-box.black').insertAfter('#formComments');
942									};
943								break;
944							};
945						
946							DFPDesktopMPU2Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU2ZoneName, [[300, 250],[300, 600],[300, 601],[300, 251],[640, 360]], DFPDesktopMPU2ZoneID)
947																// .setTargeting("pageID", [DFPSiteSection])
948																// .setTargeting("articleID", [DFPArticleID])
949																// .setTargeting("articleContent", [DFPArticleContent])
950																.addService(googletag.pubads());
951						
952							DFPDesktopMPU2TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU2TrackerZoneName, [1, 1], DFPDesktopMPU2TrackerZoneID)
953																	// .setTargeting("pageID", [DFPSiteSection])
954																	// .setTargeting("articleID", [DFPArticleID])
955																	// .setTargeting("articleContent", [DFPArticleContent])
956																	.addService(googletag.pubads());
957																	
958							googletag.pubads().addEventListener('slotRenderEnded', function(event) {
959	
960								if (DFPDesktopMPU2Zone === event.slot) {
961									
962									console.log(' ');
963									console.log('MPU/Half Page 2 Campaign ID: ', event.campaignId);
964									console.log('MPU/Half Page 2 Creative ID: ', event.creativeId);
965									console.log('MPU/Half Page 2 Is empty?: ', event.isEmpty);
966									console.log('MPU/Half Page 2 Line Item ID: ', event.lineItemId);
967		
968									var containsMPU2 = event.isEmpty;
969									
970									if (containsMPU2  === false) {
971										
972										var	MPU2Width			=	event.size[0];
973										var	MPU2Height			=	event.size[1];
974				
975										var	MPU2ZoneWidth		=	($('#mpu-video-2').width());
976				
977										if (MPU2Width > 300) {
978										
979											var MPU2ScaleValue	=	MPU2ZoneWidth / MPU2Width;
980											
981											var MPU2HeightValue	=	MPU2Height * MPU2ScaleValue;
982											
983											$('.ad-mpu-video-2 iframe').css({
984												'-webkit-transform': 'scale(' + MPU2ScaleValue + ')',
985												'-moz-transform': 'scale(' + MPU2ScaleValue + ')',
986												'-ms-transform': 'scale(' + MPU2ScaleValue + ')',
987												'-o-transform': 'scale(' + MPU2ScaleValue + ')',
988												'transform': 'scale(' + MPU2ScaleValue + ')',
989												'transform-origin': 'top left'
990											});
991											$('.ad-mpu-video-2').css({
992												'height': MPU2HeightValue + 'px'
993											});
994											$('#mpu-video-2').css({
995												'height': MPU2HeightValue + 'px',
996												'margin-top': '20px',
997												'margin-bottom': '40px'
998											});
999										};
1000										
1001										if (MPU2Width < 640) {
1002											switch (device) {
1003												case	'desktop':
1004													$('.mpu-video-zone').css({'margin-right':'25px', 'float' :'left'});
1005												break;
1006											};
1007										};
1008									};
1009								};
1010								
1011							});
1012	
1013							googletag.pubads()
1014							.setTargeting("pageID", [DFPSiteSection])
1015							.setTargeting("articleID", [DFPArticleID])
1016							.setTargeting("articleContent", [DFPArticleContent])
1017							.refresh([
1018								DFPDesktopMPU2Zone,
1019								DFPDesktopMPU2TrackerZone
1020							]);
1021							
1022						};
1023						
1024					};
1025
1026					DFPPopUpZone						=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMFPPopUpZoneName, [[600, 480], [600, 400], [600, 508]], DFPMFPPopUpZoneID)
1027                                                             .addService(googletag.pubads());
1028					DFPPopUpTrackerZone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopPopUpFooterTrackerZoneName, [[3, 11]], DFPDesktopPopUpFooterTrackerZoneID)
1029															.addService(googletag.pubads());
1030					
1031					// DFPDesktopMPU4Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU4ZoneName, [[300, 250],[300, 600],[300, 604],[300, 254]], DFPDesktopMPU4ZoneID)
1032					// 										.addService(googletag.pubads());
1033		
1034					// DFPDesktopButton1Zone				=	googletag.defineSlot('/' + DFPFolder
1034Name + '/' + DFPDesktopButton1ZoneName, [300, 100], DFPDesktopButton1ZoneID)
1035					// 										.setTargeting(REFRESH_KEY, REFRESH_VALUE)
1036					// 										.setTargeting('test', 'event')
1037					// 										.addService(googletag.pubads());
1038															
1039					DFPDesktopAnchoredRibbonZone 		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopAnchoredRibbonZoneName, [[980, 90], [970, 90]], DFPDesktopAnchoredRibbonZoneID)
1040															.addService(googletag.pubads());										
1041				
1042					// DFPDesktopAnchoredRibbonTrackerZone	=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopAnchoredRibbonTrackerZoneName, [1, 1], DFPDesktopAnchoredRibbonTrackerZoneID)
1043					// 										.addService(googletag.pubads());
1044														
1045					googletag.pubads().addEventListener('slotRenderEnded', function(event) {
1046
1047						if (DFPPopUpZone	===	event.slot) {
1048
1049                            console.log(' ');
1050                            console.log('Pop-up Campaign ID: ', event.campaignId);
1051                            console.log('Pop-up Creative ID: ', event.creativeId);
1052                            console.log('Pop-up Is empty?: ', event.isEmpty);
1053                            console.log('Pop-up Line Item ID: ', event.lineItemId);
1054
1055                            var DFPCreativeId =   event.creativeId;
1056
1057                            var now, lastDatePopupShowed;
1058                            now = new Date();
1059
1060                            // if (localStorage.getItem('FRDFPPopUp' + DFPCreativeId) !== null) {
1061                            //     lastDatePopupShowed = new Date(parseInt(localStorage.getItem('FRDFPPopUp' + DFPCreativeId)));
1062                            // };
1063
1064                            // if (((now - lastDatePopupShowed) >= (3650 * 86400000)) || !lastDatePopupShowed) {
1065
1066                                // Get the modal
1067                                var modal = document.getElementById("dfp-popup-modal");
1068
1069                                // Get the <span> element that closes the modal
1070                                var span = document.getElementsByClassName("dfp-popup-close")[0];
1071
1072                                // When the user clicks on <span> (x), close the modal
1073                                span.onclick = function() {
1074                                    localStorage.setItem('FRDFPPopUp' + DFPCreativeId, now);
1075                                    modal.style.display = "none";
1076                                }
1077
1078                                // When the user clicks anywhere outside of the modal, close it
1079                                window.onclick = function(event) {
1080                                    if (event.target == modal) {
1081                                        modal.style.display = "none";
1082                                    };
1083                                };
1084
1085                                if (event.isEmpty == false) {
1086                                    modal.style.display = "block";
1087                                };
1088
1089                           // };
1090
1091                        };
1092						
1093					// 	// Button 1 Checks
1094					
1095					// 	if (DFPDesktopButton1Zone === event.slot) {
1096									
1097					// 		console.log(' ');
1098					// 		console.log('Button 1 ID: ', event.campaignId);
1099					// 		console.log('Button 1 Creative ID: ', event.creativeId);
1100					// 		console.log('Button 1 Is empty?: ', event.isEmpty);
1101					// 		console.log('Button 1 Line Item ID: ', event.lineItemId);
1102					
1103					// 		var containsButton1 = event.isEmpty;
1104							
1105					// 		if (containsButton1  === false) {
1106							
1107					// 		};
1108					// 	};
1109						
1110					// 	// MPU/Halfpage 4 Checks
1111						
1112					// 	if (DFPDesktopMPU4Zone === event.slot) {
1113							
1114					// 		console.log(' ');
1115					// 		console.log('MPU/Half Page 4 Campaign ID: ', event.campaignId);
1116					// 		console.log('MPU/Half Page 4 Creative ID: ', event.creativeId);
1117					// 		console.log('MPU/Half Page 4 Is empty?: ', event.isEmpty);
1118					// 		console.log('MPU/Half Page 4 Line Item ID: ', event.lineItemId);
1119					
1120					// 		var containsMPU4 = event.isEmpty;
1121				
1122					// 		if (containsMPU4  === false) {
1123								
1124					// 			MPU4Width			=	event.size[0];
1125					// 			MPU4Height			=	event.size[1];
1126				
1127					// 			if (device != 'mobile') {
1128									
1129					// 				switch (sHPTOCSS) {
1130					// 					case 'hpto':
1131					// 						$('#ab-1').remove();
1132					// 						$('#footer-banner').remove();
1133					// 						$('.ad-mpu-4').remove();
1134					// 						$('#mc-widget').show();
1135					// 					break;
1136					// 					default:
1137					// 						$('#mc-widget').hide();	
1138					// 					break;
1139					// 				};
1140									
1141					// 			}
1142					// 		} else {
1143					// 			$('#mc-widget').show();
1144					// 		};
1145					// 	};
1146						
1147						// Anchored Ribbon Checks
1148						
1149						if (DFPDesktopAnchoredRibbonZone === event.slot) {
1150							
1151							console.log(' ');
1152							console.log('Anchored Ribbon ID: ', event.campaignId);
1153							console.log('Anchored Ribbon Creative ID: ', event.creativeId);
1154							console.log('Anchored Ribbon Is empty?: ', event.isEmpty);
1155							console.log('Anchored Ribbon Line Item ID: ', event.lineItemId);
1156							
1157							var containsAnchoredRibbon	=	event.isEmpty;
1158							
1159							//console.log("Has no footer " + containsAnchoredRibbon);
1160							
1161							if (containsAnchoredRibbon === false) {
1162								
1163								if (readCookie("fb") == "banner") {	
1164									$("#footer-banner").show();//$("#footer-banner").remove();
1165									$('.go-top').css("bottom", "30px");
1166								} else {
1167				
1168									var sCSS = $('#' + DFPDesktopAnchoredRibbonZoneID + ' iframe').contents().find('img').attr("alt");
1169					
1170									$("#corner-slider").remove();
1171									
1172									if (sCSS === undefined || sCSS === null) {
1173									} else {
1174										$("#footer-banner").addClass(sCSS);
1175									}
1176									$(".section.bg-white").css("padding-bottom", "90px");
1177									$("#footer-banner").show();
1178									$("#footer-banner").css("bottom", "0px");
1179									$('.go-top').css("bottom", "120px");
1180								};
1181							} else {
1182								$("#footer-banner").remove();
1183								$('.go-top').css("bottom", "30px");
1184							};
1185						};
1186					});
1187					//alert ('Tada!');
1188					googletag.pubads()
1189					.setTargeting("pageID", [DFPSiteSection])
1190					.setTargeting("articleID", [DFPArticleID])
1191					.setTargeting("articleContent", [DFPArticleContent])
1192					.refresh([
1193						DFPPopUpZone,
1194						DFPPopUpTrackerZone,
1195						// DFPDesktopMPU4Zone,
1196						// DFPDesktopButton1Zone,
1197						DFPDesktopAnchoredRibbonZone
1198						// DFPDesktopAnchoredRibbonTrackerZone
1199					]);
1200					
1201					// $.fn.isInViewport = function() {
1202					// 	var elementTop = $(this).offset().top;
1203					// 	var elementBottom = elementTop + $(this).outerHeight();var viewportTop = $(window).scrollTop();
1204					// 	var viewportBottom = viewportTop + $(window).height();return elementBottom > viewportTop && elementTop < viewportBottom;
1205					// };
1206					
1207					var duration	=	30;
1208					var	screenState	=	'active';
1209					
1210					ifvisible.setIdleDuration(duration);
1211					
1212					ifvisible.on('statusChanged', function(e){
1213					
1214						screenState			=	e.status;
1215						
1216						//console.log("Out loop " + screenState);
1217						
1218						//d("page-result").innerHTML += (screenState+"<br>");
1219					});	
1220					
1221					// setTimeout(function() {
1222					
1223					// 	var i			=	1;
1224				
1225					// 	//var elem = document.getElementById('Timer');
1226					// 	function Countdown(options) {
1227					// 	  var timer,
1228					// 	  instance = this,
1229					// 	  seconds = options.seconds || duration,
1230					// 	  updateStatus = options.onUpdateStatus || function () {},
1231					// 	  counterEnd = options.onCounterEnd || function () {};
1232						
1233					// 	  function decrementCounter() {
1234					// 		updateStatus(seconds);
1235					// 		if (seconds === 0) {
1236					// 			seconds = duration;
1237					// 			if (seconds === duration) {
1238									
1239					// 				//d("refresh-result").innerHTML += (screenState+"<br>");
1240									
1241					// 				//console.log("In loop " + screenState);
1242									
1243					// 				switch (sHPTOCSS) {
1244					// 					case	'hpto':
1245					// 					break;
1246					// 					default:
1247					// 						switch (screenState) {
1248					// 							case	'active':
1249					// 								$('#ab-1, #bookend-left, #bookend-right, #mpu-zone-1, #footer-banner-content').animate({opacity: 0}, 500, function() {
1250														
1251														
1252					// 									$('#mpu-zone-1').each(function() {
1253					// 										if ($(this).isInViewport()) {
1254					// 											googletag.pubads()
1255					// 											.setTargeting("pageID", [DFPSiteSection])
1256					// 											.setTargeting("articleID", [DFPArticleID])
1257					// 											.setTargeting("articleContent", [DFPArticleContent])
1258					// 											.refresh([
1259					// 												DFPDesktopMPU1Zone,
1260					// 												DFPDesktopMPU1TrackerZone
1261					// 											]);	
1262					// 										};
1263					// 									});
1264														
1265					// 									$('#ab-1').each(function() {
1266					// 										if ($(this).isInViewport()) {
1267					// 											googletag.pubads()
1268					// 											.setTargeting("pageID", [DFPSiteSection])
1269					// 											.setTargeting("articleID", [DFPArticleID])
1270					// 											.setTargeting("articleContent", [DFPArticleContent])
1271					// 											.refresh([
1272					// 												DFPDesktopButton1Zone
1273					// 											]);	
1274					// 										};
1275					// 									});
1276														
1277					// 									googletag.pubads()
1278					// 									.setTargeting("pageID", [DFPSiteSection])
1279					// 									.setTargeting("articleID", [DFPArticleID])
1280					// 									.setTargeting("articleContent", [DFPArticleContent])
1281					// 									.refresh([
1282					// 										//DFPDesktopBookendLeftZone,
1283					// 										//DFPDesktopBookendLeftTrackerZone,
1284					// 										//DFPDesktopBookendRightZone,
1285					// 										//DFPDesktopBookendRightTrackerZone,
1286					// 										DFPDesktopAnchoredRibbonZone,
1287					// 										DFPDesktopAnchoredRibbonTrackerZone
1288					// 									]);
1289					// 									setTimeout(function(){
1290					// 										//$('#ab-1, #bookend-left, #bookend-right, #mpu-zone-1, #footer-banner-content').animate({opacity: 1}, 500);
1291					// 										$('#ab-1, #bookend-left, #bookend-right, #mpu-zone-1').animate({opacity: 1}, 500);
1292					// 									}, 1000);
1293					// 								});
1294													
1295					// 							break;
1296					// 						};
1297					// 					break;
1298					// 				};
1299					// 			};
1300					// 		} else {
1301					// 			seconds--;
1302					// 		}
1303					// 	  }
1304						
1305					// 	  this.start = function () {
1306					// 		clearInterval(timer);
1307					// 		timer = 0;
1308					// 		seconds = options.seconds;
1309					// 		timer = setInterval(decrementCounter, 1000);
1310					// 	  };
1311					// 	}
1312						
1313					// 	var myCounter = new Countdown({  
1314					// 		seconds: duration,  // number of seconds to count down
1315					// 		//onUpdateStatus: function(sec){elem.innerHTML = sec + ' seconds remaining';}, // callback for each second
1316					// 		onCounterEnd: function(){  myCounter.start(); } // final action
1317					// 	});
1318						
1319					// 	myCounter.start();
1320						
1321					// 	// console.log("Begin pop up check");
1322						
1323					// }, 10000);
1324				break;
1325			};
1326		};
1327
1328	break;
1329	case	'mobile':
1330
1331		googletag.cmd.push(function() {
1332			
1333			googletag.pubads().disableInitialLoad();
1334			googletag.pubads().collapseEmptyDivs();
1335			googletag.pubads().enableSingleRequest();
1336			googletag.enableServices();
1337			
1338//			console.log(DFPMobileBillboardTopZoneName);
1339//			console.log(DFPMobileBillboardBottomZoneName);
1340//			console.log(DFPMobileMPUTopZoneName);
1341//			console.log(DFPMobileMPUBottomZoneName);
1342			
1343			var	iNewsID							=	$('#news-id').val();
1344			
1345			HPTOAltTagTrackerZone				=	googletag.defineSlot('/' + DFPFolderName + '/' + HPTOAltTagTrackerZoneName, [2, 2], HPTOAltTagTrackerZoneID)
1346													.addService(googletag.pubads());
1347			
1348			// DFPDesktopHP1TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopHP1TrackerZoneName, [1, 1], DFPDesktopHP1TrackerZoneID)
1349			// 										.addService(googletag.pubads());
1350			
1351			DFPDesktopBillboard1Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMobileBillboardTopZoneName, [[970, 250], [980, 60], [980, 250], [980, 251], [320, 100], [320, 101]], DFPDesktopBillboard1ZoneID)
1352													.addService(googletag.pubads());
1353													
1354			DFPDesktopBillboard2Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMobileBillboardBottomZoneName, [[970, 250], [980, 60], [980, 250], [980, 252], [320, 100], [320, 102]], DFPDesktopBillboard2ZoneID)
1355													 .addService(googletag.pubads());
1356
1357			// DFPDesktopBillboard5Zone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMobileBillboardMiddleZoneName, [[970, 250], [980, 60], [980, 250]], DFPMobileBillboardMiddleZoneID)
1358			// 										.addService(googletag.pubads());
1359
1360			DFPDesktopMPU1Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMobileMPUTopZoneName, [[300, 250],[300, 600],[300, 602],[300, 252]], DFPDesktopMPU1ZoneID)
1361													.addService(googletag.pubads());
1362			
1363			DFPDesktopMPU3Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMobileMPUBottomZoneName, [[300, 250],[300, 600],[300, 602],[300, 252]], DFPDesktopMPU3ZoneID)
1364													.addService(googletag.pubads());
1365
1366			// DFPDesktopBillboard1TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard1TrackerZoneName, [1, 1], DFPDesktopBillboard1TrackerZoneID)
1367			// 										.addService(googletag.pubads());
1368													
1369			// DFPDesktopBillboard2TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard2TrackerZoneName, [1, 1], DFPDesktopBillboard2TrackerZoneID)
1370			// 										.addService(googletag.pubads());
1371													
1372			// DFPDesktopBillboard3TrackerZone		=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopBillboard3TrackerZoneName, [1, 1], DFPDesktopBillboard3TrackerZoneID)
1373			// 										.addService(googletag.pubads());
1374													
1375			// DFPDesktopMPU1TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU1TrackerZoneName, [1, 1], DFPDesktopMPU1TrackerZoneID)
1376			// 										.addService(googletag.pubads());
1377													
1378			// DFPDesktopMPU3TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU3TrackerZoneName, [1, 1], DFPDesktopMPU3TrackerZoneID)
1379			// 										.addService(googletag.pubads());
1380													
1381			// DFPDesktopPodCastTrackerZone		=	googletag.defineSlot('/' + DFPFolder
1381Name + '/' + DFPDesktopPodCastTrackerZoneName, [1, 1], DFPDesktopPodCastTrackerZoneID)
1382			// 										.addService(googletag.pubads());
1383			
1384			googletag.pubads().addEventListener('slotRenderEnded', function(event) {
1385				
1386				// Billboard 1 Tracker Checks
1387				
1388				var sHPTOCSS	=	'';
1389				
1390				// HPTO Alt Tag  Tracker Checks
1391	
1392				if (HPTOAltTagTrackerZone === event.slot) {
1393					
1394					console.log(' ');
1395					console.log('HPTO Alt Tag Tracker Campaign ID: ', event.campaignId);
1396					console.log('HPTO Alt Tag Tracker Creative ID: ', event.creativeId);
1397					console.log('HPTO Alt Tag Tracker Is empty?: ', event.isEmpty);
1398					console.log('HPTO Alt Tag Tracker Line Item ID: ', event.lineItemId);
1399		
1400					var containsHPTOAltTagTracker1 = event.isEmpty;
1401		
1402					if (containsHPTOAltTagTracker1  === false) {
1403			
1404						var sHPTOCSS			=	$('#' + HPTOAltTagTrackerZoneID + ' iframe').contents().find('img').attr("alt");
1405		
1406						$('#hpto-alt').val(sHPTOCSS);
1407						
1408					// 	switch (sHPTOCSS) {
1409					// 		case	'hpto':
1410						
1411					// 			var sPodCast			=	$('#' + DFPDesktopBillboard1ZoneID + ' iframe').contents().find('img').attr("alt");
1412								
1413					// 			switch (sPodCast) {
1414					// 				case	'barclayspodcast':
1415					// 					$('#barclayspodcast').show();
1416					// 				break;
1417					// 				default:
1418					// 					$('#barclayspodcast').hide();
1419					// 				break;
1420					// 			};
1421					// 		break;
1422					// 		default:
1423					// 			$('#barclayspodcast').show();
1424					// 		break;
1425					// 	};
1426					
1427					// } else {
1428					// 	$('#barclayspodcast').show();
1429					} else {
1430						loadExtraMobZones(sHPTOCSS);
1431					};
1432					
1433				};
1434							
1435				// Billboard 1 Checks
1436				
1437				if (DFPDesktopBillboard1Zone === event.slot) {
1438			
1439					console.log(' ');
1440					console.log('Billboard 1 Campaign ID: ', event.campaignId);
1441					console.log('Billboard 1 Creative ID: ', event.creativeId);
1442					console.log('Billboard 1 Is empty?: ', event.isEmpty);
1443					console.log('Billboard 1 Line Item ID: ', event.lineItemId);
1444		
1445					var containsBillboard1 = event.isEmpty;
1446		
1447					if (containsBillboard1  === false) {
1448						
1449						goToPodcast();
1450						
1451						Billboard1Width		=	event.size[0];
1452						Billboard1Height	=	event.size[1];
1453		
1454						if (Billboard1Height === undefined) {
1455							Billboard1Height = 0;
1456						};
1457						
1458						$(window).on("load resize",function(e){
1459							
1460							Billboard1ZoneWidth	=	$('#bb-1').width();
1461							
1462							if (Billboard1ZoneWidth < 980) {
1463							
1464								Billboard1ScaleValue	=	Billboard1ZoneWidth / Billboard1Width;			
1465								Billboard1HeightValue	=	Billboard1Height * Billboard1ScaleValue;
1466								
1467							} else {
1468								
1469								Billboard1ScaleValue	=	1.00;
1470								Billboard1HeightValue	=	250;
1471						
1472							};
1473							$('.ad-billboard-1 iframe').css({
1474								'-webkit-transform': 'scale(' + Billboard1ScaleValue + ')',
1475								'-moz-transform': 'scale(' + Billboard1ScaleValue + ')',
1476								'-ms-transform': 'scale(' + Billboard1ScaleValue + ')',
1477								'-o-transform': 'scale(' + Billboard1ScaleValue + ')',
1478								'transform': 'scale(' + Billboard1ScaleValue + ')',
1479								'transform-origin': 'top left'
1480							});
1481							$('.ad-billboard-1').css({
1482								'height': Billboard1HeightValue + 'px'
1483							});
1484							$('#bb-1').css({
1485								'height': Billboard1HeightValue + 'px'
1486							});
1487							
1488						});
1489		
1490					};
1491					
1492				};
1493				
1494				
1495				// Billboard 2 Checks
1496				
1497				if (DFPDesktopBillboard2Zone === event.slot) {
1498			
1499					console.log(' ');
1500					console.log('Billboard 2 Campaign ID: ', event.campaignId);
1501					console.log('Billboard 2 Creative ID: ', event.creativeId);
1502					console.log('Billboard 2 Is empty?: ', event.isEmpty);
1503					console.log('Billboard 2 Line Item ID: ', event.lineItemId);
1504		
1505					var containsBillboard2 = event.isEmpty;
1506		
1507					if (containsBillboard2  === false) {
1508						
1509						goToPodcast();
1510					
1511						Billboard2Width		=	event.size[0];
1512						Billboard2Height	=	event.size[1];
1513		
1514						if (Billboard2Height === undefined) {
1515							Billboard2Height = 0;
1516						};
1517						
1518						$(window).on("load resize",function(e){
1519		
1520							Billboard2ZoneWidth	=	$('#bb-2').width();
1521							
1522							if (Billboard2ZoneWidth < 980) {
1523							
1524								Billboard2ScaleValue	=	Billboard2ZoneWidth / Billboard2Width;			
1525								Billboard2HeightValue	=	Billboard2Height * Billboard2ScaleValue;
1526								
1527							} else {
1528								
1529								Billboard2ScaleValue	=	1.00;
1530								Billboard2HeightValue	=	250;
1531						
1532							};
1533							$('.ad-billboard-2 iframe').css({
1534								'-webkit-transform': 'scale(' + Billboard2ScaleValue + ')',
1535								'-moz-transform': 'scale(' + Billboard2ScaleValue + ')',
1536								'-ms-transform': 'scale(' + Billboard2ScaleValue + ')',
1537								'-o-transform': 'scale(' + Billboard2ScaleValue + ')',
1538								'transform': 'scale(' + Billboard2ScaleValue + ')',
1539								'transform-origin': 'top left'
1540							});
1541							$('.ad-billboard-2').css({
1542								'height': Billboard2HeightValue + 'px'
1543							});
1544							$('#bb-2').css({
1545								'height': Billboard2HeightValue + 'px',
1546								'margin-top': '20px',
1547								'margin-bottom': '40px'
1548							});
1549							
1550						});
1551					};
1552				};
1553				
1554				// Billboard 5 Checks
1555
1556				// if (DFPDesktopBillboard5Zone === event.slot) {
1557			
1558				// 	console.log(' ');
1559				// 	console.log('Billboard 5 Campaign ID: ', event.campaignId);
1560				// 	console.log('Billboard 5 Creative ID: ', event.creativeId);
1561				// 	console.log('Billboard 5 Is empty?: ', event.isEmpty);
1562				// 	console.log('Billboard 5 Line Item ID: ', event.lineItemId);
1563		
1564				// 	var containsBillboard5 = event.isEmpty;
1565		
1566				// 	if (containsBillboard5  === false) {
1567						
1568				// 		goToPodcast();
1569						
1570				// 		Billboard5Width		=	event.size[0];
1571				// 		Billboard5Height	=	event.size[1];
1572		
1573				// 		if (Billboard5Height === undefined) {
1574				// 			Billboard5Height = 0;
1575				// 		};
1576						
1577				// 		$(window).on("load resize",function(e){
1578		
1579				// 			Billboard5ZoneWidth	=	$('#bb-5').width();
1580							
1581				// 			if (Billboard5ZoneWidth < 980) {
1582							
1583				// 				Billboard5ScaleValue	=	Billboard5ZoneWidth / Billboard5Width;			
1584				// 				Billboard5HeightValue	=	Billboard5Height * Billboard5ScaleValue;
1585								
1586				// 			} else {
1587								
1588				// 				Billboard5ScaleValue	=	1.00;
1589				// 				Billboard5HeightValue	=	250;
1590						
1591				// 			};
1592				// 			$('.ad-billboard-5 iframe').css({
1593				// 				'-webkit-transform': 'scale(' + Billboard5ScaleValue + ')',
1594				// 				'-moz-transform': 'scale(' + Billboard5ScaleValue + ')',
1595				// 				'-ms-transform': 'scale(' + Billboard5ScaleValue + ')',
1596				// 				'-o-transform': 'scale(' + Billboard5ScaleValue + ')',
1597				// 				'transform': 'scale(' + Billboard5ScaleValue + ')',
1598				// 				'transform-origin': 'top left'
1599				// 			});
1600				// 			$('.ad-billboard-5').css({
1601				// 				'height': Billboard5HeightValue + 'px'
1602				// 			});
1603				// 			$('#bb-5').css({
1604				// 				'height': Billboard5HeightValue + 'px',
1605				// 				'margin-top': '20px',
1606				// 				'margin-bottom': '40px'
1607				// 			});
1608							
1609				// 		});
1610				// 	} else {
1611				// 		$('#bb-5').height(0);	
1612				// 	};
1613				// };
1614				
1615				if (DFPDesktopMPU1Zone === event.slot) {
1616					
1617					console.log(' ');
1618					console.log('MPU/Half Page 1 Campaign ID: ', event.campaignId);
1619					console.log('MPU/Half Page 1 Creative ID: ', event.creativeId);
1620					console.log('MPU/Half Page 1 Is empty?: ', event.isEmpty);
1621					console.log('MPU/Half Page 1 Line Item ID: ', event.lineItemId);
1622					
1623					var containsMPU1 = event.isEmpty;
1624		
1625					if (containsMPU1  === false) {
1626						
1627						goToPodcast();
1628						
1629						MPU1Width			=	event.size[0];
1630						MPU1Height			=	event.size[1];
1631						
1632						if(window.location.hash) {
1633							var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
1634							switch (hash) {
1635								case	'barclayspodcast':
1636									$("#barclayspodcast").show();
1637									setTimeout(function() {
1638										$('html, body').animate({
1639											scrollTop: $("#barclayspodcast").offset().top -100
1640										}, 500);
1641										$('#barclayspodcast').addClass('barclays-podcast-pulse');
1642									}, 1000);
1643								break;
1644							}
1645						};
1646					};
1647				};
1648				
1649				// if (DFPDesktopMPU2Zone === event.slot) {
1650					
1651				// 	console.log(' ');
1652				// 	console.log('MPU/Half Page 2 Campaign ID: ', event.campaignId);
1653				// 	console.log('MPU/Half Page 2 Creative ID: ', event.creativeId);
1654				// 	console.log('MPU/Half Page 2 Is empty?: ', event.isEmpty);
1655				// 	console.log('MPU/Half Page 2 Line Item ID: ', event.lineItemId);
1656					
1657				// 	var containsMPU2 = event.isEmpty;
1658		
1659				// 	if (containsMPU2  === false) {
1660						
1661				// 		goToPodcast();
1662						
1663				// 		MPU2Width			=	event.size[0];
1664				// 		MPU2Height			=	event.size[1];
1665				// 	};
1666				// };
1667				
1668				if (DFPDesktopMPU3Zone === event.slot) {
1669					
1670					console.log(' ');
1671					console.log('MPU/Half Page 3 Campaign ID: ', event.campaignId);
1672					console.log('MPU/Half Page 3 Creative ID: ', event.creativeId);
1673					console.log('MPU/Half Page 3 Is empty?: ', event.isEmpty);
1674					console.log('MPU/Half Page 3 Line Item ID: ', event.lineItemId);
1675					
1676					var containsMPU3 = event.isEmpty;
1677		
1678					if (containsMPU3  === false) {
1679						
1680						goToPodcast();
1681						
1682						MPU3Width			=	event.size[0];
1683						MPU3Height			=	event.size[1];
1684					};
1685				};
1686				
1687			});
1688			
1689			$(window).on("load resize",function(e){
1690				$('.bookend-zone').remove();
1691				$('#bb-3').remove();
1692				$('#bb-4').remove();
1693			});
1694			
1695			if (iNewsID != 0) {
1696				googletag.pubads()
1697				.setTargeting("pageID", [DFPSiteSection])
1698				.setTargeting("articleID", [DFPArticleID])
1699				.setTargeting("articleContent", [DFPArticleContent])
1700				.refresh([
1701					HPTOAltTagTrackerZone,
1702					DFPDesktopBillboard1Zone,
1703					DFPDesktopBillboard2Zone,
1704					// DFPDesktopBillboard5Zone,
1705					DFPDesktopMPU1Zone,
1706					DFPDesktopMPU3Zone
1707					//DFPDesktopMPU3TrackerZone,
1708					//DFPDesktopBillboard1TrackerZone,
1709					//DFPDesktopBillboard2TrackerZone,
1710					//DFPDesktopMPU1TrackerZone,
1711					//DFPDesktopMPU3TrackerZone,
1712					//DFPDesktopPodCastTrackerZone
1713				]);	
1714			} else {
1715				googletag.pubads()
1716				.setTargeting("pageID", [DFPSiteSection])
1717				.setTargeting("articleID", [DFPArticleID])
1718				.setTargeting("articleContent", [DFPArticleContent])
1719				.refresh([
1720					HPTOAltTagTrackerZone,
1721					DFPDesktopBillboard1Zone,
1722					DFPDesktopBillboard2Zone,
1723					DFPDesktopMPU1Zone,
1724					DFPDesktopMPU3Zone
1725					//DFPDesktopMPU3TrackerZone,
1726					//DFPDesktopBillboard1TrackerZone,
1727					//DFPDesktopBillboard2TrackerZone,
1728					//DFPDesktopMPU1TrackerZone,
1729					//DFPDesktopMPU3TrackerZone,
1730					//DFPDesktopPodCastTrackerZone
1731				]);
1732			};
1733			
1734			if (iNewsID != 0) {
1735				
1736				if ($('.surveyContainer').length == 0 ) {
1737				
1738					var PCount		=	$(".wrap-column-1").find("p").length;
1739						
1740					if (PCount < 2) {
1741						var	PCountHalf	=	Math.round(PCount) - 1;
1742					} else {
1743						var	PCountHalf	=	Math.round(PCount / 2) - 1;
1744					};
1745				
1746					$('.mpu-video-zone').insertAfter($('.wrap-column-1 p').eq(PCountHalf));
1747					$('.ad-mpu-video-2').css('margin-bottom', '1.5rem');
1748					
1749					$('#wgt-popular-this-week').show();
1750				
1751					switch (device) {
1752						case	'desktop':
1753					
1754							var	Article1Height	=	$('.wrap-column-1').height();
1755							var	Article1Width	=	$('.wrap-column-1').width();
1756							
1757							if (Article1Height > 900) {
1758								//$('#wgt-recent-news').insertAfter('#wgt-subscribe');
1759								$('#wgt-cpd-news').insertAfter('#wgt-subscribe');
1760								//$('#wgt-latest-event').show();
1761							};
1762							
1763							if (Article1Height < 1800) {
1764								$('#formComments').insertAfter('.wrap-column-1');
1765								//$('.pst-box.black').insertAfter('#formComments');
1766							};
1767						break;
1768					};
1769					
1770				};
1771				
1772				DFPDesktopMPU2Zone					=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU2ZoneName, [[300, 250],[300, 600],[300, 601],[300, 251],[640, 360]], DFPDesktopMPU2ZoneID)
1773														.addService(googletag.pubads());
1774			
1775				DFPDesktopMPU2TrackerZone			=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopMPU2TrackerZoneName, [1, 1], DFPDesktopMPU2TrackerZoneID)
1776														.addService(googletag.pubads());
1777														
1778				googletag.pubads().addEventListener('slotRenderEnded', function(event) {
1779				
1780					if (DFPDesktopMPU2Zone			===	event.slot) {
1781						
1782						console.log(' ');
1783						console.log('MPU/Half Page 2 Campaign ID: ', event.campaignId);
1784						console.log('MPU/Half Page 2 Creative ID: ', event.creativeId);
1785						console.log('MPU/Half Page 2 Is empty?: ', event.isEmpty);
1786						console.log('MPU/Half Page 2 Line Item ID: ', event.lineItemId);
1787
1788						var containsMPU2 = event.isEmpty;
1789						
1790						if (containsMPU2  === false) {
1791							
1792							var	MPU2Width			=	event.size[0];
1793							var	MPU2Height			=	event.size[1];
1794	
1795							var	MPU2ZoneWidth		=	($('#mpu-video-2').width());
1796	
1797							if (MPU2Width > 300) {
1798							
1799								var MPU2ScaleValue	=	MPU2ZoneWidth / MPU2Width;
1800								
1801								var MPU2HeightValue	=	MPU2Height * MPU2ScaleValue;
1802								
1803								$('.ad-mpu-video-2 iframe').css({
1804									'-webkit-transform': 'scale(' + MPU2ScaleValue + ')',
1805									'-moz-transform': 'scale(' + MPU2ScaleValue + ')',
1806									'-ms-transform': 'scale(' + MPU2ScaleValue + ')',
1807									'-o-transform': 'scale(' + MPU2ScaleValue + ')',
1808									'transform': 'scale(' + MPU2ScaleValue + ')',
1809									'transform-origin': 'top left'
1810								});
1811								$('.ad-mpu-video-2').css({
1812									'height': MPU2HeightValue + 'px'
1813								});
1814								$('#mpu-video-2').css({
1815									'height': MPU2HeightValue + 'px',
1816									'margin-top': '20px',
1817									'margin-bottom': '40px'
1818								});
1819							};
1820							
1821							if (MPU2Width < 640) {
1822								switch (device) {
1823									case	'desktop':
1824										$('.mpu-video-zone').css({'margin-right':'25px', 'float' :'left'});
1825									break;
1826								};
1827							};
1828						};
1829					};
1830				});
1831
1832				googletag.pubads()
1833				.setTargeting("pageID", [DFPSiteSection])
1834				.setTargeting("articleID", [DFPArticleID])
1835				.setTargeting("articleContent", [DFPArticleContent])
1836				.refresh([
1837					DFPDesktopMPU2Zone,
1838					DFPDesktopMPU2TrackerZone
1839				]);
1840				
1841			};
1842
1843		});
1844
1845		var extraMobZonesLoaded = false;
1846
1847		function loadExtraMobZones(sHPTOCSS) {
1848
1849			if (extraMobZonesLoaded) {
1850				return; // Prevent multiple calls
1851			}
1852			extraMobZonesLoaded = true;
1853				
1854			DFPPopUpZone = googletag.defineSlot('/' + DFPFolderName + '/' + DFPMFPPopUpZoneName, [[600, 480], [600, 400], [600, 508]], DFPMFPPopUpZoneID)
1855							.addService(googletag.pubads());
1856			
1857			DFPPopUpTrackerZone = googletag.defineSlot('/' + DFPFolderName + '/' + DFPDesktopPopUpFooterTrackerZoneName, [[3, 11]], DFPDesktopPopUpFooterTrackerZoneID)
1858									.addService(googletag.pubads());
1859			
1860			googletag.pubads().addEventListener('slotRenderEnded', function(event) {
1861
1862				if (DFPPopUpZone === event.slot) {
1863
1864					console.log(' ');
1865					console.log('Pop-up Campaign ID: ', event.campaignId);
1866					console.log('Pop-up Creative ID: ', event.creativeId);
1867					console.log('Pop-up Is empty?: ', event.isEmpty);
1868					console.log('Pop-up Line Item ID: ', event.lineItemId);
1869
1870					var DFPCreativeId = event.creativeId;
1871
1872					var now, lastDatePopupShowed;
1873					now = new Date();
1874
1875					// if (localStorage.getItem('FRDFPPopUp' + DFPCreativeId) !== null) {
1876					// 	lastDatePopupShowed = new Date(parseInt(localStorage.getItem('FRDFPPopUp' + DFPCreativeId)));
1877					// };
1878
1879					// if (((now - lastDatePopupShowed) >= (3650 * 86400000)) || !lastDatePopupShowed) {
1880
1881						// Get the modal
1882						var modal = document.getElementById("dfp-popup-modal");
1883
1884						// Get the <span> element that closes the modal
1885						var span = document.getElementsByClassName("dfp-popup-close")[0];
1886
1887						// Function to handle popup resizing
1888						function resizePopup() {
1889							var ScreenWidth = $(window).width();
1890							var PopUpHeight = $('#dfp-popup-modal .dfp-popup-modal-content').height();
1891							
1892							var PopUpZoneWidth = $('#dfp-popup-modal iframe').width();
1893							var PopUpZoneHeight = $('#dfp-popup-modal iframe').height();
1894							
1895							// Check if iframe has valid dimensions before resizing
1896							if (PopUpZoneWidth > 0 && PopUpZoneHeight > 0 && ScreenWidth > 0) {
1897								// Use screen width with 25px padding on each side
1898								var TargetWidth = ScreenWidth - 50; // 25px on each side
1899								var PopUpScaleValue = TargetWidth / PopUpZoneWidth;			
1900								var PopUpHeightValue = PopUpZoneHeight * PopUpScaleValue;
1901								
1902								$('#dfp-popup-modal iframe').css({
1903									'-webkit-transform': 'scale(' + PopUpScaleValue + ')',
1904									'-moz-transform': 'scale(' + PopUpScaleValue + ')',
1905									'-ms-transform': 'scale(' + PopUpScaleValue + ')',
1906									'-o-transform': 'scale(' + PopUpScaleValue + ')',
1907									'transform': 'scale(' + PopUpScaleValue + ')',
1908									'transform-origin': 'top left'
1909								});
1910								
1911								$('#dfp-popup-modal').css({
1912									'display': 'block'
1913								});
1914
1915								// $('#dfp-popup-modal .dfp-popup-modal-content').css({
1916								// 	'height': PopUpHeightValue + 'px',
1917								// });
1918
1919								$('#dfp-popup-modal .dfp-popup-modal-content').css({
1920									'height': PopUpHeightValue + 'px',
1921									'width': TargetWidth + 'px',
1922									// 'left': 'calc(50% - 10px)'
1923								});
1924								
1925							} else {
1926								// Retry after a short delay if dimensions aren't ready
1927								setTimeout(resizePopup, 200);
1928							}
1929						}
1930
1931						// When the user clicks on <span> (x), close the modal
1932						span.onclick = function() {
1933							localStorage.setItem('FRDFPPopUp' + DFPCreativeId, now);
1934							modal.style.display = "none";
1935							$(window).off('resize.popup'); // Clean up resize event listener
1936						}
1937
1938						// When the user clicks anywhere outside of the modal, close it
1939						window.onclick = function(event) {
1940							if (event.target == modal) {
1941								modal.style.display = "none";
1942								$(window).off('resize.popup'); // Clean up resize event listener
1943							};
1944						};
1945
1946						if (event.isEmpty == false) {
1947							modal.style.display = "block";
1948							
1949							// Initial resize
1950							resizePopup();
1951							
1952							// Add resize event listener with namespace
1953							$(window).on('resize.popup', resizePopup);
1954						};
1955
1956					// };
1957
1958				};
1959			});
1960
1961			googletag.pubads()
1962			.setTargeting("pageID", [DFPSiteSection])
1963			.setTargeting("articleID", [DFPArticleID])
1964			.setTargeting("articleContent", [DFPArticleContent])
1965			.refresh([
1966				DFPPopUpZone,
1967				DFPPopUpTrackerZone
1968			]);
1969        };
1970		
1971	break;
1972};
1973$(window).load(function(){
1974	
1975	goToPodcast();
1976
1977});
1978//$(window).load(function (event) {
1979//	var monitor = setInterval(function(event){
1980//		var elem = document.activeElement;
1981//		if(elem && elem.tagName == 'IFRAME'){
1982//			clearInterval(monitor);
1983//			event.preventDefault();
1984//			alert('clicked!');
1985//		};
1986//	}, 100);
1987//});
1988
1989//googletag.cmd.push(function() {
1990//
1991//	DFPPopUpZone						=	googletag.defineSlot('/' + DFPFolderName + '/' + DFPMFPPopUpZoneName, [[600, 480], [600, 400], [600, 508]], DFPMFPPopUpZoneID)
1992//											.addService(googletag.pubads());
1993//											
1994//	console.log(DFPMFPPopUpZoneName + ' - ' + DFPMFPPopUpZoneID);
1995//											
1996//	googletag.pubads().addEventListener('slotRenderEnded', function(event) {
1997//													
1998//		// Pop-up Checks
1999//		
2000//		googletag.pubads().disableInitialLoad();
2001//		googletag.pubads().collapseEmptyDivs();
2002//		googletag.pubads().enableSingleRequest();
2003//		googletag.enableServices();
2004//		
2005//		if (DFPPopUpZone	===	event.slot) {
2006//			
2007//			console.log(' ');
2008//			console.log('Pop-up Campaign ID: ', event.campaignId);
2009//			console.log('Pop-up Creative ID: ', event.creativeId);
2010//			console.log('Pop-up Is empty?: ', event.isEmpty);
2011//			console.log('Pop-up Line Item ID: ', event.lineItemId);
2012//			
2013//		};
2014//		
2015//		googletag.pubads()
2016//		.setTargeting("pageID", [DFPSiteSection])
2017//		.setTargeting("articleID", [DFPArticleID])
2018//		.setTargeting("articleContent", [DFPArticleContent])
2019//		.refresh([
2020//			DFPPopUpZone
2021//		]);
2022//		
2023//	});
2024//});
2025
2026$(document).ready(function() {
2027						
2028//	console.log("Has pop up");
2029//
2030//	var sEventID = $('#' + DFPMFPPopUpZoneID + ' iframe').contents().find('img').attr("alt");
2031//	
2032//	var now, lastDatePopupShowed;
2033//	now = new Date();
2034//	
2035//	if (localStorage.getItem('FRDFPPopUp' + sEventID) !== null) {
2036//		lastDatePopupShowed = new Date(parseInt(localStorage.getItem('FRDFPPopUp' + sEventID)));
2037//	};
2038//
2039//	if (((now - lastDatePopupShowed) >= (3650 * 86400000)) || !lastDatePopupShowed) {
2040//		$.magnificPopup.open({
2041//			items: {src: '#js-dfp-popup'},
2042//			type:'inline',
2043//			midClick: true,
2044//			fixedContentPos: false,
2045//			closeMarkup: '<span id="footer-banner-close" class="mfp-close dfp-popup-close"><i class="fa fa-times" aria-hidden="true"></i></span>',
2046//			closeOnBgClick:true,
2047//			mainClass: 'mfp-fade-top',
2048//			callbacks:{
2049//				open: function() {
2050//					
2051//					googletag.pubads().refresh([DFPPopUpZone]);
2052//				
2053//				},	
2054//				resize: function() {
2055//					
2056//					var PopUpWidth		=	$('#js-dfp-popup').width();
2057//					var PopUpHeight		=	$('#js-dfp-popup').width();
2058//					
2059//					var PopUpZoneWidth	=	$('#js-dfp-popup iframe').width();
2060//					var PopUpZoneHeight	=	$('#js-dfp-popup iframe').height();
2061//				
2062//						
2063//					var PopUpScaleValue		=	PopUpWidth / PopUpZoneWidth;			
2064//					var PopUpHeightValue	=	PopUpZoneHeight * PopUpScaleValue;
2065//					
2066//					$('.dfp-pop-up iframe').css({
2067//						'-webkit-transform': 'scale(' + PopUpScaleValue + ')',
2068//						'-moz-transform': 'scale(' + PopUpScaleValue + ')',
2069//						'-ms-transform': 'scale(' + PopUpScaleValue + ')',
2070//						'-o-transform': 'scale(' + PopUpScaleValue + ')',
2071//						'transform': 'scale(' + PopUpScaleValue + ')',
2072//						'transform-origin': 'top left'
2073//					});
2074//					
2075//					$('.dfp-pop-up').css({
2076//						'height': PopUpHeightValue + 'px'
2077//					});
2078//					
2079//					$('#js-dfp-popup').css({
2080//						'height': PopUpHeightValue + 'px'
2081//					});
2082//					
2083//				}  
2084//			}
2085//		}, 0);
2086//		$('.dfp-popup-close').on( "click", function() {
2087//		  localStorage.setItem('FRDFPPopUp' + sEventID, now);
2088//		  $.magnificPopup.close();
2089//		});
2090//	};
2091
2092	
2093	$( "#footer-banner-close" ).on( "click", function() {
2094		var date = new Date();
2095		var minutes = 1440;
2096		date.setTime(date.getTime() + (minutes * 60 * 1000));
2097		createCookie("fb", "banner", { expires: date });
2098		$("#footer-banner").hide();
2099		$("#footer-banner").removeClass('active');
2100		$('.go-top').css("bottom", "30px");
2101	});
2102
2103	if(window.location.hash) {
2104		var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
2105		switch (hash) {
2106			case	'barclayspodcast':
2107				$('#barclayspodcast').show();
2108				$('#barclayspodcast').removeClass('barclays-podcast-pulse');
2109				setTimeout(function() {
2110					$('html, body').animate({
2111						scrollTop: $("#barclayspodcast").offset().top -100
2112					}, 500);
2113					$('#barclayspodcast').addClass('barclays-podcast-pulse');
2114				}, 1000);
2115			break;
2116		};
2117	};
2118
2119	function findGetParameter(parameterName) {
2120		var result = null,
2121			tmp = [];
2122		location.search
2123		.substr(1)
2124			.split("&")
2125			.forEach(function (item) {
2126			tmp = item.split("=");
2127			if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
2128		});
2129		return result;
2130	}
2131
2132});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.