var clientAds=new Ads();thisPage.delayAdRender=(typeof document.getElementById!=UNDEFINED||typeof document.createElement!=UNDEFINED)?true:false;thisPage.delayAdRender=(is.mac&&is.ie)?false:true;thisPage.delayAdRender=(is.ie5&&!is.ie5_5)?false:true;thisPage.delayAdRender=(is.opera)?false:true;var AD_CONTAINER_PREFIX="ad-container-";var AD_PLACEHOLDER_PREFIX="ad-placeholder-";var AD_BANLB="banlb";var AD_MPUSKY="mpusky";var AD_MPU="mpu";var AD_WDESKY="wdesky";var AD_NRWSKY="nrwsky";var AD_ARTBOX="artbox";var AD_OOB="oob";var AD_FTHBOX="fthbox";var AD_ALPLIVP="alplivp";var AD_TLBX="tlbx";var AD_LHN="lhn";var AD_DSKALERT="dskalert";var AD_FMBUT2="fmbut2";var AD_QWS="qws";var AD_MKTBX="mktbx";var AD_POP="popp";var AD_BXBAR="bxbar";var AD_DKTALRT="dktalrt";var AD_DSKTICK="dsktick";var AD_PRNT="prnt";var AD_INV="inv";var AD_MBATOP="mbatop";var AD_MBABOT="mbabot";var AD_MBALINK="mbalink";var AD_SBHEAD="sbhead";var AD_FTNT="ftnt";var AD_1x1="1x1";var AD_CURRCON="currcon";var AD_CURRBOX="currbox";function Ads(){this.obj="AdsObject";eval(this.obj+"=this");var ads=new Array;var renderOneByOne=false;var preloadDefaultText="Loading advertisement...";var captionDefaultText="Advertisement";var placeHolderErrorDefaultText="Cannot load advertisement";var displayIfOutsizedtDefaultText="Advertisement too large to be displayed";this.fetch=function(pos){var ad;for(a in ads){if(a==pos){ad=ads[a];break;}} if(ad&&!ad.getFetched()&&ad.isFetchable()){document.write(ad.getAdHTML());ad.setFetched(true);}} this.render=function(pos){if(pos&&renderOneByOne){doRender(ads[pos]);}else if(!pos&&!renderOneByOne){for(var adPos in ads){doRender(ads[adPos]);}}} this.add=function(ad){var pos=ad.getPosition();if(ads[pos]){}else{ads[pos]=ad;} return ad;} function doRender(ad){if(ad&&ad.isRenderable()){var sourceDiv=document.getElementById(ad.getSourceDiv());var targetDiv=document.getElementById(ad.getTargetDiv());if(sourceDiv&&targetDiv&&!ad.getRendered()){sourceDiv.style.display="inline";var captionPara=document.createElement("p");var caption=ad.getShowCaption();if(captionPara){if(caption==true){caption=captionDefaultText;} captionPara.innerHTML=(caption);} if(!ad.getTrueWidth()){ad.setTrueWidth(ad.calculateTrueWidth());} if(!ad.getTrueHeight()){ad.setTrueHeight=(ad.calculateTrueWidth());} var tw=ad.getTrueWidth();var th=ad.getTrueHeight();if(ad.getDisplayIfOutsized()&&ad.isExist()){moveSourceToTarget(sourceDiv,targetDiv);if(caption.length>0){targetDiv.appendChild(captionPara);}}else if(!ad.getDisplayIfOutsized()&&ad.isExist()){var hintWidth=ad.getHintWidth();var hintHeight=ad.getHintHeight() var tolerance=0.05;tolWidth=hintWidth*(1+tolerance);tolHeight=hintHeight*(1+tolerance);if((!tolWidth||tolWidth&&tw<=tolWidth)&&(!tolHeight||tolHeight&&th<=tolHeight)){targetDiv.innerHTML="";moveSourceToTarget(sourceDiv,targetDiv);if(caption.length>0){setTimeout(function(){targetDiv.appendChild(captionPara);},1);} var marLeft=(targetDiv.offsetWidth-tw)/2;var marTop=(targetDiv.offsetHeight-th)/2;if(marLeft>0){} if(marTop>0){} var shiftDiv=document.getElementById("ad-shiftholder-"+ad.getPosition());var doShift=ad.getPosition()=="mpusky"&&targetDiv.offsetWidth>180;if(shiftDiv&&doShift){var shiftBy=shiftDiv.offsetTop-targetDiv.offsetTop;if(shiftBy>0){if(is.ie){targetDiv.style.display="none";attachOnload("var td=document.getElementById('"+targetDiv.id+"');document.getElementById('"+shiftDiv.id+"').insertBefore(td);td.style.display='block'");}else{shiftDiv.appendChild(targetDiv);}}}}else{var theSrc=ad.getAdHTML().match(/src=(.*)/);theSrc=RegExp.$1.replace(/=/," ");theSrc="";showError(displayIfOutsizedtDefaultText+" ("+tw+"x"+th+" should be "+hintWidth+"x"+hintHeight+" max.)"+"
"+theSrc);}}else{showError(placeHolderErrorDefaultText);} ad.setRendered(true);}} function moveSourceToTarget(s,t){var divvy=document.createElement("div");divvy.style.position="relative";divvy.style.height=s.offsetHeight+"px";divvy.style.width=s.offsetWidth+"px";if(!is.ie){var indent=(t.offsetWidth-s.offsetWidth)/2;divvy.style.left=(indent>0?indent:0)+"px";} t.appendChild(divvy);s.style.position="absolute";s.style.display="block";s.style.left=getElementLeft(divvy)+"px";s.style.top=getElementTop(divvy)+"px";} function showError(msg){var error=ad.getShowPlaceholderOnError();if(error==true){error=msg;} if(error.length>0){var para=document.createElement("p");para.innerHTML=error;para.style.marginTop=targetDiv.offsetHeight/3+"px";targetDiv.innerHTML="";targetDiv.appendChild(para);sourceDiv.innerHTML="";}else{sourceDiv.innerHTML="";targetDiv.innerHTML="";}}} this.renderPlaceholder=function(ad){var targetDiv=document.getElementById(ad.getTargetDiv());if(targetDiv){var preload=ad.getShowPreload();if(preload==true){preload=preloadDefaultText;} if(preload.length>0){var para=document.createElement("p");para.setAttribute(CLASS,"loader");para.innerHTML=preload;para.style.marginTop=targetDiv.offsetHeight/3+"px";targetDiv.innerHTML="";targetDiv.appendChild(para);}}} this.setRenderOneByOne=function(val){renderOneByOne=val;} this.debug=function(){var str="";for(var a in ads){var ad=ads[a];str+=("\n\n==================================="+"\nAdvert: "+ad.getPosition()+ (ad.isLegacy()?"\nTHIS AD IS FROM A LEGACY AD CALL!":"")+"\nid: "+ad.getId()+"\nname: "+ad.getName()+"\nflightId: "+ad.getFlightId()+"\nwrap: "+wrap+"\ntrueWidth: "+ad.getTrueWidth()+"\ntrueHeight: "+ad.getTrueHeight()+"\n===================================");} return(str);} this.getAdByPosition=function(pos){for(a in ads){if(a=pos){return ads[a];}}}} function Advert(pos){var sourceDiv;var targetDiv;var position=pos;var type=pos;var fetched=false;var rendered=false;var initialLength=0;var renderImmediately=false;var showPreload=false;var showCaption=false;var showPlaceholderOnError=false;var displayIfOutsized=false;var fetchable=true;var renderable=true;var hintWidth=null;var hintHeight=null;var id=null;var name=null;var flightId=null;var trueWidth=null;var trueHeight=null;var allParams=null;var isExist=false;this.adHTML="";var isLegacy=(arguments.length>1)?true:false;function setDisplayDefaults(_renderImmediately,_showPreload,_showCaption,_showPlaceholderOnError,_displayIfOutsized){renderImmediately=_renderImmediately;showPreload=_showPreload;showCaption=_showCaption;showPlaceholderOnError=_showPlaceholderOnError;displayIfOutsized=_displayIfOutsized;} function setDimensionHints(_hintWidth,_hintHeight){hintWidth=_hintWidth;hintHeight=_hintHeight;} this.init=function(){sourceDiv=AD_CONTAINER_PREFIX+position;targetDiv=AD_PLACEHOLDER_PREFIX+position;if(!thisPage.delayAdRender||this.getRenderImmediately()){clientAds.fetch(this.getPosition());this.setRendered(true);}else{clientAds.renderPlaceholder(this);}} this.getAdHTML=function(){var adHTML='';var style="";var pos=type;var adStyle=style?"¶ms.styles="+style:'';var adWrap=wrap!=''?'&wrap='+wrap:'';var siteName='ftcom';if(thisPage.ftsite=='yahoo1'){if(pos=='banlb'||pos=='mpusky'){siteName=thisPage.ftsite;}} if(thisPage.ftsite=='ftchina'){siteName=thisPage.ftsite;} var assRef="&asset="+thisPage.asset+"&referrer="+document.referrer;allParams="site="+siteName+"&pos="+pos+thisPage.alladparams+adWrap+thisPage.revScience+adStyle+assRef;var adsDom='http://ads.ft.com';if(thisPage.issec){adsDom='https://secureads.ft.com';} if(!is.nav4&&(!is.opera5&&!is.opera6)){adHTML+='\n';}else{adHTML+='';adHTML+='Advertisement';} return adHTML;} this.calculateTrueWidth=function(){var srcDiv=document.getElementById(sourceDiv);var allEls=srcDiv.childNodes;var maxWidth=0;for(var i=0;i