var Custom=new Class();Custom.showTransitions=true;Custom.getDuration=function(a){return Custom.showTransitions&&a!=null?a:0};Element.implement({getFullHeight:function(){return this.offsetHeight.toInt()+this.getStyle("marginTop").toInt()+this.getStyle("marginBottom").toInt()},getFullWidth:function(){return this.offsetWidth.toInt()+this.getStyle("marginLeft").toInt()+this.getStyle("marginRight").toInt()}});Custom.Flash={installed:(Browser.Plugins.Flash.version>=6),currentId:0,object:function(b,a,c,h,e,g,i){var f=Custom.Flash;if(!f.installed){return null}if(e==null){e={}}if(g==null){g={}}var j={width:c,height:h,container:b,params:e,vars:g,events:i};if(!a.match(/^\w+:\/\/|^\//)){a=Custom.rootUrl+"flash/"+a+".swf"}if(e.makeVisible&&$(b).getStyle("visibility")=="hidden"){$(b).setStyle("visibility","inherit")}var d=new Swiff(a,j);return d},getNewId:function(){return"ft_auto_"+(++this.currentId)}};Custom.Flash.Titles={loadItem:function(e,a,b){if(!b){b=document.body}b=$(b);if(!a){a=this.setup[e]}var d=this;var c=b.getElements(e);c.each(function(j){if(j.retrieve("Custom.Flash.Titles.implemented")){return}if(!j.id){j.id=Custom.Flash.getNewId()}var k=j.offsetWidth;var f=j.offsetHeight;var h=a.font;var l=j.get("html").replace(/\r|\n|^\s+|\s+$/g,"").replace(/\s{2,}/g," ");if(l==""){return}if(a.texttransform=="uppercase"){l=l.toUpperCase()}else{if(a.texttransform=="lowercase"){l=l.toLowerCase()}}var i={title:l};for(var g in a){if(g!="font"&&g!="texttransform"&&g!="setheight"){i[g]=a[g]}}if(j.get("tag")=="a"){i.link=j.href}k-=j.getStyle("padding-left").toInt()+j.getStyle("padding-right").toInt();f-=j.getStyle("padding-top").toInt()+j.getStyle("padding-bottom").toInt();if(a.setheight){j.setStyle("height",f+"px")}if(Custom.Testing.flashTitles){Custom.Flash.object.delay(1000,Custom.Flash,[j.id,h,k,f,{makeVisible:true,wMode:"transparent"},i])}else{Custom.Flash.object(j.id,h,k,f,{makeVisible:true,wMode:"transparent"},i)}j.store("Custom.Flash.Titles.implemented",true)})},scanPage:function(a){var c=this;for(var b in this.setup){this.loadItem(b,this.setup[b],a)}}};Custom.Accordion=new Class({Implements:Options,options:{link:"cancel",opacity:true,display:-1,alwaysHide:true,duration:700,transition:"expo:out",openClass:"selected",frame:".accordion%level%",togglers:".acc-toggler%level%",contents:".acc-content%level%"},initialize:function(b){this.setOptions(b);var c=b?b.onComplete:null;var a=b?b.onActive:null;var g=b?b.onBackground:null;this.options.onComplete=function(i,h){if(c){c(i,h,this.options.level)}};this.options.onActive=function(i,h){if(this.options.openClass){i.addClass(this.options.openClass)}if(a){a(i,h,this.options.level)}};this.options.onBackground=function(i,h){if(this.options.openClass){i.removeClass(this.options.openClass)}if(g){g(i,h,this.options.level)}};var d=1;do{var f=$$(this.options.frame.replace(/%level%/g,d));var e=(f.length>0);if(e){f.each(function(o,h){var m=o.getElements(this.options.togglers.replace(/%level%/g,d));var l=o.getElements(this.options.contents.replace(/%level%/g,d));var k=(m.length>0&&m.length==l.length);if(k){l.each(function(i){if(i.getStyle("display")=="none"){i.setStyle("display","block")}});var j=0;while(j<m.length&&!m[j].hasClass(this.options.openClass)){j++}this.options.display=(j<m.length)?j:-1;this.options.level=d;var n=new Fx.Accordion(m,l,this.options);n.options.wait=false;if(o.id!=""){window["accordion-"+o.id]=n}}},this);d++}}while(e)}});Custom.Css={_getCss:function(){return(Browser.ie)?this.style.styleSheet.cssText:this.style.get("text")},_setCss:function(a){if(Browser.ie){this.style.styleSheet.cssText=a}else{this.style.set("text",a)}},addRules:function(a){var b="";if(!this.style){this.style=new Element("style",{type:"text/css"}).inject(document.getElement("head"))}else{a=this._getCss()+"\n"+a}this._setCss(a)}};Custom.init=function(a){Custom.rootUrl=a?a:"";if(Browser.Platform.ios){Custom.showTransitions=false}if(Custom.Flash.installed&&!Custom.Testing.flashTitles){Custom.Css.addRules(".flash-title { visibility:hidden; }")}window.addEvent("domready",function(){if(Browser.Platform.ipod){Custom.showTransitions=false}if(Browser.safari){delete Custom.Flash.Titles.setup["#header .banners .button .flash-title"];$$("#header .banners .button .flash-title").setStyle("visibility","inherit")}Custom.Flash.Titles.scanPage();new Custom.Accordion({frame:".acc-frame-%level%",togglers:".acc-toggler-%level%",contents:".acc-content-%level%",openClass:"opened"})})};Custom.Testing={flashTitles:false};Custom.Flash.Titles.setup={".title h1.flash-title":{font:"ft_myriad_pro",textsize:37,textcolour:"444751",textspacing:-2,setheight:true},".title h2.flash-title":{font:"ft_myriad_pro",textsize:20,textcolour:"444751",textspacing:-1,setheight:true},".homepage-content h3.flash-title":{font:"ft_myriad_pro",textsize:20,textcolour:"444751",textspacing:-1,setheight:true},".side-nav h3.flash-title":{font:"ft_myriad_pro",textsize:20,textcolour:"444751",textspacing:-1,setheight:true},".sub-title h3.flash-title":{font:"ft_myriad_pro",textsize:30,textcolour:"444751",textspacing:-1,setheight:true},".sub-title h4.flash-title":{font:"ft_myriad_pro",textsize:16,textcolour:"444751",textspacing:-1,setheight:true},"#header .banners .button .flash-title":{font:"ft_myriad_pro",textsize:21,textcolour:"444751",textspacing:-1,setheight:true}};
