/*
	Copyright (c) 2006-2012 ALPSTEIN Tourismus GmbH & Co. KG. All rights reserved.

	Find out more at http://www.alpstein-tourismus.com/

	Portions of this software are based on works provided by the 
	Dojo Foundation and are Copyright (c) 2004-2009, The Dojo Foundation.
*/

typeof dojo==="undefined"||dojo.provide("oa_v2.pages.layout.root_dojo");if(typeof dojo==="undefined"||!dojo._hasResource["alp.browser_desperate"]){typeof dojo==="undefined"||(dojo._hasResource["alp.browser_desperate"]=true);if(typeof dojo!=="undefined"){dojo.provide("alp.browser_desperate");}else{if(typeof alp==="undefined"){alp={};}if(typeof alp.browser_desperate==="undefined"){alp.browser_desperate={};}}(function(){alp.likeIE=_1;alp.likeIE_onactivate=_2;alp.likeIE8minus_backslash_v=_3;alp.likeIE9plus=_4;var _5;function _1(){return _5!=null?_5:(_5=_3()||_2());};var _6;function _3(){return _6!=null?_6:(_6=!+"\v1");};var _7;function _2(){return _7!=null?_7:(_7="onactivate" in document.createElement("div"));};var _8;function _4(){return _8!=null?_8:(_8=_2()&&!_3());};})();}if(typeof dojo==="undefined"||!dojo._hasResource["alp.dom"]){typeof dojo==="undefined"||(dojo._hasResource["alp.dom"]=true);if(typeof dojo!=="undefined"){dojo.provide("alp.dom");}else{if(typeof alp==="undefined"){alp={};}if(typeof alp.dom==="undefined"){alp.dom={};}}(function(){var _9=Array.prototype.slice,_a={};var _b=/\bie9nofix\b/.test(document.location.search);var _c={DOMContentLoaded:"onload"},_d,_e=[],_f=_10(document,"DOMContentLoaded",function(){_d=true;_11();_12(_f);});alp.aC=_13;alp.aEL=_10;alp.autoRedrawIE9plus=_14;alp.body=_15;alp.cE=_16;alp.cookie=_17;alp.cookie.isSupported=_18;alp.cTxN=_19;alp.domWalkSelect=_1a;alp.gA=_1b;alp.gBodyNode=_1c;alp.gEBI=_1d;alp.gEBCN=_1e;alp.gEBTN=_1f;alp.gWindowScroll=_20;alp.hA=_21;alp.hasClass=_22;alp.head=_23;alp.newId=_24;alp.onDCL=_25;alp.orphan=_26;alp.place=_27;alp.rEL=_12;alp.redrawIE9=_28;alp.rA=_29;alp.sA=_2a;alp.setProp=_2b;alp.setClass=_2c;function _13(_2d,_2e){_2d.appendChild(_2e);};function _10(_2f,_30,_31,_32){var arr=_2f instanceof Array?_2f:[_2f];for(var a=arr.length;a--;){var _33=arr[a];if(_33.addEventListener){_33.addEventListener(_30,_31,_32);}else{if(_33.attachEvent){var _34=_c[_30]||("on"+_30);(_30==="DOMContentLoaded"?window:_33).attachEvent(_34,_31);}else{console.error("alp_aEL failed.",a,arguments);}}}var ret=_9.call(arguments);ret.alp_aEL=true;return ret;};var _35;function _15(){return _35||(_35=document.body||_1f("body")[0]||_1a(document,function(_36){return _36!==document&&/body/i.test(_36.tagName);},true));};function _16(_37,_38,_39,_3a){if(_39&&alp.likeIE8minus_backslash_v()){if(!/^[^\<\>]+$/.test(_37)){console.error("alp.cE(): the IE8- workaround needs a simple tag name. Workaround skipped.");}else{_37="<"+_37;for(var k in _39){if(!(k in _a)){_37+=" "+k+"=\""+_39[k].replace(/"/g,"\\\"")+"\"";}}_39=null;_37+=">";}}var ret=document.createElement(_37);if(_39){_2a(ret,_39);}if(_3a){_2b(ret,_3a);}if(_38){_13(_38,ret);}return ret;};function _17(_3b,_3c,_3d){var doc=document;if(_3c==null){var c=doc.cookie,m=c.match(new RegExp("(?:^|; )"+_3b.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return (m||[])[1];}_3d||(_3d={});var exp=_3d.expires;if(typeof exp==="number"){var d=new Date();d.setTime(d.getTime()+exp*24*60*60*1000);exp=_3d.expires=d;}if(exp&&exp.toUTCString){_3d.expires=exp.toUTCString();}_3c=encodeURIComponent(_3c);var _3e=_3b+"="+_3c,_3f,_40={};for(_3f in _3d){if(!(_3f in _40)){_3e+="; "+_3f;var _41=_3d[_3f];if(_41!==true){_3e+="="+_41;}}}document.cookie=_3e;};function _18(){if(!("cookieEnabled" in navigator)){this("__alpCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__alpCookieTest__")=="CookiesAllowed";if(navigator.cookieEnabled){this("__alpCookieTest__","",{expires:-1});}}return navigator.cookieEnabled;};function _19(_42,_43){var ret=document.createTextNode(_42);if(_43){_13(_43,ret);}return ret;};function _12(_44){var arg=arguments.length>1?arguments:_44;var _45=arg[0],_46=_45 instanceof Array?_45:[_45],_47=arg[1],_48=arg[2],_49=arg[3];for(var a=_46.length;a--;){var _4a=_46[a];if(_4a.removeEventListener){_4a.removeEventListener(_47,_48,_49);}else{if(_4a.detachEvent){var _4b=_c[_47]||("on"+_47);(_47==="DOMContentLoaded"?window:_4a).detachEvent(_4b,_48);}else{console.error("alp_rEL failed.",a,arguments);}}}};function _14(){if(!alp.likeIE9plus()||_14.isActive){return;}_14.isActive=true;var d=document,w=window,_4c=/(html|body|select|option|input|textarea)/i;_10(d,"activate",_4d);_10(d,"deactivate",_4d);_10(d,"click",_4d);_10(d,"mouseover",_4d);_10(d,"mouseout",_4d);_10(d,"mousemove",_4d);_10(d,"mouseenter",_4d);_10(d,"mouseleave",_4d);function _4d(e){e=e||w.event;var t=e&&(e.target||e.srcElement);if(t&&!_4c.test(t.tagName)&&!_4e(t,"iframe")){alp.redrawIE9(t);}return e;};function _4e(t,_4f){var rx=new RegExp(_4f,"i");while(t){if(rx.test(t.tagName)){return true;}t=t.parentNode;}return false;};};function _1a(_50,_51,_52){var ret=[],_53=_50,_54;while(true){var up=_54&&_54.parentNode===_53;if(!up&&_51(_53)){if(_52){return _53;}else{ret.push(_53);}}var _55=((!up&&_53.firstChild)||_53.nextSibling||_53.parentNode);if(!_55||_55===_50){break;}_54=_53;_53=_55;}if(_52){return;}return ret;};function _1b(_56,_57){return _56.getAttribute(_57);};var _58;function _1c(){if(_58){return _58;}var dgb=document.getElementsByTagName("body");return (_58=(dgb&&dgb[0])||document.body||_1a(document.documentElement||document,function(_59){return _59.tagName==="body";},true));};var _5a="getElementById";function _1d(id){if(document[_5a]){return document[_5a](id);}else{return _1a(_1c(),function(_5b){return _5b&&_5b.id===id;},true);}};var _5c="getElementsByClassName";function _1e(_5d,_5e){_5e||(_5e=document);if(typeof _5d==="string"){if(_5e[_5c]){return _9.call(_5e[_5c](_5d));}var rx=new RegExp("\\b"+_5d+"\\b");return _1a(_5e,function(_5f){return _5f!==_5e&&_5f.className&&rx.test(_5f.className);});}var ret=[];for(var n=_5d.length,a=0;a<n;a++){var _60=_5d[a];if(_5e[_5c]){ret=ret.concat(_9.call(_5e[_5c](_60)));}else{var rx=new RegExp("\\b"+_60+"\\b");ret=ret.concat(_1a(_5e,function(_61){return _61!==_5e&&_61.className&&rx.test(_61.className);}));}}return ret;};function _1f(_62){return document.getElementsByTagName(_62);};function _20(){var w=window;if("number"===typeof w.pageXOffset&&"number"===typeof w.pageYOffset){return {left:w.pageXOffset,top:w.pageYOffset};}var t=document.documentElement||document.body.parentNode;if(t){var ret={left:("number"===typeof t.scrollLeft)?t.scrollLeft:document.body.scrollLeft,top:("number"===typeof t.scrollTop)?t.scrollTop:document.body.scrollTop};if("number"===typeof ret.left&&"number"===typeof ret.top){return ret;}}return {left:w.scrollX,top:w.scrollY};};function _21(_63,_64){if(_63.hasAttribute){return _63.hasAttribute(_64);}else{return null!=_63.getAttribute(_64);}};function _22(_65,_66){var rx=new RegExp("\\b"+_66+"\\b");return rx.test(_65.className);};var _67;function _23(){return _67||(_67=document.head||_1f("head")[0]||_1a(document,function(_68){return _68!==document&&/head/i.test(_68.tagName);},true));};function _24(_69){_69||(_69="alp");var _6a=null;while(true){var _6b=_69+(_6a==null?"":_6a);if(!alp.gEBI(_6b)){return _6b;}if(_6a==null){_6a=0;}else{_6a++;}}};function _25(_6c){_e.push(_6c);_11();};function _26(_6d){var arr="parentNode" in _6d?[_6d]:_6d;for(var a=arr.length;a--;){var _6e=arr[a],p=_6e.parentNode;if(p){p.removeChild(_6e);}}};var _6f=0,_70=1,_71=2,_72=3,_73={first:_6f,last:_70,before:_71,after:_72};function _27(_74,ref,_75){_75||(_75="first");var arr="parentNode" in _74?[_74]:_74,pos=_73[_75.toLowerCase()];for(var n=arr.length,a=0;a<n;a++){var _76=arr[a];if(pos===_70||(pos===_6f&&!ref.firstChild)){ref.appendChild(_76);}else{if(pos===_6f){ref.insertBefore(_76,ref.firstChild);}else{if(pos===_71){ref.parentNode.insertBefore(_76,ref);}else{if(pos===_72){if(ref.nextSibling){ref.parentNode.insertBefore(_76,ref.nextSibling);}else{ref.parentNode.appendChild(_76);}}else{throw new Error("alp.place(): unknown position string \""+_75+"\". Please use \"first\", \"last\", \"before\" or \"after\".");}}}}}};function _28(_77){if(_b||!alp.likeIE9plus()){return;}if(!_77||_77===window||!("tagName" in _77&&"style" in _77)){return;}if(alp.util&&alp.util.asyncHitch){alp.util.asyncHitch(_78,null,37)();}else{setTimeout(_78,37);}function _78(){var _79=_77.style.visibility;_77.style.visibility="hidden";_77.offsetWidth;_77.offsetHeight;_77.style.visibility=_79;_77.offsetWidth;_77.offsetHeight;};};function _29(_7a,_7b){_7a.removeAttribute(_7b);};function _2a(_7c,_7d,_7e){if(arguments.length>2){_7c.setAttribute(_7d,""+_7e);}else{for(var k in _7d){if(!(k in _a)){_7c.setAttribute(k,""+_7d[k]);}}}};function _2b(_7f,_80,_81){if(arguments.length>2){_7f[_80]=_81;}else{for(var k in _80){if(!(k in _a)){_7f[k]=_80[k];}}}};function _2c(_82,_83,_84){var obj;if(arguments.length>2){obj={};obj[_83]=_84;}else{obj=_83;}var s=_82.className,_85=s;for(var k in obj){if(!(k in _a)){var rx=new RegExp("\\b"+k+"\\b","g");if(obj[k]){if(!rx.test(_85)){_85+=" "+k;}}else{_85=_85.replace(rx,"");}}}_85=_85.replace(/(^\s+|\s+$)/g,"");if(_85!=s){_82.className=_85;}};function _11(){if(_d){while(_e.length){try{_e.shift()();}finally{_11();}}}};})();}if(typeof dojo==="undefined"||!dojo._hasResource["alp.data.areas"]){typeof dojo==="undefined"||(dojo._hasResource["alp.data.areas"]=true);dojo.provide("alp.data.areas");dojo.declare("alp.data.Areas",null,{HIDDEN_NAME:"<hidden>",constructor:function(_86){var _87=dojo.hitch(this,function(_88){dojo.mixin(this,_88);this._TI_LEVEL=this.TREE_INDEX_LEVEL;this._TI_NAME=this.TREE_INDEX_NAME;this._TI_ID=this.TREE_INDEX_ID;this._TI_PARENTS=this.TREE_INDEX_PARENTS;this._TI_BBOX=this.TREE_INDEX_BBOX;this._TI_NICEID=this.TREE_INDEX_NICEID;this._TI_ACTIV=this.TREE_INDEX_ACTIV;this._init_dfrd.callback(this);});this._init_dfrd=new alp.util.SafeDeferred();if(typeof _86==="object"){_87(_86);}else{var _89={url:_86,handleAs:"json",load:function(r,_8a){_87(r);},error:function(r,_8b){console.error("alp.data.Areas failed to load the JSON configuration from url \""+_89.url+"\"");}};dojo.xhrGet(_89);}},init_dfrd:function(){return this._init_dfrd;},isInitialized:function(){return (this._init_dfrd===0);},inherits_from:function(_8c,_8d){var ret=new alp.util.SafeDeferred();this._init_dfrd.addCallback(this,function(){ret.callback(this._inherits_from(_8c,_8d));});return ret;},_inherits_from:function(_8e,_8f){var _90=(typeof _8f!=="number");return ((_90?(dojo.indexOf(_8f,_8e)>-1):_8e===_8f)||dojun.some(dojo.map(this.tree[_8e][this._TI_PARENTS],function(x){return this._inherits_from(x,_8f);},this),"!!"));},info:function(_91){var a=this.tree[_91];if(!a){return;}return {level:a[this._TI_LEVEL],name:a[this._TI_NAME],id:a[this._TI_ID],niceid:a[this._TI_NICEID],parents:a[this._TI_PARENTS],bbox:a[this._TI_BBOX],activ:a[this._TI_ACTIV]};},indexBy:function(_92,_93){var ret=new alp.util.SafeDeferred();this._init_dfrd.addCallback(this,function(){var v=this._indexBy(_92,_93);if(v===undefined){ret.cancel();return;}ret.callback(v);});return ret;},_indexBy:function(t,_94){var me=this,_95=(typeof _94==="string"),_96=me.declaredClass+"._indexBy(t:\""+t+"\", value:\""+_94+"\")",a=me.tree,_97=me._TI_LEVEL,_98=me._TI_NAME,_99=me.HIDDEN_NAME,_9a=(typeof t==="string")?[t]:t;var ok=true;dojo.forEach(_9a,function(_9b){if(0>dojo.indexOf(["name","id","niceid"],_9b)){console.error(_96+": invalid type \""+_9b+"\".");ok=false;}});if(ok){var _9c=dojo.map(_9a,function(_9d){return me["_TI_"+_9d.toUpperCase()];});ok=alp.util.and(_9c);}if(!ok){return;}if(!(_95||(typeof (_94&&_94.length)==="number"))){console.error(_96+": value must be a string or array of strings, you gave me a \""+(typeof _94)+"\":",_94);return;}if(!a){return;}var _9e=_95?[_94]:_94,_9f=new Array(_9e.length),n=0,k;for(var _a0=a.length;_a0--;){var one=a[_a0];if(one[_98]===_99){continue;}for(var bb=0,_a1=_9c.length;bb<_a1;bb++){k=dojo.indexOf(_9e,one[_9c[bb]]);if(k>-1){break;}}if(k<0){continue;}if(_9f[k]!=null){if(a[_9f[k]][_97]>one[_97]){_9f[k]=_a0;}continue;}_9f[k]=_a0;n++;}if(n<_9e.length){console.error(_96+": not enough areas found, expected:",_9e.length,", found:",n);}return _95?_9f[0]:_9f;},infoBy:function(_a2,_a3){var ret=new alp.util.SafeDeferred(),_a4=this.declaredClass+".infoBy(type:\""+_a2+"\", value:\""+_a3+"\")";if(typeof _a3!=="string"){console.error(_a4+" requires a string as type!");ret.cancel();return ret;}var a=this.indexBy.apply(this,arguments);a.addCallback(this,function(_a5){ret.callback(this.info(_a5));});a.addErrback(ret,"cancel");return ret;},walk:function(_a6,_a7,_a8){var _a9=this.tree[_a6];if(!_a9){return;}var _aa=false;if(!_a8){_aa=_aa||_a7(_a9,_a6,this);}var _ab=(!_aa)&&this.children[_a6];if(_ab){for(var a=0,_ac=_ab.length;a<_ac;a++){_aa=_aa||this.walk(_ab[a],_a7);}}return _aa;}});}if(typeof dojo==="undefined"||!dojo._hasResource["alp.data.state"]){typeof dojo==="undefined"||(dojo._hasResource["alp.data.state"]=true);dojo.provide("alp.data.state");(function(){var _ad=alp.util.encQueryToObject().asynctrace;dojo.declare("alp.data.State",alp.util.Updater,{is_same:dojun.lambda("==="),init_value:undefined,init_silent:true,init_inactive:false,constrain_def:dojun.lambda("x"),constrain_undef:dojun.lambda("x"),_current:undefined,constructor:function(_ae){dojo.mixin(this,_ae);if(this.constrain_all){this.constrain_def=this.constrain_undef=this.constrain_all;}if(this.init_inactive){this.setUpdateActive(this.declaredClass,false);}this.set(this.init_value,this.init_silent);},bind_to:function(_af,_b0){var me=this,_b1=_b0&&_b0.do_not_copy,_b2=_b0&&_b0.loose,_b3=_b0&&_b0.delay_ms;if(!_b1){_af.set(me.get());}if(!(_b2||(_af instanceof eval(me.declaredClass)))){throw new Error(me.declaredClass+".bind_to(): incompatible other class \""+_af.declaredClass+"\"");}return (null==_b3)?me.entered_cb(me,_b4):dojo.connectLimited(-Math.abs(_b3),me,"entered",_b4);function _b4(){_af.set(me.get());};},unbind:function(_b5){dojo.disconnect(_b5);},constrain:function(){this.set(this.get());},is:function(_b6){return this.is_same(this._current,_b6);},left_cb:function(){return dojo.connect(this,"left",dojo.hitch.apply(dojo,arguments));},left_v_cb:function(_b7){var _b8=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"left",this,function(_b9,_ba){if(this.is_same(_b7,_b9)){_b8.call(null,_ba);}});},entered_cb:function(){return dojo.connect(this,"entered",dojo.hitch.apply(dojo,arguments));},entered_cb_init:function(){var cb=dojo.hitch.apply(dojo,arguments);cb(this.get());return dojo.connect(this,"entered",cb);},entered_v_cb:function(_bb){var _bc=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"entered",this,function(_bd,_be){if(this.is_same(_bb,_bd)){_bc.call(null,_be);}});},changed_cb:function(){return dojo.connect(this,"changed",dojo.hitch.apply(dojo,arguments));},changed_cb_init:function(){var cb=dojo.hitch.apply(dojo,arguments);cb(this.get());return dojo.connect(this,"changed",cb);},changed_v_cb:function(_bf){var _c0=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"changed",this,function(_c1){if(this.is_same(_bf,_c1)){_c0.call();}});},changed_cb_once:function(){var cb=dojo.hitch.apply(dojo,arguments),h=this.changed_cb(function(){dojo.disconnect(h);cb.apply(null,arguments);});},updateImpl:function(_c2,_c3){this.tell_it(_c2,_c3);},tell_it:function(_c4,_c5){var _c6=this._last_emitted,c=this._emitted_once&&this.is_same(_c6,this._current);alp.util.console(1,"log",this.declaredClass+".tell_it(",_c4,"): this.is_same( this._last_emitted, this._current ): ",c,this._emitted_once,this._last_emitted,this._current);if(!c&&!_c4){this._last_emitted=this._current;this._emitted_once=true;this._left(_c6,this._current,_c5);this._entered(this._current,_c6,_c5);}},get:function(){return this._current;},has_selection:function(){return this._current!==undefined;},unset:function(){return this.set();},set:function(_c7,_c8){_c7=this[(_c7===undefined)?"constrain_undef":"constrain_def"](_c7,this._current);if(this.is_same(_c7,this._current)){return false;}this._current=_c7;this.update("me.set( "+_c7+", "+_c8+" )",_c8,_ad&&alp.util.callstack(this.set));return true;},left:function(_c9,_ca,_cb){alp.util.console(1,"log",this.declaredClass+".left( previous_value, value ): previous_value:",_c9,", value:",_ca);},entered:function(_cc,_cd,_ce){this.changed(_cc,_ce);alp.util.console(1,"log",this.declaredClass+".entered( value, previous_value ): value:",_cc,", previous_value:",_cd);},changed:function(_cf,_d0){},_left:alp.util.asyncHitch("left"),_entered:alp.util.asyncHitch("entered")});})();}if(typeof dojo==="undefined"||!dojo._hasResource["alp.data.boolstate"]){typeof dojo==="undefined"||(dojo._hasResource["alp.data.boolstate"]=true);dojo.provide("alp.data.boolstate");dojo.declare("alp.data.BoolState",alp.data.State,{constrain_undef:dojun.lambda("!!"),constrain_def:dojun.lambda("!!"),init_value:false,toggle:function(){return this.set(!this.get());}});}if(typeof dojo==="undefined"||!dojo._hasResource["alp.util.rx"]){typeof dojo==="undefined"||(dojo._hasResource["alp.util.rx"]=true);dojo.provide("alp.util.rx");(function(){alp.util.rx.scan_rx=function scan_rx(s,rx){var _d1=rx.source;var _d2="";if(rx.global){_d2+="g";}if(rx.ignoreCase){_d2+="i";}if(rx.multiline){_d2+="m";}return alp.util.rx.scan(s,_d1,_d2);};alp.util.rx.scan=function scan(s,_d3,_d4){var a,da,arr,_d5,rx;arr=[];(function(){var tmp=s;a=0;while(true){rx=new RegExp(_d3,_d4);_d5=rx.exec(tmp);if(!_d5){break;}var _d6=_d5.index+_d5[0].length;arr.push([a+_d6,_d5]);da=Math.max(1,_d6);a+=da;tmp=tmp.substr(da);}})();return arr;};alp.util.rx.map_groups=function map_groups(s,_d7,fun){return alp.util.rx.map(s,_d7,function(_d8,_d9){var _da=_d8;for(var a=0;a<_d9.length;a++){if(!_d9[a]){continue;}_da=fun(_da,_d9[a]);}return _da;});};alp.util.rx.map=function map(s,_db,fun){var _dc,_dd,_de,_df,_e0,_e1,s2,str;if(_db instanceof RegExp){_db=alp.util.rx.scan_rx(s,_db);}s2=s;for(var ind=_db.length-1;ind>=0;ind--){_dc=_db[ind];_df=_dc[0];_e1=_dc[1];str=_e1[0];_e0=_e1.slice(1);_de=_df-str.length;_dd=fun(str,_e0);s2=s2.substring(0,_de)+_dd+s2.substring(_df);}return s2;};})();}if(typeof dojo==="undefined"||!dojo._hasResource["dojox.html._base"]){typeof dojo==="undefined"||(dojo._hasResource["dojox.html._base"]=true);dojo.provide("dojox.html._base");(function(){if(dojo.isIE){var _e2=/(AlphaImageLoader\([^)]*?src=(['"]))(?![a-z]+:|\/)([^\r\n;}]+?)(\2[^)]*\)\s*[;}]?)/g;}var _e3=/(?:(?:@import\s*(['"])(?![a-z]+:|\/)([^\r\n;{]+?)\1)|url\(\s*(['"]?)(?![a-z]+:|\/)([^\r\n;]+?)\3\s*\))([a-z, \s]*[;}]?)/g;var _e4=dojox.html._adjustCssPaths=function(_e5,_e6){if(!_e6||!_e5){return;}if(_e2){_e6=_e6.replace(_e2,function(_e7,pre,_e8,url,_e9){return pre+(new dojo._Url(_e5,"./"+url).toString())+_e9;});}return _e6.replace(_e3,function(_ea,_eb,_ec,_ed,_ee,_ef){if(_ec){return "@import \""+(new dojo._Url(_e5,"./"+_ec).toString())+"\""+_ef;}else{return "url("+(new dojo._Url(_e5,"./"+_ee).toString())+")"+_ef;}});};var _f0=/(<[a-z][a-z0-9]*\s[^>]*)(?:(href|src)=(['"]?)([^>]*?)\3|style=(['"]?)([^>]*?)\5)([^>]*>)/gi;var _f1=dojox.html._adjustHtmlPaths=function(_f2,_f3){var url=_f2||"./";return _f3.replace(_f0,function(tag,_f4,_f5,_f6,_f7,_f8,_f9,end){return _f4+(_f5?(_f5+"="+_f6+(new dojo._Url(url,_f7).toString())+_f6):("style="+_f8+_e4(url,_f9)+_f8))+end;});};var _fa=dojox.html._snarfStyles=function(_fb,_fc,_fd){_fd.attributes=[];return _fc.replace(/(?:<style([^>]*)>([\s\S]*?)<\/style>|<link\s+(?=[^>]*rel=['"]?stylesheet)([^>]*?href=(['"])([^>]*?)\4[^>\/]*)\/?>)/gi,function(_fe,_ff,_100,_101,_102,href){var i,attr=(_ff||_101||"").replace(/^\s*([\s\S]*?)\s*$/i,"$1");if(_100){i=_fd.push(_fb?_e4(_fb,_100):_100);}else{i=_fd.push("@import \""+href+"\";");attr=attr.replace(/\s*(?:rel|href)=(['"])?[^\s]*\1\s*/gi,"");}if(attr){attr=attr.split(/\s+/);var _103={},tmp;for(var j=0,e=attr.length;j<e;j++){tmp=attr[j].split("=");_103[tmp[0]]=tmp[1].replace(/^\s*['"]?([\s\S]*?)['"]?\s*$/,"$1");}_fd.attributes[i-1]=_103;}return "";});};var _104=dojox.html._snarfScripts=function(cont,_105){_105.code="";cont=cont.replace(/<[!][-][-](.|\s){5,}?[-][-]>/g,function(_106){return _106.replace(/<(\/?)script\b/ig,"&lt;$1Script");});function _107(src){if(_105.downloadRemote){src=src.replace(/&([a-z0-9#]+);/g,function(m,name){switch(name){case "amp":return "&";case "gt":return ">";case "lt":return "<";default:return name.charAt(0)=="#"?String.fromCharCode(name.substring(1)):"&"+name+";";}});dojo.xhrGet({url:src,sync:true,load:function(code){_105.code+=code+";";},error:_105.errBack});}};return cont.replace(/<script\s*(?![^>]*type=['"]?(?:dojo\/|text\/html\b))(?:[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?)*>([\s\S]*?)<\/script>/gi,function(_108,_109,src,code){if(src){_107(src);}else{_105.code+=code;}return "";});};var _10a=dojox.html.evalInGlobal=function(code,_10b){_10b=_10b||dojo.doc.body;var n=_10b.ownerDocument.createElement("script");n.type="text/javascript";_10b.appendChild(n);n.text=code;};dojo.declare("dojox.html._ContentSetter",[dojo.html._ContentSetter],{adjustPaths:false,referencePath:".",renderStyles:false,executeScripts:false,scriptHasHooks:false,scriptHookReplacement:null,_renderStyles:function(_10c){this._styleNodes=[];var st,att,_10d,doc=this.node.ownerDocument;var head=doc.getElementsByTagName("head")[0];for(var i=0,e=_10c.length;i<e;i++){_10d=_10c[i];att=_10c.attributes[i];st=doc.createElement("style");st.setAttribute("type","text/css");var _10e={};for(var x in att){if(x in _10e){continue;}st.setAttribute(x,att[x]);}this._styleNodes.push(st);head.appendChild(st);if(st.styleSheet){st.styleSheet.cssText=_10d;}else{st.appendChild(doc.createTextNode(_10d));}}},empty:function(){this.inherited("empty",arguments);this._styles=[];},onBegin:function(){this.inherited("onBegin",arguments);var cont=this.content,node=this.node;var _10f=this._styles;if(dojo.isString(cont)){if(this.adjustPaths&&this.referencePath){cont=_f1(this.referencePath,cont);}if(this.renderStyles||this.cleanContent){cont=_fa(this.referencePath,cont,_10f);}if(this.executeScripts){var _110=this;var _111={downloadRemote:true,errBack:function(e){_110._onError.call(_110,"Exec","Error downloading remote script in \""+_110.id+"\"",e);}};cont=_104(cont,_111);this._code=_111.code;}}this.content=cont;},onEnd:function(){var code=this._code,_112=this._styles;if(this._styleNodes&&this._styleNodes.length){while(this._styleNodes.length){dojo.destroy(this._styleNodes.pop());}}if(this.renderStyles&&_112&&_112.length){this._renderStyles(_112);}if(this.executeScripts&&code){if(this.cleanContent){code=code.replace(/(<!--|(?:\/\/)?-->|<!\[CDATA\[|\]\]>)/g,"");}if(this.scriptHasHooks){code=code.replace(/_container_(?!\s*=[^=])/g,this.scriptHookReplacement);}try{_10a(code,this.node);}catch(e){this._onError("Exec","Error eval script in "+this.id+", "+e.message,e);}}this.inherited("onEnd",arguments);},tearDown:function(){this.inherited(arguments);delete this._styles;if(this._styleNodes&&this._styleNodes.length){while(this._styleNodes.length){dojo.destroy(this._styleNodes.pop());}}delete this._styleNodes;dojo.mixin(this,dojo.getObject(this.declaredClass).prototype);}});dojox.html.set=function(node,cont,_113){if(!_113){return dojo.html._setNodeContent(node,cont,true);}else{var op=new dojox.html._ContentSetter(dojo.mixin(_113,{content:cont,node:node}));return op.set();}};})();}if(typeof dojo==="undefined"||!dojo._hasResource["dojox.html"]){typeof dojo==="undefined"||(dojo._hasResource["dojox.html"]=true);dojo.provide("dojox.html");}if(typeof dojo==="undefined"||!dojo._hasResource["alp.util.html"]){typeof dojo==="undefined"||(dojo._hasResource["alp.util.html"]=true);dojo.provide("alp.util.html");alp.util.createTextNode=function(_114,_115,_116){if(typeof _114==="string"){var ret=document.createTextNode(_114);if(_115){dojo.place(ret,_115,_116);}return ret;}if(typeof _114==="object"){return alp.util.createTextNode(function(){return dojo.getObject.apply(dojo,_114);},_115,_116);}var ret=document.createTextNode("");alp.util.setTextDataAsync(ret,_114);if(_115){dojo.place(ret,_115,_116);}return ret;};alp.util.empty=function(node){if(!node){return;}var c;while(c=node.lastChild){node.removeChild(c);}return node;};alp.util.html_tmpl=function(_117,data,rx){var t,_118=typeof _117;if(_118==="function"){return _117(data);}else{if(_118==="string"){t=_117;}else{if(_118==="object"){t=_117.innerHTML;}else{console.error("alp.util.htmltmpl(): invalid typeof template: "+_118);}}}rx=rx||/__(.*?)__/;return alp.util.rx.map_groups(t,rx,function(_119,_11a){if(!_11a){return _119;}var f=new Function("data",dojo.global.unescape("return "+_11a+";"));try{return f(data);}catch(e){console.warn("alp.util.html_tmpl() caught e when replacing \""+_119+"\" with \""+_11a+"\"");console.warn("alp.util.html_tmpl() exception e:",e);return "";}});};alp.util.new_id=function(opts){opts||(opts={prefix:""});while(true){var id=opts.prefix+""+Math.round(Math.random()*10000000000)+"_"+(new Date()>>0);if(!dojo.byId(id)){return id;}}};alp.util.node_show=function(node){var ns=node.style,_11b=(ns.display==="none"),_11c=(ns.visibility==="hidden"),_11d=_11b&&_11c;if(!_11d){if(window.getComputedStyle){var s=window.getComputedStyle(node,"");if(s){_11b=_11b||s.display==="none";_11c=_11c||s.visibility==="hidden";}}else{var s=node.currentStyle;if(s){_11b=_11b||s["display"]==="none";_11c=_11c||s["visibility"]==="hidden";}}}if(_11b){ns.display="";}if(_11c){ns.visibility="visible";}};alp.util.setNodeText=function(node,text){if(typeof node==="string"){node=dojo.query(node);}if(text===undefined){text="";}if(alp.util.isNodeList(node)){return node.map(function(node){return alp.util.setNodeText(node,text);});}alp.util.empty(node);node.appendChild(document.createTextNode(""+text));return node;};alp.util.setNodeTextAsync=function(node,_11e,_11f){_11f||(_11f=new alp.util.SafeDeferred());if(typeof _11e!=="function"){alp.util.setNodeText(node,_11e);_11f.done();}else{var text=_11e();if(text!=null){alp.util.setNodeText(node,text);_11f.done();}else{alp.util.asyncHitch("setNodeTextAsync",alp.util,150)(node,_11e,_11f);}}return _11f;};alp.util.setTextDataAsync=function(node,_120){var text=_120();if(text){node.data=text;return;}alp.util.asyncHitch("setTextDataAsync",alp.util,150)(node,_120);};alp.util.try_to_forbid_text_selection=function(x){if(typeof x==="string"){x=dojo.query(x);}if(alp.util.isNodeList(x)){x.forEach(function(node){alp.util.try_to_forbid_text_selection(node);});return x;}var s1="onselectstart",s2="onmousedown";dojo.forEach([s1,s2],function(s){try{x[s]=function(){return false;};}catch(e){}});return x;};}if(typeof dojo==="undefined"||!dojo._hasResource["alp.util.search"]){typeof dojo==="undefined"||(dojo._hasResource["alp.util.search"]=true);dojo.provide("alp.util.search");alp.util.dichotomy=function(_121,min,max,_122,opts){var mm=alp.util.minmax([min,max]),get=_122;if(get(mm[0])>get(mm[1])){throw new Error("alp.util.dichotomy(): get_value_increasing must return increasing values!");}if(_121>get(mm[1])){throw new Error("alp.util.dichotomy(): maximum too low!");}if(_121<get(mm[0])){throw new Error("alp.util.dichotomy(): minimum too high!");}opts=dojo.delegate({niter_max:100,precision:0},opts);var x,y,_123,_124=opts.niter_max,_125=opts.precision;for(_123=0;(Math.abs(mm[1]-mm[0])>_125)&&(_123<_124);_123++){x=alp.util.mean(mm);y=get(x);mm[y<_121?0:1]=x;}return alp.util.mean(mm);};(function(){alp.util.add_sortedsearch=function(arr,opt){if(arr.sortedsearch){console.error("alp.util.add_sortedsearch: array already has `sortedsearch` method... Overwriting it. array:",arr);}var o=_126(arr,opt),_127=new alp.util.SortedDataSearcher(o.length,o.compare_fun,o.equals_fun,o.other_opts);arr.sortedsearch=_128;function _128(){return _127.search.apply(_127,arguments);};};alp.util.sortedsearch=function(x,arr,opt){var o=_126(arr,opt),_129=new alp.util.SortedDataSearcher(o.length,o.compare_fun,o.equals_fun,o.other_opts);return _129.search(x);};function _126(arr,opt){opt=opt?dojo.mixin({data_compare_fun:function(a,b){if(a==b){return 0;}if(a<b){return -1;}if(a>b){return +1;}return 0;},data_equals_fun:null},opt):{data_compare_fun:function(a,b){if(a==b){return 0;}if(a<b){return -1;}if(a>b){return +1;}return 0;},data_equals_fun:null};return {length:function(){return arr.length;},compare_fun:function(ind,data){return opt.data_compare_fun(arr[ind],data);},equals_fun:opt.arr_equals_fun&&function(ind,data){return opt.data_equals_fun(arr[ind],data);},other_opts:{read_only_optim:opt.read_only_optim,data_compare_fun:opt.data_compare_fun}};};})();dojo.declare("alp.util.SortedDataSearcher",null,{constructor:function(_12a,_12b,_12c,opt){var me=this;me.length=_12a;me.compare_fun=_12b;me.equals_fun=_12c||function(ind,data){return (0===me.compare_fun(ind,data));};me.read_only_optim_fun=alp.at(opt,"read_only_optim")&&alp.at(opt,"data_compare_fun");},_length:function(){return (typeof this.length==="function")?this.length():this.length;},search:function(data,_12d,last,_12e){if(this.read_only_optim_fun){_12e=_12e||(_12d==null&&last==null);var _12f=this._prev_result;if(_12f&&(_12d==null||last==null)){var _130=this.read_only_optim_fun(data,_12f.data);if(last==null&&_130<0){last=_12f.first-1;}if(_12d==null&&_130>0){_12d=_12f.last+1;}}}if(_12d==null){_12d=0;}if(last==null){last=this._length()-1;}if(last<_12d){return;}if(data===undefined){return {first:_12d,last:last};}if(this.compare_fun(_12d,data)>0){return;}if(this.compare_fun(last,data)<0){return;}var _131=(last>-1)&&this.equals_fun(_12d,data),_132=(last>-1)&&this.equals_fun(last,data),_133=last-_12d,_134=last-_12d,_135,_136,_137,_138,_139,_13a,_13b,_13c,_13d;while(!((last<=_12d)||(_131&&_132)||(_13d))){var _13e=last-_12d;if(!_131){_135=Math.max(1,Math.min(_133,_13e)>>1);}if(!_132){_136=Math.max(1,Math.min(_134,_13e)>>1);}_13d=(_133===_135&&_134===_136);_133=_135;_134=_136;if(!_131){_137=Math.max(_12d+1,Math.min(last,_12d+_133));_138=this.compare_fun(_137,data);_139=(_138===0);if((_138<0)||(_137===_12d+1)){_12d=_137;_131=_139;_13d=false;}}if(!_132){_13a=Math.min(last-1,Math.max(_12d,last-_134));_13b=this.compare_fun(_13a,data);_13c=(_13b===0);if((_13b>0)||(_13a===last-1)){last=_13a;_132=_13c;_13d=false;}}}if((last<_12d)||(!_131)||(!_132)){return;}if(_12e){this._prev_result={data:data,first:_12d,last:last};}return {first:_12d,last:last};}});}if(typeof dojo==="undefined"||!dojo._hasResource["alp.x.areaselector"]){typeof dojo==="undefined"||(dojo._hasResource["alp.x.areaselector"]=true);dojo.provide("alp.x.areaselector");alp.installLocalization("alp","x");dojo.declare("alp.x.AreaSelector",null,{HTML_EXAMPLE:"<div id=\"territory-select-box\" class=\"select-box\">"+"<div class=\"select-box-logo\"></div>"+"<div class=\"select-box-close\"></div>"+"<div class=\"clear space\"></div>"+"<div class=\"col left s4\">"+"<div name=\"territorySelectForm\">"+"<fieldset id=\"territory-text\">"+"<input id=\"territory-select-text\" type=\"text\" id=\"search-input\" name=\"s\" value=\"\"/>"+"</fieldset>"+"<fieldset id=\"territory-select\">"+"<select id=\"territory-select-value\" name=\"territorySelectField\" size=\"3\"></select>"+"</fieldset>"+"<fieldset id=\"ok\">"+"<input id=\"submit-button\" type=\"button\" value=\"\"/>"+"</fieldset>"+"</div>"+"</div>"+"<div class=\"col right s4\">"+"<div name=\"territoryGeoSelectForm\">"+"<fieldset id=\"territory-geoselect\" class=\"s6\">"+"<span id=\"span-territory-geoselect-country\"><label for=\"territory-geoselect-country\">Land</label><select class=\"s6\" id=\"territory-geoselect-country\" size=\"1\"><option value=\"germany\">Deutschland</option><option value=\"italy\">Italien</option></select></span>"+"<span id=\"span-territory-geoselect-district\"><label for=\"territory-geoselect-district\">Bundesland</label><select class=\"s6\" id=\"territory-geoselect-district\" size=\"1\"><option value=\"germany\">- Bundesland wählen -</option></select></span>"+"<span id=\"span-territory-geoselect-region\"><label for=\"territory-geoselect-region\">Region</label><select class=\"s6\" id=\"territory-geoselect-region\" size=\"1\"></select></span>"+"</fieldset>"+"<fieldset id=\"ok-geo\">"+"<input id=\"geo-submit-button\" type=\"button\" value=\"\"/>"+"</fieldset>"+"</div>"+"</div>"+"</div>",area_config_url:(function(){var arr=[];arr.push((dojo.global.alpConfig&&alpConfig.base_href)||"");arr.push("regionConfig.json");return arr.join("/");})(),autohide_topsingle:true,id:null,id_select_all:"territory-select-all",id_select_top:"territory-select-top",id_text_input:"territory-select-text",id_text_select:"territory-select-value",id_text_ok_msg:"territory-ok-msg",id_text_ok:"submit-button",id_geo_select:"territory-geoselect",id_text_ok_geo_msg:"territory-ok-geo-msg",id_geo_ok:"geo-submit-button",node_geo_select_level:[{showhide:"span-territory-geoselect-country",select:"territory-geoselect-country",choice_text:function(){return alp.x.i18n.area_choose_country;}},{showhide:"span-territory-geoselect-district",select:"territory-geoselect-district",choice_text:function(){return alp.x.i18n.area_choose_district;}},{showhide:"span-territory-geoselect-region",select:"territory-geoselect-region",choice_text:function(){return alp.x.i18n.area_choose_region;}},{showhide:"span-territory-geoselect-county",select:"territory-geoselect-county",choice_text:function(){return alp.x.i18n.area_choose_county;}},{showhide:"span-territory-geoselect-city",select:"territory-geoselect-city",choice_text:function(){return alp.x.i18n.area_choose_city;}}],minlevel_custom:-Infinity,maxlevel_custom:+Infinity,text_select_max:+Infinity,is_choosable:function(_13f,_140,_141){var ret=true;dojun.forIn(_140,function(v,k){ret=ret&&v[_13f];});return !!ret;},on_select:undefined,minlevel:null,constructor:function(opts){var _142=["id"];if(!dojun.every(_142,function(x){return opts[x];})){console.error(this.declaredClass+".constructor(opts): opts is missing mandatory parameters, please provide: "+_142);return;}var me=this;dojo.mixin(me,opts);me._init_dfrd=new alp.util.SafeDeferred();me.areas=new alp.data.Areas(me.area_config_url);me.areas.init_dfrd().addCallback(function(){me._TI_LEVEL=me.areas.TREE_INDEX_LEVEL;me._TI_NAME=me.areas.TREE_INDEX_NAME;me._TI_ID=me.areas.TREE_INDEX_ID;me._TI_PARENTS=me.areas.TREE_INDEX_PARENTS;me._TI_BBOX=me.areas.TREE_INDEX_BBOX;me._TI_NICEID=me.areas.TREE_INDEX_NICEID;me._TI_ACTIV=me.areas.TREE_INDEX_ACTIV;alp.util.getDfrd(dojo.hitch(me,function(){var ret=(typeof me.id==="string")?dojo.byId(me.id):me.id;return ret||undefined;})).then(function(node){alp.util.getDfrd("alp.x.i18n.areaselector_none").then(function(){me._init(node);});});});},init_dfrd:function(){return this._init_dfrd;},isInitialized:function(){return (this._init_dfrd===0);},init_cb:alp.util.dfrd_cb("init_dfrd"),dom_is_in:function(node){var c=this._container;return c&&alp.util.isDescendant(c,node);},focus_text_input:function(){this.init_cb(this,function(){this._sub.text_input.focus();});},select_top:function(){this._toparea_selected();},area_inherits_from:function(_143,_144){return this.areas.inherits_from.apply(this.areas,arguments);},area_info:function(_145){return this.areas.info.apply(this.areas,arguments);},area_indexBy:function(type,_146){return this.areas.indexBy.apply(this.areas,arguments);},area_infoBy:function(type,_147){return this.areas.infoBy.apply(this.areas,arguments);},selectBy:function(type,_148){var args=arguments;this.init_cb(this,function(){this.area_indexBy.apply(this,args).addCallback(this,"_areaindex_selected");});},selectByName:function(name){this.selectBy("name",""+name);},_init:function(node){var a,_149=this.declaredClass,me=this;if(!node){console.error(_149,"._init(): failed to find the container node \""+me.id+"\". Aborting.");return;}me._container=node;me._sub={};var rx=/^id_(.+)/;dojun.forIn(me,function(_14a,k){var g=rx.exec(k),_14b=g&&(g.length>1)&&g[me._TI_NAME];if(!_14b){return;}dojo.query("[id=\""+_14a+"\"]",me._container).at(0).forEach(function(node){me._sub[_14b]=node;},me);if(!(me._sub[_14b]||(_14b==="select_all")||(_14b==="select_top"))){console.error(_149+": could not find subcontrol \""+_14b+"\" (id: \""+_14a+"\" not found in container with id:\""+me.id+"\").");}},me);a=me._sub.geo_select;if(a){if(me.node_geo_select_level.length>me.areas.levels.length){console.error(_149+"._init(): levels length do not match:",me.node_geo_select_level,me.areas.levels);}}if(me._sub.select_all){dojo.connect(me._sub.select_all,"onclick",me,"_allareas_selected");}if(me.on_select){dojo.connect(me,"allareas_selected",me,"on_select");}if(me._sub.select_top){dojo.connect(me._sub.select_top,"onclick",me,"select_top");}dojo.connect(me,"toparea_selected",me,function(){me._areaindex_selected(me.areas.children.top[0]);});dojo.hitch(me,function(){var t_in=me._sub.text_input,_14c;var _14d,_14e;dojo.connect(t_in,"onkeypress",function(e){alp.util.asyncHitch(function(_14f){_14e(t_in.value);if(e&&(dojo.indexOf([dojo.keys.DOWN_ARROW],e.keyCode)>-1)){me._text_arrow_down();}if(e&&(dojo.indexOf([dojo.keys.UP_ARROW],e.keyCode)>-1)){me._text_arrow_up();}if(e&&(dojo.indexOf([dojo.keys.ENTER],e.keyCode)>-1)){me._text_arrow_enter();}},me)(e.keyCode);});dojo.connect(me,"text_changed",alp.util.asyncHitch(function(){t_in.value=_14d();}));_14d=dojo.hitch(me,function(){return _14c||"";});_14e=dojo.hitch(me,function(v){if(v!==_14c){_14c=""+v;me._text_changed(_14c);}});dojo.connect(me,"refresh",function(){me._text_changed(_14d());});})();dojo.connect(me,"text_changed",me,"text_search");dojo.connect(me,"text_search_result",me,"list_update");dojo.hitch(me,function(){var _150,_151,_152,_153,_154;_150=alp.util.asyncHitch(function(){_152=me._sub.text_select.value;me._sub.text_ok.style.visibility=_152?"":"hidden";_151();},me);_151=alp.util.asyncHitch(function(){if(me._sub.text_select.firstChild){alp.util.setNodeText(me._sub.text_ok_msg,"");}else{alp.util.setNodeText(me._sub.text_ok_msg,alp.x.i18n.areaselector_none);}},me);_153=alp.util.asyncHitch(function(){if(_152){me._areaindex_selected(_152);}},me);_154=dojo.hitch(me,function(ud){var ts=me._sub.text_select;if(ts.firstChild){var si=ts.selectedIndex;if(ud==="down"){ts.selectedIndex=(typeof si==="number")?(si+1):0;}else{ts.selectedIndex=((si>-1)?si:ts.childNodes.length)-1;}_150();}_151();});dojo.connect(me._sub.text_select,"onchange",_150);dojo.connect(me,"list_update",_150);dojo.connect(me._sub.text_ok,"onclick",_153);dojo.connect(me,"text_arrow_down",function(){_154("down");});dojo.connect(me,"text_arrow_up",function(){_154("up");});dojo.connect(me,"text_arrow_enter",_153);_150();})();me._init_dfrd.addCallback(me,function(){var a,arr,f_1,f_2,_155,geo,_156,mm,_157,_158;_155=dojun.filter(dojo.map(me.node_geo_select_level,function(o){return dojo.mixin(dojun.mapIn(o,function(v,k){if(k==="choice_text"){return alp.util.fun_or_not(v);}var ret;dojo.query("[id=\""+v+"\"]",me._sub.geo_select).at(0).forEach(function(node){ret=node;});return ret;},me),{is_subtree_choosable:dojo.hitch(me,"_is_subtree_choosable")});},me),function(x){return alp.util.and(["showhide","select","choice_text","is_subtree_choosable"],function(s){return x[s];});});geo=dojo.map(_155,function(opt){return new alp.x._AreaGeoLevel(me.areas,opt);},me);me._geo=geo;_157=alp.util.asyncHitch(function(){alp.util.conlog(me.declaredClass+": update_geo_ok --- ");var a,b,_159=null;for(a=geo.length-1;a>=0;a--){b=parseInt(geo[a].get_selected_area(),10);if(alp.util.isFiniteNumber(b)){_159=b;break;}}if(_158!==_159){_158=_159;me._sub.geo_ok.style.visibility=((_158!==undefined)&&me._is_area_choosable(_158))?"":"hidden";}},me);dojo.connect(me._sub.geo_ok,"onclick",alp.util.asyncHitch(function(){if(alp.util.isFiniteNumber(_158)){me._areaindex_selected(_158);}},me,0,_158));f_1=dojo.hitch(me,function(a){dojo.connect(geo[a],"selection_changed",me,function(sel){var b,_15a,_15b;_15a=sel&&me.areas.children[sel];if((typeof sel!=="number")||(isNaN(sel))||(!(_15a&&(_15a.length>0)))){geo[a+1].set_contents();return;}_15b=me.areas.tree[_15a[0]][me._TI_LEVEL];for(b=a+1;b<Math.min(geo.length-1,_15b);b++){geo[b].set_contents();}if(_15b<geo.length){window.setTimeout(function(){geo[_15b].set_contents(sel);});}});});f_2=function(a){dojo.connect(geo[a],"selection_changed",_157);};for(a=0;a<geo.length;a++){if(a<geo.length-1){f_1(a);}f_2(a);}dojo.forEach(["minlevel","maxlevel"],function(s){me[s]=Math.min(geo.length-1,Math.max(0,me.areas[s]));},me);_156=dojun.map([me.minlevel,me.maxlevel],dojo.hitch(alp.util,"isFiniteNumber"));if(!alp.util.and(_156)){mm=alp.util.minmax(dojun.map(me.areas.tree,"x->x[0]"));if(!_156[0]){me.minlevel=mm[0];}if(!_156[1]){me.maxlevel=mm[1];}}arr=me.node_geo_select_level;geo[Math.max(0,me.minlevel)].set_contents("top");if(me.autohide_topsingle&&me.areas.children.top.length<2){geo[Math.max(0,me.minlevel)].major_vis.unset();}arr=alp.util.minmax([me.minlevel,me.maxlevel]);me.minlevel=Math.max(me.minlevel_custom,arr[0]);me.maxlevel=Math.min(me.maxlevel_custom,arr[1]);for(var a=0,_15c=geo.length;a<_15c;a++){if(geo[a]){geo[a].major_vis.set(me.minlevel<=a&&a<=me.maxlevel);}}me._eh_geo||(me._eh_geo=dojo.connect(me,"refresh",me,function(){geo[Math.max(0,me.minlevel)].refresh();geo[Math.max(0,me.minlevel)].set_contents("top");}));});if(me.on_select){dojo.connect(me,"area_selected",me,"on_select");}me.refresh();me._init_dfrd.callback(true);},refresh:function(){var _15d={};if(this._instanced){for(var k in this._instanced){if(!(k in _15d)){var v=this._instanced[k];if(v){v._cache=null;}}}}},text_search:function(v){var o;alp.util.conlog(this.declaredClass+" text_search v",v);this._text_searcher||(this._text_searcher=new alp.util.SortedDataSearcher(dojo.hitch(this,function(){return (this.areas&&this.areas.tree&&this.areas.tree.length)||0;}),dojo.hitch(this,"_areaname_compare_with"),dojo.hitch(this,"_areaname_starts_with")));o=this._text_searcher.search(v);if(!o){this._text_search_result();return;}this._text_search_result(o.first,o.last);},_areaname_starts_with:function(_15e,v){if(this.areas.tree[_15e][this._TI_NAME].length<v.length){return false;}return 0===this._areaname_compare_with(_15e,v);},_areaname_compare_with:function(_15f,v){var _160=this.areas.tree[_15f][this._TI_NAME],_161,cn_v;if(_160.substr(0,v.length).toLowerCase()===v.toLowerCase()){return 0;}_161=this._make_comparable_name(_160);cn_v=this._make_comparable_name(v);if(_161<cn_v){return -1;}if(_161>cn_v){return +1;}console.error(this.declaredClass+"._areaname_compare_with(): bug!",_160,v,_161,cn_v);},_make_comparable_name:function(v){var a,arr,cc,me=this._make_comparable_name,n,_162=this.areas.order,_163;me._cache=me._cache||{};if(me._cache[v]===undefined){_163=v.toLowerCase();arr=new Array(_163.length);for(a=0;a<_163.length;a++){n=_162.indexOf(_163.charAt(a));cc=_163.charCodeAt(a);if(n>-1){cc=32+n;}else{cc=Math.max(32+_162.length,cc);}arr[a]=String.fromCharCode(cc);}me._cache[v]=arr.join("");}return me._cache[v];},list_update:function list_update(_164,last){var a,frag,n,ts,_165=this.areas.HIDDEN_NAME;alp.util.conlog(this.declaredClass+".list_update( ",_164,", ",last," )");ts=this._sub.text_select;if(!ts){return;}frag=document.createDocumentFragment();n=0;if((_164!==undefined)&&(last!==undefined)){for(a=_164;(n<this.text_select_max)&&(a<=last);a++){if(!this._is_area_choosable(a)){continue;}var x=this.areas.tree[a],_166=(x&&x[this._TI_NAME]===_165);if(_166){continue;}frag.appendChild(dojo.create("option",{innerHTML:this.areas.tree[a][this._TI_NAME],value:a}));n++;}}dojox.html.set(ts,frag);},is_empty:function(){var ts=this._sub&&this._sub.text_select;if(!ts){return true;}return dojo.query("option",ts).length<1;},_is_subtree_choosable:function(_167){if(this._init_dfrd.fired!==0){console.error(this.declaredClass+"._is_subtree_choosable("+_167+"): MUST not be called before init finished!");return;}var attr=this.areas.attr,me=dojo.getObject("_instanced._is_subtree_choosable",true,this);me._cache=me._cache||{};if(me._cache[_167]===undefined){me._cache[_167]=this.is_choosable(_167,attr.subtrees,true);}return me._cache[_167];},_is_area_choosable:function(_168){if(this._init_dfrd.fired!==0){console.error(this.declaredClass+"._is_area_choosable("+_168+"): MUST not be called before init finished!");return;}var attr=this.areas.attr,me=dojo.getObject("_instanced._is_area_choosable",true,this);me._cache=me._cache||{};if(me._cache[_168]===undefined){me._cache[_168]=this.is_choosable(_168,attr.nodes,false);}return me._cache[_168];},allareas_selected:function allareas_selected(){alp.util.conlog(this.declaredClass+".allareas_selected()");},toparea_selected:function toparea_selected(){alp.util.conlog(this.declaredClass+".toparea_selected()");},area_selected:function area_selected(id,_169){alp.util.conlog(this.declaredClass+" area_selected, id:",id,", more info:",_169);},text_arrow_down:function text_arrow_down(){alp.util.conlog(this.declaredClass+".text_arrow_down()");},text_arrow_enter:function text_arrow_up(){alp.util.conlog(this.declaredClass+".text_arrow_enter()");},text_arrow_up:function text_arrow_up(){alp.util.conlog(this.declaredClass+".text_arrow_up()");},text_changed:function text_changed(v){alp.util.conlog(this.declaredClass+" text_changed, v:",v);},text_search_result:function text_search_result(_16a,last){alp.util.conlog(this.declaredClass+" text_search_result, first: "+_16a+", last: "+last);},_allareas_selected:alp.util.asyncHitch("allareas_selected"),_toparea_selected:alp.util.asyncHitch("toparea_selected"),_areaindex_selected:function(_16b){var info=this.area_info(parseInt(_16b,10));alp.util.asyncHitch("area_selected",this)(info&&info.id,info);},_text_arrow_down:alp.util.asyncHitch("text_arrow_down"),_text_arrow_enter:alp.util.asyncHitch("text_arrow_enter"),_text_arrow_up:alp.util.asyncHitch("text_arrow_up"),_text_changed:alp.util.asyncHitch("text_changed"),_text_search_result:alp.util.asyncHitch("text_search_result")});dojo.declare("alp.x._AreaGeoLevel",null,{autoselect_single:true,major_vis:null,_minor_vis:null,constructor:function(_16c,opts){var me=this;me.areas=_16c;dojo.mixin(me,opts);(me.major_vis=new alp.data.BoolState({init_value:true})).entered_cb(me,"_update_vis");(me._minor_vis=new alp.data.BoolState()).entered_cb(me,"_update_vis");me._TI_LEVEL=me.areas.TREE_INDEX_LEVEL;me._TI_NAME=me.areas.TREE_INDEX_NAME;me._TI_ID=me.areas.TREE_INDEX_ID;me._TI_PARENTS=me.areas.TREE_INDEX_PARENTS;me._TI_BBOX=me.areas.TREE_INDEX_BBOX;me._TI_NICEID=me.areas.TREE_INDEX_NICEID;me._TI_ACTIV=me.areas.TREE_INDEX_ACTIV;dojo.connect(me.select,"onchange",me,"_fire_selection_changed");},get_selected_area:function(){return this.select.value+"";},refresh:function(){this.set_select();},set_select:function(_16d){this.select.value=(_16d!=null)?(_16d+""):"";this._fire_selection_changed();},set_contents:function(_16e){var c,frag,_16f,_170,n,_171,_172=this.areas.HIDDEN_NAME;alp.util.conlog(this.declaredClass+".set_contents(",_16e,")");c=_16e&&this.areas.children[_16e];c=c&&dojo.filter(c,this.is_subtree_choosable,this);if(!alp.util.equal_array(this._c,c)){_16f=c&&(c.length>0);_170=false;if(_16f&&c.length===1){var ind=c[0],x=this.areas.tree[ind];_170=(x&&x[this._TI_NAME]===_172);}frag=document.createDocumentFragment();n=0;if(_16f){frag.appendChild(dojo.create("option",{innerHTML:this.choice_text,value:""}));dojo.forEach(c,function(_173){var a=this.areas.tree[_173][this._TI_NAME];_171=""+_173;frag.appendChild(dojo.create("option",{innerHTML:a,value:_171}));n++;},this);}dojox.html.set(this.select,frag);if((n===1)&&this.autoselect_single){this.select.value=_171;alp.util.attr(this.select,"disabled","disabled");}else{this.select.removeAttribute("disabled");}this._minor_vis.set(_16f&&(!_170));this._c=c;this._contents_changed();this._fire_selection_changed();}},_update_vis:function(){if(this.major_vis.get()){this.showhide.style.display="";this.showhide.style.visibility=this._minor_vis.get()?"":"hidden";}else{this.showhide.style.display="none";}},_fire_selection_changed:function _fire_selection_changed(){var _174=this._c&&(this._c.length>0);this._selection_changed(_174?(this.select.value?parseInt(this.select.value,10):undefined):"hidden");},contents_changed:function contents_changed(){alp.util.conlog(this.declaredClass+".contents_changed()");},selection_changed:function selection_changed(id){alp.util.conlog(this.declaredClass+".selection_changed("+id+")");},_contents_changed:alp.util.asyncHitch("contents_changed"),_selection_changed:alp.util.asyncHitch("selection_changed")});}if(typeof dojo==="undefined"||!dojo._hasResource["oa_v2.selectboxes"]){typeof dojo==="undefined"||(dojo._hasResource["oa_v2.selectboxes"]=true);dojo.provide("oa_v2.selectboxes");(function(){if(dojo.global.switchSelectBox){return;}dojo.global.switchFilterOptionsWrapper=(function(_175){return function(){dojo.query("#filterOptionsWrapper").forEach(function(node){if(!_175(node)){closeSelectBox();}dojo.style(node,{display:_175(node)?"none":"inline"});});};})(function(b){return b&&b.style&&(b.style.display==="inline");});dojo.global.topPos=function(elem){return elem.offsetParent?(elem.offsetTop+topPos(elem.offsetParent)):elem.offsetTop;};dojo.global.leftPos=function(elem){return elem.offsetParent?(elem.offsetLeft+leftPos(elem.offsetParent)):elem.offsetLeft;};dojo.global.closeSelectBox=function(){dojo.query(".select-box").style({display:"none"});};dojo.global.updateSportTitle=function(t){dojo.query(".docType-button").attr("innerHTML",t);};dojo.global.onSportSelect=function(info){closeSelectBox();updateSportTitle(info.title);};dojo.global.onAreaSelect=function(_176){closeSelectBox();};dojo.global.switchSelectBox=(function(_177){return function(el,_178){var sb=dojo.byId(_178);if(!sb){console.error("switchSelectBox did not find the DOM node with id: "+_178);return;}var _179=_177(sb);closeSelectBox();if(_179){return;}var _17a=topPos(el);var _17b=leftPos(el);sb.style.top=(_17a+21)+"px";sb.style.left=(_17b)+"px";var body=dojo.body();if(sb.parentNode!==body){if(sb.parentNode){sb.parentNode.removeChild(sb);}body.appendChild(sb);}sb.style.display="block";var sel=dojo.getObject("alp._obj.areaselector");if(sel&&sel.dom_is_in(sb)){sel.focus_text_input();}};})(function(sb){return sb&&sb.style&&(sb.style.display==="block");});dojo.global.showInfos=function(){dojo.query(".map-info-box").style({"display":"block"});dojo.query(".agMap").style({"height":"383px"});};dojo.global.hideInfos=function(){dojo.query(".map-info-box").style({"display":"none"});dojo.query(".agMap").style({"height":"543px"});};dojo.addOnLoad(function(){dojo.query(".docType-button").connect("onclick",function(e){switchSelectBox(this,"docType-select-box");});dojo.query(".select-box-close").onclick(closeSelectBox);dojo.query(".territory-button").connect("onclick",function(e){alp.util.getDfrd("alp._obj.areaselector").addCallback(this,function(sel){if(!sel.is_empty()){switchSelectBox(this,"territory-select-box");}else{console.error("oa_v2.selectboxes: alp._obj.areaselector.is_empty() returned true!");}});});dojo.query("#openFilterOptionsWrapper").concat(dojo.query("#closeFilterOptionsWrapper")).onclick(switchFilterOptionsWrapper);dojo.query(".tourplanner-docType-button").connect("onclick",function(e){switchSelectBox(this,"tourplanner-docType-select-box");});dojo.query("#tourplanner-docType-select-box").connect("onclick",function(e){switchSelectBox(this,"tourplanner-docType-select-box");});});hideInfos();})();}if(typeof dojo==="undefined"||!dojo._hasResource["alp.shadowbox"]){typeof dojo==="undefined"||(dojo._hasResource["alp.shadowbox"]=true);dojo.provide("alp.shadowbox");(function(){alp.shadowbox.init=init;function init(cfg){var ret=new alp.util.SafeDeferred();alp.util.asyncSequence().next(_17c).next(_17d).next(_17e).nextHitch(ret,"callback",true);return ret;function _17c(_17f){alp.util.getDfrd("Shadowbox.init").then(_17f);};function _17d(_180){Shadowbox.init(cfg);_180();};function _17e(_181){alp.util.getDfrd(function(){return (true===Shadowbox.isLoaded)||undefined;}).then(_181);};};})();}if(typeof dojo==="undefined"||!dojo._hasResource["oa_v2.pages.layout.root_dojo"]){typeof dojo==="undefined"||(dojo._hasResource["oa_v2.pages.layout.root_dojo"]=true);dojo.provide("oa_v2.pages.layout.root_dojo");alp.autoRedrawIE9plus();oa_v2.pages.layout.root_dojo.install=function(_182){if(!dojo.getObject("oa_v2.pages.tours")){var w=dojo.getObject("alp._obj",true).areaselector=new alp.x.AreaSelector({id:"territory-select-box",area_config_url:((dojo.global.alpConfig&&dojo.global.alpConfig.base_href)||"")+"/regionConfig.json?activ=true",is_choosable:function(_183,anos){return anos.hastour[_183];}});}};alp.util.install_delayed_img();alp.util.install_delayed_node();dojo.addOnLoad(function(){if(typeof Shadowbox!="undefined"){alp.shadowbox.init({language:"de-DE",players:["alpregio","swf"]});}});}dojo.i18n._preloadLocalizations("oa_v2.pages.layout.nls.root_dojo",["ROOT","de","de-de","en","en-gb","en-nz","en-us","fr","it","nl","xx"]);

