function initGoldStandardInsightsTabButton(){$(".btn-link").on("click",function(){$(this).next().toggleClass("is-active")});$(".btn-link").on("click",function(){$(this).toggleClass("active-on")})}function GoldStandardChooseAnotherContry(){$("#GS_ContrySelector_Country_Menu").addClass("hide");$("#GS_ContrySelector_Global_Menu").removeClass("hide");$("#GS_ContrySelector_Global_Menu_Mobile").removeClass("hide")}function calcVidHeight(){var i=$(".root .video .embed-responsive video.gs-fb-video"),s=$(".video"),e=i.height()==0?s.height():i.height(),r=$(window).height(),h=$(window).width(),c=$("nav").height(),l=$("#carousel-nav-items").height(),o=c+l,t=e-(r-o),n=r-o,u=180,f=400;if(n<f?n=f:n-u<f?n=n:(n=n-u,t>=0&&(t=u*2)),$(".video").length)if(e!=null||h<769)t>=0?(t=0-t/2,i.css("top",t+"px"),$(".root .video").css("height",n+"px")):($(".root .video").css("height","inherit"),i.css("top","inherit"));else{$(".root .video").css("height",r-250+"px");$(".root .video .embed-responsive.embed-responsive-16by9 .gs-video-fallback").css("height",n+"px");return}$(".no-video").length&&$(".root .no-video .embed-responsive.embed-responsive-16by9 .gs-video-fallback").css("height",n+"px")}function initTwitter(){function i(n){try{var t=n,i=$("#carousel-reviews .active").index()+1;t>2?($(".counter .counter-current").html(i),$(".counter .counter-all").html(t)):hideCounter()}catch(r){hideCounter()}hideCounter=function(){$(".counter").hide()}}function s(){var n=$("#carousel-reviews .active");n.is(":first-child")?$(".up.control").hide():$(".up.control").show();n.is(":last-child")?$(".down.control").hide():$(".down.control").show()}function h(n,t){t||(t="en-gb");SCHRODERS.ieVersionCheck.init()&&(n=Date.parse(n.replace(/( \+)/," UTC$1")));var i=new Date(n),r=i.toLocaleString(t,{month:"short"});return r+" "+i.getDate()}var t=[],n=[],r=$("body").data("startpage-id"),u="/api/goldstandardtwitterfeed/?startpageId="+r,f=["panel-mustard","panel-sun","panel-trinidad","panel-pink-salmon","panel-mandy","panel-disco","panel-conifer","panel-apple","panel-jungle-green","panel-vivid-violet","panel-dark-violet","panel-gigas"],e=$("#tpl_twitter_row").html(),o="https://twitter.com/i/web/status/";$.getJSON(u,function(r){var c,l,u;for($.each(r,function(n,i){var r={_id:i.id_str,text:i.text,created_at:h(i.created_at),color:f[n],url:o+i.id_str};t.push(r)}),c=3;t.length>0;)n.push({panels:t.splice(0,c)});l=Mustache.render(e,n);$("#tweet_result").html(l);u=SCHRODERS.iOSVersionCheck.init();u<=9&&u!=0&&$(".item").addClass("no-transition");$("#tweet_result .item:first-child").addClass("active");$(".up.control").hide();i(n.length);$("#carousel-reviews").on("slid.bs.carousel",function(){i(n.length);s()})})}$(window).ready(function(){calcVidHeight();$(".carousel-nav .carousel-nav-row div:nth-child(1) button").addClass("active");var n=0;$("#carousel-nav-items .btn-carousel").length>0&&(n=$("#carousel-nav-items .btn-carousel")[0].attributes["data-index"].value);n===$("#carousel-example-generic .carousel-inner .item")[0].attributes["data-tab-index"].value?$("#carousel-example-generic .carousel-inner .item:nth-child(1)").addClass("active"):n===$("#carousel-example-generic .carousel-inner .item")[1].attributes["data-tab-index"].value?$("#carousel-example-generic .carousel-inner .item:nth-child(2)").addClass("active"):n===$("#carousel-example-generic .carousel-inner .item")[2].attributes["data-tab-index"].value?$("#carousel-example-generic .carousel-inner .item:nth-child(3)").addClass("active"):$("#carousel-example-generic .carousel-inner .item:nth-child(1)").addClass("active");$(".carousel-nav .active").focus();$(".btn-carousel").on("click",function(){$(".btn-carousel").removeClass("active");$(this).addClass("active")});$(".slide2").hasClass("active")&&$(".twitter-carsousel").removeClass("hide");$(".dropdown-menu-options .nav-items").on("click",function(){$(".slide2").addClass("redraw-insights")});$(".btn-link").click(function(){$(this).find(".btn").toggleClass("active-on")});$(".toggle-showme").on("click",function(){$(".dropdown").removeClass("header-link-active");$(this).toggleClass("header-link-active");$(".fixed-mega-nav.global").removeClass("is-active");$(".fixed-mega-nav.search").removeClass("is-active");$(".fixed-mega-nav.showme").toggleClass("is-active");$(".fixed-mega-nav.showme").hasClass("is-active")||$(this).removeClass("header-link-active")});$(".toggle-global").on("click",function(){$(".dropdown").removeClass("header-link-active");$(this).toggleClass("header-link-active");$(".fixed-mega-nav.showme").removeClass("is-active");$(".fixed-mega-nav.search").removeClass("is-active");$(".fixed-mega-nav.global").toggleClass("is-active");$(".fixed-mega-nav.global").hasClass("is-active")||$(this).removeClass("header-link-active")});$(".toggle-search").on("click",function(){$(".dropdown").removeClass("header-link-active");$(this).toggleClass("header-link-active");$(".fixed-mega-nav.showme").removeClass("is-active");$(".fixed-mega-nav.global").removeClass("is-active");$(".fixed-mega-nav.search").toggleClass("is-active");$(".fixed-mega-nav.global").hasClass("is-active")||$(this).removeClass("header-link-active")});$(".btn-link").on("click",function(){$(this).next().toggleClass("is-active");$(this).toggleClass("active-on").children("button").attr("aria-expanded",function(n,t){return t=="true"?"false":"true"})});initTwitter();$("#main").on("click",function(){$(".fixed-mega-nav.global").removeClass("is-active");$(".fixed-mega-nav.showme").removeClass("is-active");$(".dropdown.toggle-showme").removeClass("header-link-active");$(".dropdown.toggle-global").removeClass("header-link-active")});$(".fixed-mega-nav.global a").on("click",function(n){var i=$(n.target),t;i&&(t=i.data("nav-type"),(t==="region"||t==="country")&&($('.fixed-mega-nav.global a[data-nav-type="country"]').parent().removeClass("active"),$('.fixed-mega-nav.global a[data-nav-type="site"]').parent().removeClass("active"),$('.fixed-mega-nav.global a[data-nav-type="siteLanguage"]').parent().removeClass("active"),$('[data-nav-type="site"]').removeClass("active")))})});$(window).resize(function(){window._PageEditing||setTimeout(calcVidHeight(),250)})