function blqAddLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}
else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
var blqOnDomReady;(function(){var toRun=function(){},isReady=false,d=document,ua=navigator.userAgent.toLowerCase();blqOnDomReady=function(f){if(isReady){f();}else{var oldLoadFunc=toRun;toRun=function(){oldLoadFunc();f();};}};if(/*@cc_on !@*/false){(function(){try{d.documentElement.doScroll('left');}catch(e){setTimeout(arguments.callee,50);return;}
toRun();})();}else if(typeof d.readyState!='undefined'&&!(Number((/applewebkit\/(\d+(?:\.\d+)?)/.exec(ua)||[0,NaN])[1])<312)){var f=function(){/loaded|complete/.test(d.readyState)?toRun():setTimeout(f,10);};f();}else{var callback=function(){if(arguments.callee.fired){return;}
arguments.callee.fired=true;toRun();};d.addEventListener("DOMContentLoaded",callback,false);var oldOnload=window.onload;window.onload=function(){if(oldOnload){oldOnload();}
callback();};}
blqOnDomReady(function(){isReady=true;});})();var blq=new function(){var computedStyles;var navClicked=false;var browserCSS=false;var browserImages=false;var browserJS=(document.getElementById&&document.getElementsByTagName)?true:false;this.panelSrc="";this.init=function(){if(browserJS){if(typeof document.documentElement.className=="string"){document.documentElement.className+=" blq-js";}else{document.documentElement.className="blq-js";}}}
this.exploreReady=function(){var exploreButton=e('blq-nav-btn').getElementsByTagName('a')[0];computedStyles=exploreButton.currentStyle||(document.defaultView&&document.defaultView.getComputedStyle(exploreButton,null));if(computedStyles.color=="rgb(255, 255, 255)"||computedStyles.color=="#ffffff"||computedStyles.color=="#fff"||computedStyles.color==""){browserCSS=true;}
if(browserJS&&browserCSS){exploreButton.href="#blq-nav";exploreButton.onclick=function(e){navClicked=true;stopBubble(e);return false;};}}
this.domReady=function(){if(e('blq-nav')){var exploreButton=e('blq-nav-btn').getElementsByTagName('a')[0];if(computedStyles.color=="rgb(255, 255, 255)"){browserCSS=true;}}
if(browserJS&&browserCSS&&exploreButton){if(navClicked){showNav();}
exploreButton.href="#blq-nav";exploreButton.onclick=function(e){blq.toggleNav(e);return false;};if(typeof document.body.onclick=="function"){var oldOnClick=document.body.onclick;document.body.onclick=function(){hideNav();oldOnClick();};}else{document.body.onclick=function(){hideNav();};}
e('blq-nav').onclick=function(e){stopBubble(e);};if(document.images&&e('blq-blocks').offsetWidth=="107"){var navPanelBG=new Image(645,199);navPanelBG.src=blq.panelSrc;browserImages=true;e('blq-acc-head').style.backgroundColor="transparent";}else{var navLinks=e('blq-nav-links');navLinks.style.backgroundColor="#efefef";navLinks.style.border="1px solid #ccc";}}}
this.toggleNav=function(e){if(document.getElementById('blq-nav-links').style.display=="block"){hideNav();}else{showNav();}
stopBubble(e);}
this.linkTrack=function(scope){var currentServer=document.location.href.split("//")[1];currentServer=currentServer.split("/")[0];if(browserJS){if(scope=='body'){var links=document.getElementsByTagName('a')}else{var links=e('blq-main').getElementsByTagName('a')}
for(var i=(links.length-1);i>=0;i--){var path=links[i].href.split('?')[0];if(path.indexOf("http://")!=-1&&(path.indexOf("bbc.co.uk")==-1&&path.indexOf("doubleclick.net")==-1)&&path.indexOf(currentServer)==-1){var newURL='/go';newURL+=location.pathname;newURL+=(newURL.substr(newURL.length-1)=='/')?'ext/_auto/-/':'/ext/_auto/-/';newURL+=links[i].href;links[i].href=newURL;}}}}
this.tagEnglishLinks=function(label,tooltipTargets){if(browserJS&&browserCSS&&browserImages){this.addTooltips(e('blq-acc').getElementsByTagName('a'),label,"hreflang","en-GB");this.addTooltips(e('blq-foot').getElementsByTagName('a'),label,"hreflang","en-GB");if(tooltipTargets!="false"){tooltipTargets=tooltipTargets.split(',');for(var i=tooltipTargets.length-1;i>=0;i--){if(e(tooltipTargets[i])){this.addTooltips(e(tooltipTargets[i]).getElementsByTagName('a'),label,"hreflang","en-GB");}}}
}}
this.addTooltips=function(collection,label,attribute,value){for(var i=collection.length-1;i>=0;i--){if(collection[i].getAttribute(attribute)==value){if(collection[i].className){collection[i].className+=' blq-tooltipped';}else{collection[i].className='blq-tooltipped';}
var tooltip=document.createElement('span');var tooltipClassString="blq-tooltip";if(getPosition(collection[i])[1]<40){tooltipClassString+=" blq-tipunder";}
if(getPosition(collection[i])[0]-getPosition(e('blq-main'))[0]>600){tooltipClassString+=" blq-tipright";}
tooltip.setAttribute('class',tooltipClassString);tooltip.setAttribute('className',tooltipClassString);tooltip.innerHTML='<span class="blq-tooltip-l">'+label+'</span><span class="blq-tooltip-r">&nbsp;</span>';collection[i].appendChild(tooltip);}}}
function letShowTooltip(n,i){return function(){e('blq-tooltip-'+n+i).style.display='block';};}
function letHideTooltip(n,i){return function(){e('blq-tooltip-'+n+i).style.display='none';};}
function getPosition(theElement){var positionY=0;var positionX=0;while(theElement!=null){positionX+=theElement.offsetLeft;positionY+=theElement.offsetTop;theElement=theElement.offsetParent;}
return[positionX,positionY];}
function showNav(){e('blq-nav-links').style.display="block";if(e('blq-home').focus){e('blq-home').focus();}}
function hideNav(){e('blq-nav-links').style.display="none";}
function stopBubble(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
function e(id){return document.getElementById(id);}}
blq.init();blqOnDomReady(function(){blq.domReady();});