Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a)},compute:function(g,f,e){var b={};for(var a in g){var d=g[a],j=f[a],h=b[a]={};for(var c in d){h[c]=this.parent(d[c],j[c],e)}}return b},set:function(d){for(var c in d){var a=d[c];for(var b in a){this.render(this.elements[c],b,a[b],this.options.unit)}}return this},start:function(b){if(!this.check(arguments.callee,b)){return this}var f={},e={};for(var a in b){var h=b[a],d=f[a]={},g=e[a]={};for(var c in h){var j=this.prepare(this.elements[a],c,h[c]);d[c]=j.from;g[c]=j.to}}return this.parent(f,e)}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var b=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(b.elements,b.options);this.togglers=$$(b.togglers);this.container=$(b.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var c=0,a=this.togglers.length;c<a;c++){this.addSection(this.togglers[c],this.elements[c])}this.elements.each(function(e,f){if(this.options.show===f){this.fireEvent("active",[this.togglers[f],e])}else{for(var d in this.effects){e.setStyle(d,0)}}},this);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(d,f,b){d=$(d);f=$(f);var c=this.togglers.contains(d);var g=this.togglers.length;this.togglers.include(d);this.elements.include(f);if(g&&(!c||b)){b=$pick(b,g-1);d.inject(this.togglers[b],"before");f.inject(d,"after")}else{if(this.container&&!c){d.inject(this.container);f.inject(this.container)}}var a=this.togglers.indexOf(d);d.addEvent("click",this.display.bind(this,a));if(this.options.height){f.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){f.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}f.fullOpacity=1;if(this.options.fixedWidth){f.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){f.fullHeight=this.options.fixedHeight}f.setStyle("overflow","hidden");if(!c){for(var e in this.effects){f.setStyle(e,0)}}return this},display:function(a){a=($type(a)=="element")?this.elements.indexOf(a):a;if((this.timer&&this.options.wait)||(a===this.previous&&!this.options.alwaysHide)){return this}this.previous=a;var b={};this.elements.each(function(d,e){b[e]={};var f=(e!=a)||(this.options.alwaysHide&&(d.offsetHeight>0));this.fireEvent(f?"background":"active",[this.togglers[e],d]);for(var c in this.effects){b[e][c]=f?0:d[this.effects[c]]}},this);return this.start(b)}});Accordion.prototype.rerender=function(){index=this.previous;el=this.elements[index];var b={};b[index]={};for(var a in this.effects){b[index][a]=el[this.effects[a]]}return this.start(b)};$extend(Browser,{getHost:function(a){a=$pick(a,window.location.href);var b=a;if(a.test("http://")){a=a.substring(a.indexOf("http://")+7,a.length);if(a.test(":")){a=a.substring(0,a.indexOf(":"))}if(a.test("/")){return a.substring(0,a.indexOf("/"))}return a}return false},getQueryStringValue:function(b,a){try{return Browser.getQueryStringValues(a)[b]}catch(c){return null}},getQueryStringValues:function(b){var a=$pick(b,window.location.search,"").split("?")[1];if(!$chk(a)){return{}}if(a.test("#")){a=a.substring(0,a.indexOf("#"))}try{if(a){return a.parseQuery()}}catch(c){return null}return{}},getPort:function(c){c=$pick(c,window.location.href);var d=new RegExp(":([0-9]{4})");var a=d.exec(c);if(a==null){return false}else{var b=false;a.each(function(e){if($chk(parseInt(e))){b=e}})}return b},redraw:function(a){var b=document.createTextNode(" ");this.adopt(b);(function(){b.dispose()}).delay(1);return this}});window.addEvent("domready",function(){var b=0;function a(){function c(){b++;if(b<20){a.delay(50)}}try{if(!Browser.getQueryStringValues()){c()}else{Browser.qs=Browser.getQueryStringValues()}}catch(d){c()}}a()});Hash.implement({getFromPath:function(a){var b=this.getClean();a.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(c){if(!b){return}var d=arguments[2]||arguments[1]||arguments[0];b=(d in b)?b[d]:null;return c});return b},cleanValues:function(a){a=a||$defined;this.each(function(c,b){if(!a(c)){this.erase(b)}},this);return this},run:function(){var a=$arguments;this.each(function(c,b){if($type(c)=="function"){c.run(a)}})}});String.implement({stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},parseQuery:function(c,a){c=$pick(c,true);a=$pick(a,true);var d=this.split(/[&;]/);var b={};if(d.length){d.each(function(f){var e=f.split("=");if(e.length&&e.length==2){b[(c)?encodeURIComponent(e[0]):e[0]]=(a)?encodeURIComponent(e[1]):e[1]}})}return b},tidy:function(){var a=this.toString();$each({"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"},function(c,b){a=a.replace(new RegExp(b,"g"),c)});return a},cleanQueryString:function(a){return this.split("&").filter(a||function(b){return $chk(b.split("=")[1])}).join("&")},findAllEmails:function(){return this.match(new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?","gi"))||[]}});var HistoryManagerX=new Class({Implements:[Events,Options],options:{observeDelay:100,stateSeparator:";",iframeSrc:"blank.html"},dataOptions:{skipDefaultMatch:true,defaults:[],regexpParams:""},initialize:function(a){if(Browser.Engine.trident){if(window.location.hash==""){window.location.replace("#")}}this.setOptions(a||{});if(this.modules){return this}this.modules=$H({});this.count=history.length;this.states=[];this.states[this.count]=this.getHash();this.state=null;return this},start:function(){this.observe.periodical(this.options.observeDelay,this);this.started=true;this.observe();this.update();this.fireEvent("onStart",[this.state]);return this},register:function(b,g,c,f,e,a){if(!this.modules){this.initialize()}var d=$merge(this.dataOptions,a||{},{defaults:g,onMatch:c,onGenerate:f,regexp:e});d.regexp=d.regexp||b+"-([\\w_-]*)";if(typeof d.regexp=="string"){d.regexp=new RegExp(d.regexp,d.regexpParams)}d.onGenerate=d.onGenerate||function(h){return b+"-"+h[0]};d.values=d.defaults.slice();this.modules.set(b,d);this.fireEvent("onUnregister",[b,d]);return{setValues:function(h){return this.setValues(b,h)}.bind(this),setValue:function(h,j){return this.setValue(b,h,j)}.bind(this),generate:function(h){return this.generate(b,h)}.bind(this),unregister:function(){return this.unregister(b)}.bind(this)}},unregister:function(a){this.fireEvent("onRegister",[a]);this.modules.remove(a)},setValues:function(b,a){var c=this.modules.get(b);if(!c||c.values.isSimilar(a)){return this}c.values=a;this.update();return this},setValue:function(b,a,d){var c=this.modules.get(b);if(!c||c.values[a]==d){return this}c.values[a]=d;this.update();return this},generate:function(b,a){var d=this.modules.get(b);var e=d.values.slice();d.values=a;var c=this.generateState();d.values=e;return"#"+c},observe:function(){if(this.timeout){return}var a=this.getState();if(this.state==a){return}if((Browser.Engine.trident||window.webkit419)&&(this.state!==null)){this.setState(a,true)}else{this.state=a}this.modules.each(function(d,b){var c=a.match(d.regexp);if(c){c.splice(0,1);c.complement(d.defaults);if(!c.isSimilar(d.defaults)){d.values=c}}else{d.values=d.defaults.slice()}d.onMatch(d.values,d.defaults)});this.fireEvent("onStateChange",[a]).fireEvent("onObserverChange",[a])},generateState:function(){var a=[];this.modules.each(function(c,b){if(c.skipDefaultMatch&&c.values.isSimilar(c.defaults)){return}a.push(c.onGenerate(c.values))});return a.join(this.options.stateSeparator)},update:function(){if(!this.started){return this}var a=this.generateState();if((!this.state&&!a)||(this.state==a)){return this}this.setState(a);this.fireEvent("onStateChange",[a]).fireEvent("onUpdate",[a]);return this},observeTimeout:function(){if(this.timeout){this.timeout=$clear(this.timeout)}else{this.timeout=this.observeTimeout.delay(200,this)}},getHash:function(){var a=top.location.href;var b=a.indexOf("#")+1;return(b)?a.substr(b):""},getState:function(){var state=this.getHash();if(this.iframe){var doc=this.iframe.contentWindow.document;if(doc&&doc.body.id=="state"){eval("state_obj = "+doc.body.innerText);var istate=state_obj.state;if(this.state==state){return istate}this.istateOld=true}else{return this.istate}}if(window.webkit419&&history.length!=this.count){this.count=history.length;return $pick(this.states[this.count-1],state)}return state},setState:function(b,a){b=$pick(b,"");if(window.webkit419){if(!this.form){this.form=new Element("form",{method:"get"}).injectInside(document.body)}this.count=history.length;this.states[this.count]=b;this.observeTimeout();this.form.setProperty("action","#"+b).submit()}else{if(Browser.Engine.trident){top.location.replace("#"+(b||""))}else{top.location.hash=b||"#"}}if(Browser.Engine.trident&&(!a||this.istateOld)){if(!this.iframe){this.iframe=new Element("iframe",{src:this.options.iframeSrc,styles:{display:"none"}}).injectInside(document.body);this.istate=this.state;this.iframe.contentWindow.document.location.reload(true)}try{now=new Date();var d=this.iframe.contentWindow.document;d.open();d.write('<html><body id="state">{"state":"'+b+'","time":"'+now.toUTCString()+'"}</body></html>');d.close();this.istateOld=false}catch(c){}}this.state=b},implement:$extend});Array.implement({isSimilar:function(a){return(this.toString()==a.toString())},complement:function(c){for(var b=0,a=this.length;b<a;b++){this[b]=$pick(this[b],c[b]||null)}return this}});var HistoryManager;window.addEvent("domready",function(){});var moopop={width:0,height:0,captureByRel:function(a,b){this.capture((b||document).getElements("a[rel*="+(a||"popup")+"]"))},capture:function(c,b,a){if($defined(b)&&$defined(a)){this.width=b;this.height=a}switch($type(c)){case"string":c=$$(c);case"element":case"array":$splat(c).each(this.add_pop_to,this)}this.width=null;this.height=null},add_pop_to:function(c){c.addEvent("click",function(d){d.stop();this.popup(c)}.bind(this));var b=c.get("rel").match(/\[(\d+),\s*(\d+)/)||["",this.width,this.height];var a=c.get("rel").match(/,(r)/)||[];if(b[1]){c.store("popupprops","width="+b[1]+", height="+b[2]+", scrollbars=yes, resizable=yes")}},popup:function(a){window.open(a.get("href"),a.get("name")||"",a.retrieve("popupprops")||"")}};window.addEvent("domready",function(){moopop.captureByRel("popup")});window.addEvent("domready",function(){$$("#navigation-ul li").each(function(a){a.addEvent("mouseover",function(){$$("#navigation-ul li").each(function(b){b.removeClass("over")});a.addClass("over")})})});window.addEvent("domready",function(){base_url=$(document).getElement("base");if(base_url){base_url=encodeURI(base_url.getProperty("href").toLowerCase())}page_url=document.URL.toLowerCase();hash=page_url.indexOf("#");if(hash>0){page_url=page_url.substring(0,hash)}$$("#navigation-ul li a").each(function(a){link_url=encodeURI(a.getProperty("href"));link_url=(link_url)?link_url.toLowerCase():"";if(base_url){if(link_url.indexOf(base_url)<0){link_url=base_url+link_url}}if(link_url==page_url){_ul=a.getParent().getParent().getProperty("id");if(_ul=="navigation-ul"){a.getParent().addClass("over")}else{a.getParent().getParent().getParent().addClass("over")}a.getParent().addClass("current-page")}})});var tabs;Accordion=new Class({Extends:Accordion,Implements:Options,options:{id:null,useHistory:false},initialize:function(b,c,a){this.setOptions(a);this.id=$pick(this.options.id,"accordion-"+(Accordion.count++));if(this.options.useHistory){this.history=HistoryManager.register(this.id,[0],function(d){this.display(d[0],true)}.bind(this),false,false);values=new Array();for(i=1;i<=b.length-1;i++){values[i-1]=i}this.history.setValues(values)}return this.parent(b,c,a)},display:function(a,b){if(this.history&&(!b)){if(Browser.Engine.trident&&(window.location.hash=="#")){HistoryManager.setState(this.id+"-"+this.options.show.toInt())}HistoryManager.setState(this.id+"-"+a)}this.parent(a)}});window.addEvent("domready",function(){if($$(".subnavigation li").length>0){HistoryManager=new HistoryManagerX();var b=true;var a=Browser.getQueryStringValue("view")?Browser.getQueryStringValue("view").toInt():0;if(a!=0){b=false}tabs=new Accordion($$(".subnavigation li"),$$(".toggle"),{id:"tour-info",show:a,display:a,duration:300,opacity:false,useHistory:true,onActive:function(c){c.addClass("selected");tab_pos=c.getCoordinates()},onBackground:function(c){c.removeClass("selected")}});HistoryManager.start()}});function injectScript(b){var c=window.document.getElementsByTagName("head")[0];var a=window.document.createElement("script");a.setAttribute("src",b);c.appendChild(a)}var XML=function(){this._instanceId=XML.prototype._newInstance(this);this._instance=null;this._newInstance=null};XML.prototype={_instance:new Array(),_newInstance:function(b){var a=XML.prototype._instance.length;XML.prototype._instance[a]=b;return a},_callback:null,doc:null,string:"",onParseSuccess:function(){},parseFromString:function(a){if(a==""){a=this.string}var b;if(window.DOMParser){var c=new DOMParser();b=c.parseFromString(a,"text/xml")}else{if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(a)}}this.doc=b;if(this._callback!=null){this._callback.onParseSuccess(this.doc)}else{this.onParseSuccess(this.doc);this.onParseSuccess=function(){}}return b},loadRemote:function(b,c){var a=(b.indexOf("?")==-1)?"?":"&";b+=a;b+="callback=XML.prototype._instance["+this._instanceId+"].parseFromString";if(c){if(c.onSuccess){this.onParseSuccess=c.onSuccess}if(c.callback){this._callback=c.callback}}injectScript(b)}};setCurrency=function(a){switch(a){case"USD":currencyPrefix="US$";break;case"GBP":currencyPrefix="GBP£";break;case"EUR":currencyPrefix="euro";break;case"AUD":currencyPrefix="AU$";break;case"ALL":a="GBP";currencyPrefix="GBP£";break}$(document).getElements(".ip_currency").each(function(b){value=b.getProperty(a.toLowerCase());b.set("html",currencyPrefix+value)})};window.addEvent("load",function(){injectScript("https://www.trekam.net/trek/API/IP_Currency.asp?brand="+this.brand+"&callback=setCurrency")});var ip_country_match=false;var ip_country=null;setCountry=function(c){country_override=Browser.getQueryStringValue("country");if(country_override>""){c=country_override}ip_country=c;$$(".ip_controlled").each(function(e){ip_country_match=false;e.getElements("span").each(function(e){value=e.getProperty("countries");if(value=="OTHER"){if(ip_country_match){e.destroy()}}else{value=eval('["'+value.replace(",",'","')+'"]');if(value.indexOf(c)==-1){e.destroy()}else{ip_country_match=true}}})})};window.addEvent("load",function(){injectScript("https://www.trekam.net/trek/API/ip_country.asp?callback=setCountry")});