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 onloadComplete=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=el('blq-nav-btn').getElementsByTagName('a')[0];computedStyles=(document.defaultView&&document.defaultView.getComputedStyle(exploreButton,null))||exploreButton.currentStyle;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(el('blq-nav')){var exploreButton=el('blq-nav-btn').getElementsByTagName('a')[0];if(computedStyles.color=="rgb(255, 255, 255)"){browserCSS=true;}}
if(browserJS&&browserCSS&&exploreButton){if(navClicked){animateNav('show');}
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(){animateNav('hide');oldOnClick();};}else{document.body.onclick=function(){animateNav('hide');};}
el('blq-nav').onclick=function(e){stopBubble(e);};if(document.images&&el('blq-blocks').offsetWidth=="107"){var navPanelBG=new Image(645,199);navPanelBG.src=blq.panelSrc;browserImages=true;if(onloadComplete){el('blq-acc').style.backgroundColor="transparent";}}else{var navLinks=el('blq-nav-links');navLinks.style.backgroundColor="#efefef";navLinks.style.border="1px solid #ccc";}}
blq.addGoTrack('blq-acc');blq.addGoTrack('blq-mast');blq.addGoTrack('blq-nav');blq.addGoTrack('blq-disclaim');blq.addGoTrack('blq-sitelinks');blq.addGoTrack('blq-bbclinks');}
this.onLoad=function(){if(browserImages){el('blq-acc').style.backgroundColor="transparent";}else{onloadComplete=true;}}
this.toggleNav=function(e){if(document.getElementById('blq-nav-links').style.display=="block"){animateNav('hide');}else{animateNav('show');}
stopBubble(e);}
this.addGoTrack=function(el,opts){var el=document.getElementById(el)||el,opts=opts||{},links=el.nodeName=='A'?[el]:el.length?el:el.getElementsByTagName('a'),extOnly=opts.external||false,goCode=opts.go||(el.id?el.id.replace(/-/g,'/')+'/{dir}':'auto/{dir}');for(var i=0;i<links.length;i++){var externalURL=false,oldHref=false;if((typeof links[i]!="object")||(!links[i].href)||links[i].className.indexOf('blq-nogo')!=-1||links[i].href.indexOf('/go/')!=-1||links[i].href.charAt(window.location.toString().split('#')[0].length)=='#'||links[i].href.charAt(0)=='#'||links[i].href.indexOf('mailto:')==0||links[i].href.indexOf('javascript:')==0||links[i].href.indexOf('itpc:')==0||links[i].href.indexOf('zune:')==0||links[i].href.indexOf('zcast:')==0){continue;}
var currentServer=window.location.href.split("//")[1].split("/")[0],reCurrentServer=currentServer.replace(/\./g,'\\.'),path=links[i].href.split('?')[0],re=new RegExp("^[A-Za-z]+:\\/\\/(?:[^.]+\\.)*(?:bbc\\.co\\.uk|doubleclick\\.net |"+reCurrentServer+")");if(!re.test(path)){var page=location.pathname,externalURL=true,goCopy=page+(page.charAt(page.length-1)=='/'?'':'/')+'ext/_auto';}else if(extOnly){continue;}else{var splitPath=path.split('/'),goCopy=goCode,goDir=splitPath.length<5?splitPath[splitPath.length-1]||splitPath[splitPath.length-2]:splitPath[splitPath.length-2]||splitPath[splitPath.length-1];goCopy=goCopy.replace('{dir}',goDir);goCopy=goCopy.replace('{count}',i+1);goCopy='/'+goCopy;}
var clickCopy=links[i].onclick,hrefCopy,baseCopy=false;if(path.indexOf('www.bbc.co.uk')!=-1){hrefCopy='http://www.bbc.co.uk/go'+goCopy+'/-/'+links[i].href.substring(links[i].href.indexOf("bbc.co.uk/")+10,links[i].href.length);}else if(externalURL||links[i].href.indexOf(currentServer)==-1){hrefCopy='/go'+goCopy+'/-/'+links[i].href;}else{hrefCopy='/go'+goCopy+'/-/'+links[i].href.substring(links[i].href.indexOf("bbc.co.uk/")+10,links[i].href.length);}
links[i].onclick=(function(){var thisClick=clickCopy,thisHref=hrefCopy;return function(){this.href=thisHref;if(typeof thisClick=='function'){thisClick()};}})();}}
this.tagEnglishLinks=function(label,tooltipTargets){if(browserJS&&browserCSS&&browserImages){this.addTooltips(el('blq-acc').getElementsByTagName('a'),label,"hreflang","en-GB");this.addTooltips(el('blq-foot').getElementsByTagName('a'),label,"hreflang","en-GB");if(tooltipTargets!="false"){tooltipTargets=tooltipTargets.split(',');for(var i=tooltipTargets.length-1;i>=0;i--){if(el(tooltipTargets[i])){this.addTooltips(el(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(el('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);}}}
this.addAutoSuggest=function(server,path,file){var searchBox=document.getElementById('blq-search');searchBox.setAttribute('autocomplete','off');searchBox.onfocus=function(){gloader.map.add('barlesque',{$version:'0.3.0',$server:'http://'+server,$base:'{$server}'+path+'script','barlesque':'{$base}/barlesque.js'});gloader.load(["barlesque","0"],["glow","1"],{async:true,onLoad:function(barlesque,glow){glow.ready(function(){barlesque.searchSuggest(file);document.getElementById('blq-search').onfocus=function(){};});}});};}
function letShowTooltip(n,i){return function(){el('blq-tooltip-'+n+i).style.display='block';};}
function letHideTooltip(n,i){return function(){el('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 animateNav(action){var agent=navigator.userAgent.toLowerCase();if(el('blq-nav-links').style.opacity!=undefined&&agent.indexOf("chrome")==-1){var currentOpacity=el('blq-nav-links').style.opacity||0;if(action=='show'){el('blq-nav-links').style.display="block";if(el('blq-home').focus){el('blq-home').focus();}
if(currentOpacity<1){el('blq-nav-links').style.opacity=(parseFloat(currentOpacity)+0.15);setTimeout(function(){animateNav('show');},30);}else{el('blq-nav-links').style.opacity=1;}}else{if(currentOpacity>0){el('blq-nav-links').style.opacity=(parseFloat(currentOpacity)-0.15);setTimeout(function(){animateNav('hide');},30);}else{el('blq-nav-links').style.opacity=0;el('blq-nav-links').style.display="none";}}}else{if(action=='show'){el('blq-nav-links').style.display="block";}else{el('blq-nav-links').style.display="none";}}}
function stopBubble(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
function el(id){return document.getElementById(id);}}
blq.init();blqOnDomReady(function(){blq.domReady();});blqAddLoadEvent(blq.onLoad);