function init(){document.body.className="hasJS loading";window.addEvent('domready',function(){new plinth();new tables();if($('siteMap')){new siteMap('siteMap','siteMapTrigger')}var myUrl=document.location.href;if(location.href.indexOf("bac_co_uk")==-1){window.env="PRODUCTION"}else{window.env="STAGING"}new confirm();Cufon.replace('h1, h2, .plinth h3, .existingcustomers h3, table.vertical th, td.lrg, caption, a.tabLinkTitle');document.body.className="hasJS domReady";var FAQs=$$('a[rel=faqs]');FAQs.each(function(item){new popup(item,{'name':'eKnowledge'});item.appendText(" ");if(window.env=="STAGING"){slnk="/bac_co_uk/lib-ui/img/pages/new-window.gif"}else{slnk="/lib-ui/img/pages/new-window.gif"}item.adopt(new Element('img',{'src':slnk,'alt':'opens a new window'}))},this);var blankLinks=$$('a[rel=blank]');blankLinks.set('target','_blank');blankLinks.each(function(item){item.appendText(" ");if(window.env=="STAGING"){slnk="/bac_co_uk/lib-ui/img/pages/new-window.gif"}else{slnk="/lib-ui/img/pages/new-window.gif"}item.adopt(new Element('img',{'src':slnk,'alt':'opens a new window'}))},this);var autoOff=$$('input.nocomplete');autoOff.set('autocomplete','off');var alertRole=$$('.error');alertRole.set('role','alert');$$('ul li:first-child').addClass('first');$$('ul li:last-child').addClass('last');var navSecondary=$$('.navsecondary');var navSecondarySub=navSecondary.getElement('ul ul');if(navSecondarySub[0]!=null){var selected=navSecondary.getElement('li.selected');selected.addClass('expanded')}if(!CheckApp()){var myUrl=document.location.href;myUrl=myUrl.replace(new RegExp(/^https\:\/\//i),"http://");if(myUrl!=document.location.href){window.location=myUrl}}})}function $getUrlKey(key,url){if(arguments.length<2)url=location.href;if(arguments.length>0&&key!=""){if(key=="#"){var regex=new RegExp("[#]([^$]*)")}else if(key=="?"){var regex=new RegExp("[?]([^#$]*)")}else{var regex=new RegExp("[?&]"+key+"=([^&#]*)")}var results=regex.exec(url);return(results==null)?"":results[1]}else{url=url.split("?");var results={};if(url.length>1){url=url[1].split("#");if(url.length>1)results["hash"]=url[1];url[0].split("&").each(function(item,index){item=item.split("=");results[item[0]]=item[1]})}return results}};function CheckApp(){if($('FDC_APPLICATION_NAME')){return true}else{return false}};function popitup(url){var newwindow=window.open(url,'name','status=yes,width=790,height=577');if(window.focus){newwindow.focus()}return false};