(function ($, Drupal, window, document) { Drupal.behaviors.js_defer = { attach: function(context, settings) { if (typeof Drupal.settings.js_defer !== 'undefined' && Drupal.settings.js_defer.processed !== true) { // prevent double running of behavoir Drupal.settings.js_defer.processed = true; var self = this; // Load with onload if (typeof Drupal.settings.js_defer.onLoad !== 'undefined'){ $(window).load(function() { self.loadScripts(Drupal.settings.js_defer.onLoad); }); } // Load with onReady if (typeof Drupal.settings.js_defer.onReady !== 'undefined'){ self.loadScripts(Drupal.settings.js_defer.onReady); } } }, loadScripts: function(files){ var head = document.getElementsByTagName('head').item(0); var self = this; for (var i=0; i < files.length; i++) { var file = files[i]; // Modernizr test, currently only accepts tests that return a boolean if (typeof Modernizr !== 'undefined' && typeof file.modernizr !== 'undefined') { if (typeof Modernizr[file.modernizr] === 'undefined' || (typeof Modernizr[file.modernizr] !== 'undefined' && Modernizr[file.modernizr] != true)) { continue; } } var script = document.createElement('script'); if (typeof file.id !== 'undefined') { script.id = file.id; } var src = file.src; if (src.indexOf('http') === -1) { var useSSL = 'https:' == document.location.protocol; src = (useSSL ? 'https:' : 'http:') + src; } script.src = src; script.async = true; head.appendChild(script); // Once Async has loaded load any dependants if (typeof file.id !== 'undefined') { $(script).load(function() { self.loadDependant($(this).attr('id')); }); } } }, loadDependant: function(fileID){ if (typeof Drupal.settings.js_defer.dependant[fileID] !== 'undefined') { var dependantFiles = Drupal.settings.js_defer.dependant[fileID]; this.loadScripts(dependantFiles); } } }; })(jQuery, Drupal, this, this.document);;/**/ /* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/profiles/ines/modules/ines_commercial/ines_commercial_ads/js/commercial.lazy_ads.js. */ (function($,Drupal,window){googletag=window.googletag||{};googletag.cmd=googletag.cmd||[];Drupal.behaviors.commercial_lazy_ads={queue:[],attach:function(context,settings){if(typeof Drupal.settings.commercial_ads!=='undefined'&&Drupal.settings.commercial_ads.processed!==true){Drupal.settings.commercial_ads.processed=true;if(typeof Drupal.settings.commercial_ads.gptSlots!=='undefined'){var slots=Drupal.settings.commercial_ads.gptSlots;for(var i=0;i0)$(window).on('scroll',{self:this},this.checkPosition)};if(typeof Drupal.settings.commercial_ads.breakpoints!=='undefined')$(window).on('resize',{self:this},this.checkOnResize)}},checkPosition:function(e){var self=e.data.self;if(self.lazyPositions.length===0){$(window).unbind('scroll',self.checkPosition);return};var scrollTop=$(window).scrollTop(),positions=[];for(var i=self.lazyPositions.length-1;i>=0;i--)if(self.lazyPositions[i]<=scrollTop+self.lazyOffset)positions.push(self.lazyPositions.splice(i,1));self.processPositions(positions)},processPositions:function(positions){for(var i=positions.length-1;i>=0;i--){var slots=(typeof this.lazyAds[positions[i]]!=='undefined')?this.lazyAds[positions[i]]:false;if(slots)for(var j=0;j0){var microtimes=JSON.parse($time.attr('data-microtimes')),m_changed=parseInt(microtimes.changed),m_published=parseInt(microtimes.published),m_display=parseInt(microtimes.display),publishtime=m_changed;if(m_published<1438387200)publishtime=m_published;if(m_display>0)publishtime=m_display;var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months=["January","February","March","April","May","June","July","August","September","October","November","December"];if(currenttime-(publishtime/1e3)<24*60*60){var timesincevar=timeSince(publishtime);$('time').html(timesincevar+' ago')}else{var d=new Date(publishtime),js_date=weekdays[d.getDay()]+" "+d.getDate()+" "+months[d.getMonth()]+" "+d.getFullYear();$('time').html(js_date)}}}) function set_plural(i,s){if(parseInt(i)>1){return s+"s "}else return s+" "} function timeSince(date){var seconds=Math.floor((new Date().getTime()-date)/1e3);if(seconds<0)seconds=seconds*-1;var interval=Math.floor(seconds/31536e3);if(interval>1)return set_plural(interval,interval+" year");interval=Math.floor(seconds/2592e3);if(interval>1)return set_plural(interval,interval+" month");interval=Math.floor(seconds/86400);if(interval>1)return set_plural(interval,interval+" day");interval=Math.floor(seconds/3600);if(interval>=1){interval=Math.round(seconds/3600);return set_plural(interval,interval+" hour")};interval=Math.floor(seconds/60);if(interval>=1)return set_plural(interval,interval+" minute");interval=Math.floor(seconds);return set_plural(interval,interval+" second")};updateDate()});; /* Source and licensing information for the above line(s) can be found at http://www.independent.co.uk/profiles/ines/modules/ines_js/js/all/node--article.tpl.js. */ /* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/profiles/ines/modules/ines_js/js/in/html.tpl.js. */ var captify_kw_query_11667="";(function(c,a,p,t,i,f,y){i=c.createElement(a);t=c.getElementsByTagName(a)[0];i.type='text/javascript';i.async=true;i.src=p;t.parentNode.insertBefore(i,t)})(document,'script','https://p.cpx.to/p/11667/px.js');; /* Source and licensing information for the above line(s) can be found at http://www.independent.co.uk/profiles/ines/modules/ines_js/js/in/html.tpl.js. */ /*! Lazy Load 1.9.5 - MIT license - Copyright 2010-2015 Mika Tuupola */ !function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); ;/**/ /* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/ines_theme/js/ines-lazy-load.js. */ (function($){$(document).ready(function(){$(".lazy").lazyload({effect:"fadeIn",threshold:600,load:function(elements_left,settings){$(this).removeClass('lazy')}});$(".lazy-video").each(function(){var poster=new Image(),pSrc=$(this).data('poster'),pOrSrc=$(this).parent().data('poster');if(pOrSrc)pSrc=pOrSrc;var source=$(this).find('source'),video=$(this);poster.onload=function(){video.attr('poster',pSrc);source.attr('src',source.data('src'));video.removeClass('lazy-video');video[0].load();video[0].play()};poster.src=pSrc;poster.onload()});$(window).scroll()})})(jQuery);; /* Source and licensing information for the above line(s) can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/ines_theme/js/ines-lazy-load.js. */ /* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/ines_theme/js/ines-share-init.js. */ (function($,Drupal,window,document){Drupal.behaviors.ines_share={attach:function(context,settings){if(typeof Drupal.settings.ines_share!=='undefined'&&Drupal.settings.ines_share.processed!==true){Drupal.settings.ines_share.processed=true;if(Drupal.settings.ines_share.fbAppId!=='undefined'&&Drupal.settings.ines_share.fbAppId!==false)Drupal.behaviors.ines_share.facebookInit(Drupal.settings.ines_share.fbAppId);window.twttr=Drupal.behaviors.ines_share.twitterInit()}},facebookInit:function(appId){var d=document,s='script',id='facebook-jssdk';if(d.getElementById(id))return;var h=document.getElementsByTagName('head').item(0);js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.4&appId="+appId;h.appendChild(js)},twitterInit:function(){var d=document,s='script',id='twitter-wjs';t=window.twttr||{};if(d.getElementById(id))return t;var h=document.getElementsByTagName('head').item(0);js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";h.appendChild(js);t._e=[];t.ready=function(f){t._e.push(f)};return t}}})(jQuery,Drupal,this,this.document);; /* Source and licensing information for the above line(s) can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/ines_theme/js/ines-share-init.js. */ /* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/independent_theme/js/sitecatalyst.masthead_tracking.js. */ (function($){$('#masthead nav ol li a').bind('click',function(e){var s=s_gi(s_account),navtrackurl='T - '+($(this).attr('href'));s.linkTrackVars='prop6';s.prop6=navtrackurl;s.tl(this,'o',navtrackurl);s.prop6=''});$('#masthead #menu ul li a').bind('click',function(e){var s=s_gi(s_account),navtrackurl='B - '+($(this).attr('href'));s.linkTrackVars='prop6';s.prop6=navtrackurl;s.tl(this,'o',navtrackurl);s.prop6=''});$('.sub-nav .mega-nav a').bind('click',function(e){var s=s_gi(s_account),navtrackurl='IBM - '+($(this).attr('href'));s.linkTrackVars='prop6';s.prop6=navtrackurl;s.tl(this,'o',navtrackurl);s.prop6=''});$(".label:contains('The Street'), .label:contains('the street')").each(function(index){var parent=$(this).closest('div.content'),childLink=$(parent).find('a');$(childLink).bind('click',function(e){var s=s_gi(s_account),navtrackurl='Street - '+($(this).attr('href'));s.linkTrackVars='prop6';s.prop6=navtrackurl;s.tl(this,'o',navtrackurl);s.prop6=''})})})(jQuery);; /* Source and licensing information for the above line(s) can be found at http://www.independent.co.uk/sites/all/themes/ines_themes/independent_theme/js/sitecatalyst.masthead_tracking.js. */