/* Source and licensing information for the line(s) below can be found at http://www.independent.co.uk/profiles/ines/modules/ines_js/js/ines_js.defer.js. */ (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){Drupal.settings.js_defer.processed=true;var self=this;if(typeof Drupal.settings.js_defer.onLoad!=='undefined')$(window).load(function(){self.loadScripts(Drupal.settings.js_defer.onLoad)});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),self=this;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;jj.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/vendor/jquery.timeago.js. */ (function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module==='object'&&typeof module.exports==='object'){factory(require('jquery'))}else factory(jQuery)}(function($){$.timeago=function(timestamp){if(timestamp instanceof Date){return inWords(timestamp)}else if(typeof timestamp==="string"){return inWords($.timeago.parse(timestamp))}else if(typeof timestamp==="number"){return inWords(new Date(timestamp))}else return inWords($.timeago.datetime(timestamp))};var $t=$.timeago;$.extend($.timeago,{settings:{refreshMillis:6e4,allowPast:true,allowFuture:false,localeTitle:false,cutoff:604800000,autoDispose:true,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:'any moment now',seconds:"%d secs",minute:"1 min",minutes:"%d mins",hour:"an hour",hours:"%d hours",day:"a day",days:"%d days",month:"a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(distanceMillis){if(!this.settings.allowPast&&!this.settings.allowFuture)throw'timeago allowPast and allowFuture settings can not both be set to false.';var $l=this.settings.strings,prefix=$l.prefixAgo,suffix=$l.suffixAgo;if(this.settings.allowFuture)if(distanceMillis<0){prefix=$l.prefixFromNow;suffix=$l.suffixFromNow};if(!this.settings.allowPast&&distanceMillis>=0)return this.settings.strings.inPast;var seconds=Math.abs(distanceMillis)/1e3,minutes=seconds/60,hours=minutes/60,days=hours/24,years=days/365 function substitute(stringOrFunction,number){var string=$.isFunction(stringOrFunction)?stringOrFunction(number,distanceMillis):stringOrFunction,value=($l.numbers&&$l.numbers[number])||number;return string.replace(/%d/i,value)};var words=seconds<45&&substitute($l.seconds,Math.round(seconds))||seconds<90&&substitute($l.minute,1)||minutes<45&&substitute($l.minutes,Math.round(minutes))||minutes<90&&substitute($l.hour,1)||hours<24&&substitute($l.hours,Math.round(hours))||hours<42&&substitute($l.day,1)||days<30&&substitute($l.days,Math.round(days))||days<45&&substitute($l.month,1)||days<365&&substitute($l.months,Math.round(days/30))||years<1.5&&substitute($l.year,1)||substitute($l.years,Math.round(years)),separator=$l.wordSeparator||"";if($l.wordSeparator===undefined)separator=" ";return $.trim([prefix,words,suffix].join(separator))},parse:function(iso8601){var s=$.trim(iso8601);s=s.replace(/\.\d+/,"");s=s.replace(/-/,"/").replace(/-/,"/");s=s.replace(/T/," ").replace(/Z/," UTC");s=s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");s=s.replace(/([\+\-]\d\d)$/," $100");return new Date(s)},datetime:function(elem){var iso8601=$t.isTime(elem)?$(elem).attr("datetime"):$(elem).attr("title");return $t.parse(iso8601)},isTime:function(elem){return $(elem).get(0).tagName.toLowerCase()==="time"}});var functions={init:function(){var refresh_el=$.proxy(refresh,this);refresh_el();var $s=$t.settings;if($s.refreshMillis>0)this._timeagoInterval=setInterval(refresh_el,$s.refreshMillis)},update:function(timestamp){var date=(timestamp instanceof Date)?timestamp:$t.parse(timestamp);$(this).data('timeago',{datetime:date});if($t.settings.localeTitle)$(this).attr("title",date.toLocaleString());refresh.apply(this)},updateFromDOM:function(){$(this).data('timeago',{datetime:$t.parse($t.isTime(this)?$(this).attr("datetime"):$(this).attr("title"))});refresh.apply(this)},dispose:function(){if(this._timeagoInterval){window.clearInterval(this._timeagoInterval);this._timeagoInterval=null}}};$.fn.timeago=function(action,options){var fn=action?functions[action]:functions.init;if(!fn)throw new Error("Unknown function name '"+action+"' for timeago");this.each(function(){fn.call(this,options)});return this} function refresh(){var $s=$t.settings;if($s.autoDispose&&!$.contains(document.documentElement,this)){$(this).timeago("dispose");return this};var data=prepareData(this);if(!isNaN(data.datetime))if($s.cutoff===0||Math.abs(distance(data.datetime))<$s.cutoff){$(this).text(inWords(data.datetime))}else if($(this).attr('title').length>0)$(this).text($(this).attr('title'));return this} function prepareData(element){element=$(element);if(!element.data("timeago")){element.data("timeago",{datetime:$t.datetime(element)});var text=$.trim(element.text());if($t.settings.localeTitle){element.attr("title",element.data('timeago').datetime.toLocaleString())}else if(text.length>0&&!($t.isTime(element)&&element.attr("title")))element.attr("title",text)};return element.data("timeago")} function inWords(date){return $t.inWords(distance(date))} function distance(date){return(new Date().getTime()-date.getTime())};document.createElement("abbr");document.createElement("time")}));; /* 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/vendor/jquery.timeago.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-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. */ function throttle(a, b, c) { b || (b = 250); var d, e; return function() { var f = c || this, g = +new Date(), h = arguments; d && g < d + b ? (clearTimeout(e), e = setTimeout(function() { d = g, a.apply(f, h); }, b)) : (d = g, a.apply(f, h)); }; } function pluralize(a, b) { return parseInt(a) > 1 ? b + "s" : b; } function removeExistingQuerystring(a) { if (void 0 !== a) return a.split("?")[0]; } function abbrNum(a, b) { b = Math.pow(10, b); for (var c = [ "K", "M", "B", "T" ], d = c.length - 1; d >= 0; d--) { var e = Math.pow(10, 3 * (d + 1)); if (e <= a) { a = Math.round(a * b / e) / b, 1e3 == a && d < c.length - 1 && (a = 1, d++), a += c[d]; break; } } return a; } function referenceS3Location(a) { if (a.indexOf("/s3/files/") > -1) { var b, c, d, e = window.location.href, f = e.split("/"), g = f[0] + "//" + f[2]; b = g.indexOf("cms.") > -1 ? "http://static." : g.indexOf("uat.") > -1 || g.indexOf("uat-origin.") > -1 ? "http://static-uat." : "http://static-dev.", c = g.indexOf("homesandproperty") > -1 ? "homesandproperty.co.uk" : g.indexOf("standard") > -1 ? "standard.co.uk" : "independent.co.uk", d = b + c, a = a.replace(g + "/s3/files/styles/story_medium/public", d + "/s3fs-public"); } return a; } function createCookie(a, b, c) { var d; if (c) { var e = new Date(); e.setTime(e.getTime() + 24 * c * 60 * 60 * 1e3), d = "; expires=" + e.toGMTString(); } else d = ""; document.cookie = encodeURIComponent(a) + "=" + encodeURIComponent(b) + d + "; path=/"; } function getCookie(a) { var b = "; " + document.cookie, c = b.split("; " + a + "="); if (2 == c.length) return c.pop().split(";").shift(); } function videoPlayerToggle(a) { for (var b = Object.keys(videojs.players), c = b.length - 1; c >= 0; c--) b[c] === a && b.splice(c, 1); for (var c = 0; c < b.length; c++) videojs(b[c]).pause(), videojs(b[c]).ima3.adPlayer.pause(); } function videoPlayerEvent(a) { videojs(a).on("play", function() { videoPlayerToggle(a); }); } var cache = { supports: {} }; cache.supports.localstorage = function() { var a = "test"; try { return localStorage.setItem(a, a), localStorage.removeItem(a), !0; } catch (b) { return !1; } }(), jQuery(document).ready(function(a) { a("body.search-results .pager .text-link").on("click", function(b) { b.preventDefault(), a('#content input[type="search"]').focus(); }); }), jQuery(document).ready(function(a) { function b() { e = new Date(); var b = 0; a(".years li.expanded ol.months > li:nth-child(" + (e.getMonth() + 1) + ")").addClass("current-month"), a(".years li.expanded .months .current-month li").each(function(c) { "" != a(this).html() && ++b > e.getDate() && (a(this).addClass("disabled"), a(this).html(b)); }); } document.location.href.indexOf("archive") > -1 && b(); throttle(function() { if (document.documentElement.clientWidth < 930 && !cache.$article_sidebar.hasClass("always-shown")) { var b = { display: "", right: "", position: "", top: "" }; cache.$article_sidebar.css(b); for (var c = 0; c < cache.$article_sidebar_asides.length; c++) cache.$article_sidebar_asides.eq(c).removeClass("visible"); } else { var d = window.innerHeight - 68, e = -1, f = a(window).scrollTop(); cache.scroll_top = f; for (var g = cache.$article_text_wrappers.length - 1; g >= 0; g--) { var h = cache.$article_text_wrappers.eq(g), i = h.offset().top, j = h.height(); e = g; break; } if (e !== -1) { var k = d; e === cache.$article_text_wrappers.length - 1 && (k = j); for (var l = 0, c = 0; c < cache.$article_sidebar_asides.length; c++) l + cache.$article_sidebar_asides.eq(c).height() <= k ? (cache.$article_sidebar_asides.eq(c).addClass("visible"), 0 !== l && (l += 40), l += cache.$article_sidebar_asides.eq(c).height()) : cache.$article_sidebar_asides.eq(c).removeClass("visible"); var b = { display: "block", right: h.offset().left - a("#content").offset().left }; document.documentElement.clientWidth < 930 ? b.position = "static" : i > f + 68 ? (b.position = "absolute", b.right = 50, b.top = 0, b.bottom = "auto") : i + j - l < f + 68 ? (b.position = "absolute", b.bottom = 0, b.top = "auto", b.right = 50) : (b.position = "fixed", b.top = 68, b.right = h.offset().left), cache.$article_sidebar.css(b); } } }, 41); if (a("body").hasClass("article")) { cache.$article_header = a(".full-article header").first(), cache.$article_sidebar = a(".full-article .sidebar"), cache.$article_sidebar_asides = cache.$article_sidebar.find("aside"), cache.$article_text_wrappers = a(".full-article .text-wrapper"), a(window).on("load scroll resize", function() { document.documentElement.clientWidth < 620 ? a("a.lightbox-wrapper").each(function() { var b = a(this).attr("href"); void 0 === b && b === !1 || a(this).attr("data-href", b).removeAttr("href", "").removeAttr("data-featherlight"); }) : a("a.lightbox-wrapper").each(function() { var b = a(this).data("href"); void 0 === b && b === !1 || a(this).removeAttr("data-href", "").attr("href", b).attr("data-featherlight", "image"); }); }); var c = a(".number"); a.each(c, function(b, c) { numberLength = a(this).text().length, a(this).addClass("number-length-" + numberLength); }), document.documentElement.clientWidth < 930 && a(".layout-component-most-popular div").appendTo("#most-popular-mobile"); var d = window.location.pathname; if (a("body").hasClass("admin-menu") || d.indexOf("/simple-preview/") > -1) { var e = new Date(); a(".featured-media img, .dnd-widget-wrapper img").each(function(b) { var c = a(this).attr("src"); c = removeExistingQuerystring(c), c += "?" + e.getTime(), c = referenceS3Location(c), a(this).attr("src", c); }); } } a("time[datetime]").timeago(); }), jQuery(document).ready(function(a) { jQuery(".most-popular-toaster .most-popular-article.tab a").click(function() { var a = jQuery(this).attr("href"), b = s_gi(s_account); ga("send", "event", "Toaster", "target", a), b.linkTrackVars = "prop36", b.prop36 = "Toaster Click - " + a, b.tl(this, "o", "Toaster Click"); }), jQuery(".most-popular-toaster .most-popular-cancel.tab .buttons a").click(function() { var a = jQuery(this).attr("class"), b = s_gi(s_account); ga("send", "event", "Toaster", "Cancel", a), b.linkTrackVars = "prop36", b.prop36 = "Toaster Close - " + a, b.tl(this, "o", "Toaster Close"); }), jQuery(".layout-component-ines-sponsored-features-sidebar a").click(function() { var a = jQuery(this).attr("href"), b = jQuery(this).closest("li").index() + 1, c = s_gi(s_account); ga("send", "event", "Sponsored Features", b, a), c.linkTrackVars = "prop36", c.prop36 = "Sponsored Features - " + b + " - " + a, c.tl(this, "o", "Sponsored Features"); }), jQuery("a.email-signpost").click(function() { var a = jQuery(this).attr("href"), b = s_gi(s_account); ga("send", "event", "Email Signpost", a), b.linkTrackVars = "prop36", b.prop36 = "Email Signpost - " + a, b.tl(this, "o", "Email Signpost"); }), jQuery(".video-playlist li a").click(function() { var a = jQuery(this).attr("href"), b = jQuery(this).closest("li").index() + 1, c = s_gi(s_account); ga("send", "event", "Popular Videos", b, a), c.linkTrackVars = "prop36", c.prop36 = "Popular Videos - " + b + " - " + a, c.tl(this, "o", "Popular Videos"); }); }), function(a) { a(document).ready(function() { a(".toggle-menu a").on("click", function(b) { b.preventDefault(), a("body").hasClass("menu-visible") ? (a("body").removeClass("menu-visible"), a(window).scrollTop(window.scrollTopBeforeMenuShow)) : (window.scrollTopBeforeMenuShow = parseInt(a(window).scrollTop()), a("body").addClass("menu-visible"), a(window).scrollTop(0)), a(this).toggleClass("icon-menu icon-close"); }); }), a(document).ready(function() { cache.is_article = a("body").hasClass("article"), cache.$dynamic_header_logotype = a("#dynamic-header .logotype"), cache.$dynamic_header_push = a("#dynamic-header .push"), cache.$dynamic_header_share = a("#dynamic-header .share"), cache.$masthead_logo = a("#masthead .logo"), a(window).scroll(function() { b(); }); var b = throttle(function() { var b = a(this).scrollTop(); b > 350 && (cache.is_article && b < a(".full-article").height() ? cache.$dynamic_header_share.hasClass("active") || (cache.$dynamic_header_logotype.removeClass("active"), cache.$masthead_logo.addClass("stamp-only"), cache.$dynamic_header_share.addClass("active"), cache.$dynamic_header_push.removeClass("active")) : cache.$dynamic_header_push.hasClass("active") || (cache.$dynamic_header_logotype.removeClass("active"), cache.$masthead_logo.addClass("stamp-only"), cache.$dynamic_header_share.removeClass("active"), cache.$dynamic_header_push.addClass("active"))), b <= 350 && !cache.$dynamic_header_logotype.hasClass("active") && (cache.$dynamic_header_logotype.addClass("active"), cache.$masthead_logo.removeClass("stamp-only"), cache.$dynamic_header_share.removeClass("active"), cache.$dynamic_header_push.removeClass("active")), void 0 !== Drupal.behaviors.grid && Drupal.behaviors.grid.weight_per_row < 3 || a(window).width() <= 1e3 || a("body").hasClass("menu-visible") || (b > 30 ? (a("#masthead").addClass("thin"), a("body").addClass("masthead-thin")) : b <= 30 && (a("#masthead").removeClass("thin"), a("body").removeClass("masthead-thin"))); }, 100); }), a(document).ready(function() { a("#menu .toggle").on("click", function(b) { b.preventDefault(), a(this).parents("ul.topics li").toggleClass("expanded"); }); }); }(jQuery), function(a) { Drupal.behaviors.inesDropDown = { attach: function(b, c) { function d(b) { a(".dropdown-menu.open, .search-form.open").removeClass("open"), a("#content, .toggle-menu").unbind("click", d); } function e(b) { timer = setTimeout(function() { a(b).addClass("sub-menu-open"); }, 150); } a(".dropdown-toggle", b).on("click", function(b) { b.preventDefault(), b.stopPropagation(); var c = a(this).siblings(".dropdown-menu, .search-form"); 0 !== c.length && (c.hasClass("open") ? d() : (d(), c.addClass("open"), a("#content, .toggle-menu").bind("click", d))); }), a("header > nav > ol > li", b).hover(function() { e(a(this)); var b = -((120 - a(this).innerWidth()) / 2); a(this).find("ul").css("margin-left", b); }, function() { clearTimeout(timer), a(this).removeClass("sub-menu-open"); }); } }; }(jQuery), function(a) { a(document).ready(function() { a(".calendar .toggle-year").on("click", function(b) { b.preventDefault(), a(this).parents("li").first().toggleClass("expanded"); }); }); }(jQuery), jQuery(".share_bar_block .number").each(function() { jQuery(this).parent().css({ width: jQuery(this).width() }), jQuery(this).prop("Counter", 0).animate({ Counter: jQuery(this).text() }, { duration: 1e3, easing: "swing", step: function(a) { jQuery(this).text(Math.ceil(a)); } }); }), cache.supports.localstorage && "yes" !== localStorage.getItem("cookie_warning_shown") && (jQuery("#cookie-warning").addClass("visible"), localStorage.setItem("cookie_warning_shown", "yes"), jQuery("#cookie-warning .close").click(function(a) { a.preventDefault(), jQuery("#cookie-warning").removeClass("visible"); })), cache.supports.localstorage && "yes" !== localStorage.getItem("trial_message_shown") && (jQuery("#trial-message").addClass("visible"), localStorage.setItem("trial_message_shown", "yes"), jQuery("#trial-message .close").click(function(a) { a.preventDefault(), jQuery("#trial-message").removeClass("visible"); })), function(a) { a(document).ready(function(a) { function b(b) { top.location = "#gallery"; var d = a(".gallery-open .images li[data-gallery-item=" + b + "]"), e = a(".gallery-open .legends li[data-gallery-legend=" + b + "]"); d.addClass("active"), e.addClass("active"); var f = !1; d.lazyload({ skip_invisible: !1, effect: "hide", load: function(a, b) { f = !0, h(); } }), f || c(d), d.nextAll(":lt(2)").lazyload({ skip_invisible: !1, effect: "hide" }), d.prevAll(":lt(2)").lazyload({ skip_invisible: !1, effect: "hide" }), $last_item = a(".gallery-open .images").find("li").last(), $last_item.lazyload({ skip_invisible: !1, effect: "hide" }), $last_item.prev().lazyload({ skip_invisible: !1, effect: "hide" }), g(b); } function c(a) { var b = a.attr("data-original"), c = { "background-image": 'url("' + b + '")' }; a.css(c), h(); } function d() { var b = a(".gallery-open .images").find(".active"), d = b.next(); d.length ? d.addClass("active") : (a(".gallery-open .images").find("li").removeClass("active"), d = a(".gallery-open .images").find("li").first(), d.addClass("active")), b.removeClass("active"), d.lazyload({ skip_invisible: !1, effect: "hide", load: function(a, b) { h(); } }), c(d), d.nextAll(":lt(3)").each(function() { a(this).lazyload({ skip_invisible: !1, effect: "hide" }); }); var e = a(".gallery-open .images").find("li").index(d); a(".gallery-open .legends .active").removeClass("active"), a(".gallery-open .legends li").eq(e).addClass("active"), g(e + 1); } function e() { var b = a(".gallery-open .images").find(".active"), d = b.prev(); d.length ? d.addClass("active") : (a(".gallery-open .images").find("li").removeClass("active"), d = a(".gallery-open .images").find("li").last(), d.addClass("active")), b.removeClass("active"), d.lazyload({ skip_invisible: !1, effect: "hide", load: function(a, b) { h(); } }), c(d), d.prevAll(":lt(3)").each(function() { a(this).lazyload({ skip_invisible: !1, effect: "hide" }); }); var e = a(".gallery-open .images").find("li").index(d); a(".gallery-open .legends .active").removeClass("active"), a(".gallery-open .legends li").eq(e).addClass("active"), g(e + 1); } function f() { a("body").removeClass("fullscreen-gallery"), a(".gallery-open").removeClass("gallery-open"); } function g(b) { if ("undefined" != typeof s_gi) { var c = s_gi(s_account); c.linkTrackVars = "prop2,prop8,prop10,prop15,prop21", c.linkTrackEvents = "event3"; var d = a(".grid-mod-gallery"); c.prop21 = d.attr("data-scald-gallery") + " | " + b, c.events = "event3", "standard_theme" == Drupal.settings.themeName ? (c.prop10 = "", c.prop2 = "Gallery") : "independent_theme" == Drupal.settings.themeName && (c.prop15 = "", c.prop8 = "Gallery"), c.t(), c.prop2 = c.prop21 = c.events = c.prop10 = ""; } var e = location.href, f = location.pathname; cbPagepath = f, e.indexOf("homesandproperty.co.uk") >= 0 ? f += "?gallery_view" : f = f + "?slide_num=" + b; ga("send", "pageview", f), b % 3 == 0 && "undefined" != typeof googletag && googletag.cmd.push(function() { googletag.pubads().refresh([ gptAdSlots.mpu5 ]); }); var g = _sf_async_config.sections, g = g.replace("non-gallery", "gallery"), h = a('meta[name="twitter:title"]').attr("content"); _sf_async_config.sections = g, pSUPERFLY.virtualPage(cbPagepath, h), self.COMSCORE && COMSCORE.beacon({ c1: "2", c2: "10476312" }); } function h() { var b, c, d, e, f, g = a(".gallery-open .images").find(".active"); b = a(window).width() > 929 ? a(window).width() - 340 : a(window).width(), c = a(window).height() - 64, d = g.attr("data-original"), d ? (e = new Image(), e.src = d, e.onload = function() { f = b / this.width * this.height, 0 == this.width || 0 == this.height ? f = 1e3 : f > c && (f = c), a(".gallery-open .images").css("height", f); }) : (f = 1e3, a(".gallery-open .images").css("height", f)); } a(".grid-mod-gallery a").on("click", function(c) { if (c.preventDefault(), window.addEventListener("orientationchange", h), "undefined" != typeof googletag) { a(".mpu5-container").html('
'); var d = "mpu5"; void 0 !== gptAdSlots[d] && (console.log("googletag display: " + d), googletag.display(d), googletag.pubads().refresh([ gptAdSlots[d] ])); } a("body").addClass("fullscreen-gallery"), a(this).parents(".grid-mod-gallery").next(".full-gallery").addClass("gallery-open"), void 0 !== a(this).attr("data-gallery-thumb") ? (a(".gallery-open .images li").removeClass("active"), a(".gallery-open .legends li").removeClass("active"), a(this).parents("article").find(".show-all").removeClass("initial-open"), b(a(this).attr("data-gallery-thumb"))) : a(this).hasClass("initial-open") && (a(this).removeClass("initial-open"), b(1)); }), a(window).on("hashchange", function(b) { "#gallery" === location.hash || a("body").hasClass("fullscreen-gallery") && f(); }), a(".full-gallery .next").on("click", function(a) { a.preventDefault(), d(); }), a(".full-gallery .prev").on("click", function(a) { a.preventDefault(), e(); }), a(".full-gallery .close").on("click", function(a) { a.preventDefault(), f(); }), a(document).keyup(function(b) { a("body").hasClass("fullscreen-gallery") && (37 === b.which && e(), 39 === b.which && d(), 27 === b.which && f()); }); }); }(jQuery), jQuery(document).ready(function(a) { a(".edition ul a").click(function() { var b = a(this).data("edition"); createCookie("Locale", b, 365), a("body").hasClass("front") && "US" === b ? window.location.assign("/us") : a("body").hasClass("section-us") && "UK" === b ? window.location.assign("/") : window.location.reload(!0); }), a("#masthead #dynamic-header > a").click(function(a) { a.preventDefault(); getCookie("Locale"); "US" === getCookie("Locale") ? window.location.assign("/us") : window.location.assign("/"); }); }), function(a) { function b(a) { for (var b = a + "=", c = document.cookie.split(";"), d = 0; d < c.length; d++) { for (var e = c[d]; " " == e.charAt(0); ) e = e.substring(1); if (0 == e.indexOf(b)) return e.substring(b.length, e.length); } return ""; } function c() { return e = window.pageYOffset, f = e > g ? "down" : "up", g = e, f; } var d = function(d) { a.getJSON(d, function(d) { function e(a) { var b = Math.floor((new Date().getTime() - a) / 1e3), c = Math.floor(b / 31536e3); return c > 1 ? c + " years" : (c = Math.floor(b / 2592e3)) > 1 ? c + " months" : (c = Math.floor(b / 86400)) > 1 ? c + " days" : (c = Math.floor(b / 3600)) >= 1 ? (c = Math.round(b / 3600)) + " hours" : (c = Math.floor(b / 60), c >= 1 ? c + " minutes" : Math.floor(b) + " seconds"); } cache.$populararticles = d.articles; var f; article = cache.$populararticles[0], article.link == window.location && (article = cache.$populararticles[1]), published = article.publish_date.replace(/-/g, "/"), published = Date.parse(published), void 0 !== article.image ? image = article.image.thumbnail : image = "#", f = '
  • Close
  • ', hidehtml = '', a(".most-popular-toaster").html(""), a(window).on("resize", function() { window.innerWidth >= 929 ? a(".most-popular-toaster").css("right", 0) : a(".most-popular-toaster").css("left", window.innerWidth / 2 - 150); }), window.innerWidth >= 929 ? a(".most-popular-toaster").css("right", 0) : a(".most-popular-toaster").css("left", window.innerWidth / 2 - 150), a("#most-popular-cancel").on("click", function(b) { b.preventDefault(b); var c = { left: "-300px" }; a(".most-popular-toaster li.tab").css(c); }), a("#most-popular-hide-once").on("click", function(b) { b.preventDefault(b); var c = new Date(); c.setTime(c.getTime() + 864e5); var d = "expires=" + c.toUTCString(); document.cookie = "most-popular=dismissed;" + d + ";path=/ ", a(".most-popular-toaster").removeClass("visible"); }), a("#most-popular-hide-forever").on("click", function(b) { b.stopPropagation(b); var c = new Date(); c.setTime(c.getTime() + 2592e6); var d = "expires=" + c.toUTCString(); document.cookie = "most-popular=dismissed;" + d + ";path=/ ", a(".most-popular-toaster").removeClass("visible"), b.stopPropagation(b); }), a("#most-popular-hide-cancel").on("click", function(b) { b.preventDefault(b); var c = { left: "0px" }; a(".most-popular-toaster li.tab").css(c); }), a(".most-popular-toaster .most-popular-article.tab a").click(function() { var b = a(this).attr("href"), c = s_gi(s_account); ga("send", "event", "Toaster", "target", b), c.linkTrackVars = "prop36", c.prop36 = "Toaster Click - " + b, c.tl(this, "o", "Toaster Click"); }), a(".most-popular-toaster .most-popular-cancel.tab .buttons a").click(function() { var b = a(this).attr("class"), c = s_gi(s_account); ga("send", "event", "Toaster", "Cancel", b), c.linkTrackVars = "prop36", c.prop36 = "Toaster Close - " + b, c.tl(this, "o", "Toaster Close"); }); var g = function() { a(".most-popular-toaster").addClass("visible"); var c = new Date(); c.setTime(c.getTime() + 864e5); var d = "expires=" + c.toUTCString(); "" == b("most-popular") && (document.cookie = "most-popular=seen;" + d + ";path=/ "); }; a(window).on("scroll", function() { var d = c(); "dismissed" != b("most-popular") && ("up" == d ? g() : ($btn = a("#gigya-share-btns-2"), $btn.length > 0 && (sharebuttonposition = $btn.offset().top, scrollposition = a(window).scrollTop(), windowheight = a(window).height(), scrollposition + windowheight > sharebuttonposition ? g() : a(".most-popular-toaster").removeClass("visible")))); }); }); }; a(window).on("load", function() { var a = Drupal.settings.most_popular_feed; "seen" != b("most-popular") && "dismissed" != b("most-popular") && void 0 !== a && d(a); }); var e, f, g = 0; a(document).ready(function() { window.location.href.indexOf("standard") > -1 && a(window).width() < 420 && a(".most-popular-toaster").hide(); }); }(jQuery); var sticky_leaderboard = function() { var a = jQuery("#leaderboard").find("iframe"), b = a.attr("src"); if (void 0 !== b && b.indexOf("richmedia") == -1) { var c = a.height() + 40; a && a.height() > 10 && jQuery("#leaderboard").attr("style", "min-height:" + c + "px;position: relative; margin-bottom: 5px"), jQuery(window).on("scroll", function() { var b = jQuery(window).scrollTop(), d = {}; b + a.height() > c ? (d.left = (jQuery("#leaderboard").width() - a.width()) / 2, d.position = "absolute", d.bottom = 0) : (d.left = (jQuery(window).width() - a.width()) / 2, d.position = "fixed", d.bottom = ""), a.css(d); }); } }, sticky_mpu = function() { var a = jQuery(".sidebar #mpu0").find("iframe"); if (jQuery(".dark-background figure .bc_container .video-js").length && !jQuery("body").hasClass("admin-menu")) var b = !0; if (a.length) { var c = a.height(); jQuery("#mpu0").offset().top; jQuery(".sidebar #mpu0").css("position", "relative"), jQuery(".sidebar #mpu0").css("overflow", "hidden"), 250 == c ? (jQuery(".sidebar #mpu0").animate({ height: "600px" }, 3e3), jQuery(window).on("scroll", function() { var c = jQuery(window).scrollTop(), d = jQuery("#mpu0").offset().top, e = c + 50 - d; 1 == b && (e += 210), e >= 0 && e < 350 ? (a.css("position", "fixed"), a.css("top", 50)) : e < 0 ? (a.css("position", "absolute"), a.css("top", 0)) : (a.css("position", "absolute"), a.css("top", 350)); })) : 600 == c && (jQuery(".sidebar #mpu0").animate({ height: "800px" }, 3e3), jQuery(window).on("scroll", function() { var c = jQuery(window).scrollTop(), d = jQuery("#mpu0").offset().top, e = c + 50 - d; 1 == b && (e += 210), e >= 0 && e < 200 ? (a.css("position", "fixed"), a.css("top", 50)) : e < 0 ? (a.css("position", "absolute"), a.css("top", 0)) : (a.css("position", "absolute"), a.css("top", 200)); })); } }, sticky_leader = function() { var a = jQuery("#leaderboard").find("iframe"), b = jQuery("body").css("backgroundColor"); if (jQuery("#leaderboard").is(":visible") && "undefined" == typeof stickyMe && a) { var c = 0; jQuery("#leaderboard").find("iframe").each(function(a) { var b = jQuery(this).height(); 50 != b && 90 != b && 250 != b || (c = b); }), c > 10 ? (jQuery("#leaderboard").css({ "min-height": c + 111, position: "fixed", top: 0, left: 0, "z-index": "95", background: b, width: "100%", margin: "0 auto", "padding-top": "100px", "padding-bottom": "10px", "border-bottom": "1px solid rgba(242, 242, 242, 1)", display: "" }), jQuery("#leaderboard").addClass("stickied"), jQuery(".ad-leaderboard").css({ "min-height": a.height() + 20 }), setTimeout(function() { 0 != jQuery(window).scrollTop() && jQuery("#leaderboard").fadeTo("fast", 0), setTimeout(function() { jQuery("#leaderboard").fadeTo("fast", 1), jQuery("#leaderboard").css({ "min-height": a.height(), position: "relative", "z-index": "95", "padding-top": "0px", "padding-bottom": "0px", "border-bottom": "0px solid rgba(242, 242, 242, 0)", background: "none" }); }, 700); }, 5e3)) : jQuery("#leaderboard").hasClass("stickied") || setTimeout(function() { sticky_leader(); }, 1e3); } }, sticky_side = function() { var a = jQuery(".sidebar #mpu0").find("iframe"); if (a.length) { if (jQuery(".dark-background figure .bc_container .video-js").length && !jQuery("body").hasClass("admin-menu")) var b = !0; var c = a.height(), d = (jQuery(".sidebar").offset().top, jQuery(".sidebar")), e = jQuery(".main-content-column").height(), f = 0; jQuery(".sidebar").css("position", "relative"), jQuery(".sidebar").css("overflow", "hidden"), jQuery(".right-hand-column").css({ height: e }), c >= 250 && jQuery(window).on("scroll", function() { var a = jQuery(window).scrollTop(), c = jQuery(".right-hand-column").offset().top, e = a + 50 - c, g = jQuery(".sidebar").height(), h = jQuery(".right-hand-column").height(), i = h - g, j = 50; 1 == b && (e += 210, j += 210); var k = function() { setTimeout(function() { f = 1; var a = jQuery(".sidebar").offset().top, b = jQuery(".right-hand-column").offset().top; jQuery(window).width() >= 1e3 && jQuery(".sidebar").css({ position: "relative", top: a - b }); }, 6e3); }; e >= 0 && e < i && 0 == f ? (d.css("position", "fixed"), jQuery(window).width() >= 1e3 && d.css("top", j), k()) : e < 0 && 0 == f ? (d.css("position", "absolute"), d.css("top", 0)) : 0 == f && (d.css("position", "absolute"), d.css("top", i)); }); } }; jQuery(window).load(function() { "undefined" != typeof pageType && "video" == pageType && (stickyMe = "sticky"), "undefined" == typeof stickyMe && setTimeout(function() { sticky_leader(); }, 1e3), "undefined" == typeof stickyMpu && jQuery(".main-content-column").height() > jQuery(".sidebar").height() ? sticky_side() : sticky_mpu(); }); var sticky_video = function() { function a() { b.removeClass("sticky"), f.removeClass("sticky"), g.removeClass("sticky"), h.removeClass("sticky"), jQuery(".video-popout-text").remove(), d.removeAttr("style"); } var b = jQuery(".dark-background figure"), c = jQuery(".dark-background"); if (video_bg_height = c.height(), video_article_headline = jQuery('meta[name="twitter:title"]').attr("content"), jQuery(".video-playlist").length) var d = jQuery(".video-playlist"); else var d = jQuery(".full-article .article-wrapper"); var e = d.offset().top; b.wrap("
    "), b.wrap("
    "); var f = jQuery(".video-popout-wrap"), g = jQuery(".video-popout-inner"), h = jQuery(".video-popout-wrap .bc_container"), i = b.height(), j = 1; jQuery(window).on("scroll", function() { var c = jQuery(window).scrollTop(), k = c - e / 1.5; if (jQuery("body").on("click", ".video-popout-close", function() { j = 0, a(); }), k >= 0) { if (1 === j && (window.innerHeight > window.innerWidth || window.innerWidth > 760)) { b.addClass("sticky"), jQuery(".video-playlist").length ? d.css({ "margin-top": i + 45 }) : d.css({ "margin-top": i + 85 }), f.addClass("sticky"), g.addClass("sticky"), h.addClass("sticky"), jQuery(".video-popout-text").length || jQuery('
    ' + video_article_headline + "
    ").insertAfter(b); } } else k < 0 && "yes" && a(); }); }; jQuery(document).ready(function() { jQuery("body").hasClass("admin-menu") || "video" != pageType || !jQuery(".dark-background figure .bc_container .video-js").length || /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || sticky_video(); }), jQuery(document).ready(function(a) { function b(a) { if ("undefined" != typeof s_gi) { var b = s_gi(s_account); b.prop29 = a, b.events = "event13", b.t(), b.prop29 = b.events = ""; } } a(".relatedlinkslist").once("click-tracking", function() { a(".related", this).on("click", "a", function(c) { b("Position " + a(this).parent().prevAll().length + " - " + a(this).html()); }); }); }), function(a) { a(document).ready(function() { a('.adblock-notice [data-toggle="instructions"]').click(function() { a(".adblock-notice .main").hide(), a(".adblock-notice .instructions").show(), a(window).trigger("resize"); }); }); }(jQuery), function(a) { Drupal.behaviors.bestMegaNav = { attach: function(b, c) { a(".sub-nav > button").on("click", function(b) { a(".sub-nav > ul").slideToggle(), a(this).toggleClass("active"); }), a(".mega-nav > li .toggle").click(function() { a(window).width() < 1210 && (a(this).parent("li").hasClass("menu-open") ? a(this).parent("li").removeClass("menu-open") : (a(this).closest("ul").find("li").removeClass("menu-open"), a(this).parent("li").addClass("menu-open"))); }), a(".mega-nav > li > a").hover(function() { if (!(a(window).width() < 1210)) { var b, c = a(window).width() - 40, d = a(this).position(), e = a(this).nextAll(".menu"); e.addClass("menu-open"), b = d.left < 40 ? d.left : d.left - 40, e.width() + b > c && (b = c - e.width()), e.css("left", b); } }, function() { a(this).nextAll(".menu").removeClass("menu-open"); }), a(window).resize(function() { a(window).width() >= 1210 && (a(".mega-nav .menu-open").removeClass("menu-open"), a(".mega-nav").removeAttr("style")); }); } }; }(jQuery); var videoPlayerListen = function() { var a = Object.keys(videojs.players), b = a.length; if (b > 1) for (var c = 0; c < b; c++) { var d = videojs(a[c]), d = d.id_; videoPlayerEvent(d); } }; jQuery(document).ready(function() { "undefined" != typeof videojs && videoPlayerListen(); }), function(a, b) { b.behaviors.inesExplainer = { attach: function(b, c) { var d, e, f; a(".article-explainer").once(function() { d = a(".explainer-open"), e = a("#explainer-list .item-list"), f = a("a.explainer-question"), d.on("click", function() { e.css("display", "block"); }), f.on("click", function() { e.hide(); var b = a(location).attr("pathname") + a(this).attr("href"); window.location.href = b; }), a(window).load(function() { var b = a(".explainer-open"), c = b.offset(); a(window).on("scroll", function(b) { a(this).scrollTop() > c.top + 48 ? a(".explainer-open").addClass("fixed") : a(".explainer-open").removeClass("fixed"); }); }); }); } }; }(jQuery, Drupal); ;/**/