/*
	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.misc");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(_1){var _2=dojo.hitch(this,function(_3){dojo.mixin(this,_3);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 _1==="object"){_2(_1);}else{var _4={url:_1,handleAs:"json",load:function(r,_5){_2(r);},error:function(r,_6){console.error("alp.data.Areas failed to load the JSON configuration from url \""+_4.url+"\"");}};dojo.xhrGet(_4);}},init_dfrd:function(){return this._init_dfrd;},isInitialized:function(){return (this._init_dfrd===0);},inherits_from:function(_7,_8){var _9=new alp.util.SafeDeferred();this._init_dfrd.addCallback(this,function(){_9.callback(this._inherits_from(_7,_8));});return _9;},_inherits_from:function(_a,_b){var _c=(typeof _b!=="number");return ((_c?(dojo.indexOf(_b,_a)>-1):_a===_b)||dojun.some(dojo.map(this.tree[_a][this._TI_PARENTS],function(x){return this._inherits_from(x,_b);},this),"!!"));},info:function(_d){var a=this.tree[_d];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(_e,_f){var ret=new alp.util.SafeDeferred();this._init_dfrd.addCallback(this,function(){var v=this._indexBy(_e,_f);if(v===undefined){ret.cancel();return;}ret.callback(v);});return ret;},_indexBy:function(t,_10){var me=this,_11=(typeof _10==="string"),_12=me.declaredClass+"._indexBy(t:\""+t+"\", value:\""+_10+"\")",a=me.tree,_13=me._TI_LEVEL,_14=me._TI_NAME,_15=me.HIDDEN_NAME,_16=(typeof t==="string")?[t]:t;var ok=true;dojo.forEach(_16,function(_17){if(0>dojo.indexOf(["name","id","niceid"],_17)){console.error(_12+": invalid type \""+_17+"\".");ok=false;}});if(ok){var _18=dojo.map(_16,function(_19){return me["_TI_"+_19.toUpperCase()];});ok=alp.util.and(_18);}if(!ok){return;}if(!(_11||(typeof (_10&&_10.length)==="number"))){console.error(_12+": value must be a string or array of strings, you gave me a \""+(typeof _10)+"\":",_10);return;}if(!a){return;}var _1a=_11?[_10]:_10,_1b=new Array(_1a.length),n=0,k;for(var _1c=a.length;_1c--;){var one=a[_1c];if(one[_14]===_15){continue;}for(var bb=0,_1d=_18.length;bb<_1d;bb++){k=dojo.indexOf(_1a,one[_18[bb]]);if(k>-1){break;}}if(k<0){continue;}if(_1b[k]!=null){if(a[_1b[k]][_13]>one[_13]){_1b[k]=_1c;}continue;}_1b[k]=_1c;n++;}if(n<_1a.length){console.error(_12+": not enough areas found, expected:",_1a.length,", found:",n);}return _11?_1b[0]:_1b;},infoBy:function(_1e,_1f){var ret=new alp.util.SafeDeferred(),_20=this.declaredClass+".infoBy(type:\""+_1e+"\", value:\""+_1f+"\")";if(typeof _1f!=="string"){console.error(_20+" requires a string as type!");ret.cancel();return ret;}var a=this.indexBy.apply(this,arguments);a.addCallback(this,function(_21){ret.callback(this.info(_21));});a.addErrback(ret,"cancel");return ret;},walk:function(_22,_23,_24){var _25=this.tree[_22];if(!_25){return;}var _26=false;if(!_24){_26=_26||_23(_25,_22,this);}var _27=(!_26)&&this.children[_22];if(_27){for(var a=0,_28=_27.length;a<_28;a++){_26=_26||this.walk(_27[a],_23);}}return _26;}});}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 _29=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(_2a){dojo.mixin(this,_2a);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(_2b,_2c){var me=this,_2d=_2c&&_2c.do_not_copy,_2e=_2c&&_2c.loose,_2f=_2c&&_2c.delay_ms;if(!_2d){_2b.set(me.get());}if(!(_2e||(_2b instanceof eval(me.declaredClass)))){throw new Error(me.declaredClass+".bind_to(): incompatible other class \""+_2b.declaredClass+"\"");}return (null==_2f)?me.entered_cb(me,_30):dojo.connectLimited(-Math.abs(_2f),me,"entered",_30);function _30(){_2b.set(me.get());};},unbind:function(_31){dojo.disconnect(_31);},constrain:function(){this.set(this.get());},is:function(_32){return this.is_same(this._current,_32);},left_cb:function(){return dojo.connect(this,"left",dojo.hitch.apply(dojo,arguments));},left_v_cb:function(_33){var _34=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"left",this,function(_35,_36){if(this.is_same(_33,_35)){_34.call(null,_36);}});},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(_37){var _38=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"entered",this,function(_39,_3a){if(this.is_same(_37,_39)){_38.call(null,_3a);}});},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(_3b){var _3c=dojo.hitch.apply(dojo,Array.prototype.slice.call(arguments,1));return dojo.connect(this,"changed",this,function(_3d){if(this.is_same(_3b,_3d)){_3c.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(_3e,_3f){this.tell_it(_3e,_3f);},tell_it:function(_40,_41){var _42=this._last_emitted,c=this._emitted_once&&this.is_same(_42,this._current);alp.util.console(1,"log",this.declaredClass+".tell_it(",_40,"): this.is_same( this._last_emitted, this._current ): ",c,this._emitted_once,this._last_emitted,this._current);if(!c&&!_40){this._last_emitted=this._current;this._emitted_once=true;this._left(_42,this._current,_41);this._entered(this._current,_42,_41);}},get:function(){return this._current;},has_selection:function(){return this._current!==undefined;},unset:function(){return this.set();},set:function(_43,_44){_43=this[(_43===undefined)?"constrain_undef":"constrain_def"](_43,this._current);if(this.is_same(_43,this._current)){return false;}this._current=_43;this.update("me.set( "+_43+", "+_44+" )",_44,_29&&alp.util.callstack(this.set));return true;},left:function(_45,_46,_47){alp.util.console(1,"log",this.declaredClass+".left( previous_value, value ): previous_value:",_45,", value:",_46);},entered:function(_48,_49,_4a){this.changed(_48,_4a);alp.util.console(1,"log",this.declaredClass+".entered( value, previous_value ): value:",_48,", previous_value:",_49);},changed:function(_4b,_4c){},_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 _4d=rx.source;var _4e="";if(rx.global){_4e+="g";}if(rx.ignoreCase){_4e+="i";}if(rx.multiline){_4e+="m";}return alp.util.rx.scan(s,_4d,_4e);};alp.util.rx.scan=function scan(s,_4f,_50){var a,da,arr,_51,rx;arr=[];(function(){var tmp=s;a=0;while(true){rx=new RegExp(_4f,_50);_51=rx.exec(tmp);if(!_51){break;}var _52=_51.index+_51[0].length;arr.push([a+_52,_51]);da=Math.max(1,_52);a+=da;tmp=tmp.substr(da);}})();return arr;};alp.util.rx.map_groups=function map_groups(s,_53,fun){return alp.util.rx.map(s,_53,function(_54,_55){var _56=_54;for(var a=0;a<_55.length;a++){if(!_55[a]){continue;}_56=fun(_56,_55[a]);}return _56;});};alp.util.rx.map=function map(s,_57,fun){var _58,_59,_5a,_5b,_5c,_5d,s2,str;if(_57 instanceof RegExp){_57=alp.util.rx.scan_rx(s,_57);}s2=s;for(var ind=_57.length-1;ind>=0;ind--){_58=_57[ind];_5b=_58[0];_5d=_58[1];str=_5d[0];_5c=_5d.slice(1);_5a=_5b-str.length;_59=fun(str,_5c);s2=s2.substring(0,_5a)+_59+s2.substring(_5b);}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 _5e=/(AlphaImageLoader\([^)]*?src=(['"]))(?![a-z]+:|\/)([^\r\n;}]+?)(\2[^)]*\)\s*[;}]?)/g;}var _5f=/(?:(?:@import\s*(['"])(?![a-z]+:|\/)([^\r\n;{]+?)\1)|url\(\s*(['"]?)(?![a-z]+:|\/)([^\r\n;]+?)\3\s*\))([a-z, \s]*[;}]?)/g;var _60=dojox.html._adjustCssPaths=function(_61,_62){if(!_62||!_61){return;}if(_5e){_62=_62.replace(_5e,function(_63,pre,_64,url,_65){return pre+(new dojo._Url(_61,"./"+url).toString())+_65;});}return _62.replace(_5f,function(_66,_67,_68,_69,_6a,_6b){if(_68){return "@import \""+(new dojo._Url(_61,"./"+_68).toString())+"\""+_6b;}else{return "url("+(new dojo._Url(_61,"./"+_6a).toString())+")"+_6b;}});};var _6c=/(<[a-z][a-z0-9]*\s[^>]*)(?:(href|src)=(['"]?)([^>]*?)\3|style=(['"]?)([^>]*?)\5)([^>]*>)/gi;var _6d=dojox.html._adjustHtmlPaths=function(_6e,_6f){var url=_6e||"./";return _6f.replace(_6c,function(tag,_70,_71,_72,_73,_74,_75,end){return _70+(_71?(_71+"="+_72+(new dojo._Url(url,_73).toString())+_72):("style="+_74+_60(url,_75)+_74))+end;});};var _76=dojox.html._snarfStyles=function(_77,_78,_79){_79.attributes=[];return _78.replace(/(?:<style([^>]*)>([\s\S]*?)<\/style>|<link\s+(?=[^>]*rel=['"]?stylesheet)([^>]*?href=(['"])([^>]*?)\4[^>\/]*)\/?>)/gi,function(_7a,_7b,_7c,_7d,_7e,_7f){var i,_80=(_7b||_7d||"").replace(/^\s*([\s\S]*?)\s*$/i,"$1");if(_7c){i=_79.push(_77?_60(_77,_7c):_7c);}else{i=_79.push("@import \""+_7f+"\";");_80=_80.replace(/\s*(?:rel|href)=(['"])?[^\s]*\1\s*/gi,"");}if(_80){_80=_80.split(/\s+/);var _81={},tmp;for(var j=0,e=_80.length;j<e;j++){tmp=_80[j].split("=");_81[tmp[0]]=tmp[1].replace(/^\s*['"]?([\s\S]*?)['"]?\s*$/,"$1");}_79.attributes[i-1]=_81;}return "";});};var _82=dojox.html._snarfScripts=function(_83,_84){_84.code="";_83=_83.replace(/<[!][-][-](.|\s){5,}?[-][-]>/g,function(_85){return _85.replace(/<(\/?)script\b/ig,"&lt;$1Script");});function _86(src){if(_84.downloadRemote){src=src.replace(/&([a-z0-9#]+);/g,function(m,_87){switch(_87){case "amp":return "&";case "gt":return ">";case "lt":return "<";default:return _87.charAt(0)=="#"?String.fromCharCode(_87.substring(1)):"&"+_87+";";}});dojo.xhrGet({url:src,sync:true,load:function(_88){_84.code+=_88+";";},error:_84.errBack});}};return _83.replace(/<script\s*(?![^>]*type=['"]?(?:dojo\/|text\/html\b))(?:[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?)*>([\s\S]*?)<\/script>/gi,function(_89,_8a,src,_8b){if(src){_86(src);}else{_84.code+=_8b;}return "";});};var _8c=dojox.html.evalInGlobal=function(_8d,_8e){_8e=_8e||dojo.doc.body;var n=_8e.ownerDocument.createElement("script");n.type="text/javascript";_8e.appendChild(n);n.text=_8d;};dojo.declare("dojox.html._ContentSetter",[dojo.html._ContentSetter],{adjustPaths:false,referencePath:".",renderStyles:false,executeScripts:false,scriptHasHooks:false,scriptHookReplacement:null,_renderStyles:function(_8f){this._styleNodes=[];var st,att,_90,doc=this.node.ownerDocument;var _91=doc.getElementsByTagName("head")[0];for(var i=0,e=_8f.length;i<e;i++){_90=_8f[i];att=_8f.attributes[i];st=doc.createElement("style");st.setAttribute("type","text/css");var _92={};for(var x in att){if(x in _92){continue;}st.setAttribute(x,att[x]);}this._styleNodes.push(st);_91.appendChild(st);if(st.styleSheet){st.styleSheet.cssText=_90;}else{st.appendChild(doc.createTextNode(_90));}}},empty:function(){this.inherited("empty",arguments);this._styles=[];},onBegin:function(){this.inherited("onBegin",arguments);var _93=this.content,_94=this.node;var _95=this._styles;if(dojo.isString(_93)){if(this.adjustPaths&&this.referencePath){_93=_6d(this.referencePath,_93);}if(this.renderStyles||this.cleanContent){_93=_76(this.referencePath,_93,_95);}if(this.executeScripts){var _96=this;var _97={downloadRemote:true,errBack:function(e){_96._onError.call(_96,"Exec","Error downloading remote script in \""+_96.id+"\"",e);}};_93=_82(_93,_97);this._code=_97.code;}}this.content=_93;},onEnd:function(){var _98=this._code,_99=this._styles;if(this._styleNodes&&this._styleNodes.length){while(this._styleNodes.length){dojo.destroy(this._styleNodes.pop());}}if(this.renderStyles&&_99&&_99.length){this._renderStyles(_99);}if(this.executeScripts&&_98){if(this.cleanContent){_98=_98.replace(/(<!--|(?:\/\/)?-->|<!\[CDATA\[|\]\]>)/g,"");}if(this.scriptHasHooks){_98=_98.replace(/_container_(?!\s*=[^=])/g,this.scriptHookReplacement);}try{_8c(_98,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(_9a,_9b,_9c){if(!_9c){return dojo.html._setNodeContent(_9a,_9b,true);}else{var op=new dojox.html._ContentSetter(dojo.mixin(_9c,{content:_9b,node:_9a}));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(_9d,_9e,_9f){if(typeof _9d==="string"){var ret=document.createTextNode(_9d);if(_9e){dojo.place(ret,_9e,_9f);}return ret;}if(typeof _9d==="object"){return alp.util.createTextNode(function(){return dojo.getObject.apply(dojo,_9d);},_9e,_9f);}var ret=document.createTextNode("");alp.util.setTextDataAsync(ret,_9d);if(_9e){dojo.place(ret,_9e,_9f);}return ret;};alp.util.empty=function(_a0){if(!_a0){return;}var c;while(c=_a0.lastChild){_a0.removeChild(c);}return _a0;};alp.util.html_tmpl=function(_a1,_a2,rx){var t,_a3=typeof _a1;if(_a3==="function"){return _a1(_a2);}else{if(_a3==="string"){t=_a1;}else{if(_a3==="object"){t=_a1.innerHTML;}else{console.error("alp.util.htmltmpl(): invalid typeof template: "+_a3);}}}rx=rx||/__(.*?)__/;return alp.util.rx.map_groups(t,rx,function(_a4,_a5){if(!_a5){return _a4;}var f=new Function("data",dojo.global.unescape("return "+_a5+";"));try{return f(_a2);}catch(e){console.warn("alp.util.html_tmpl() caught e when replacing \""+_a4+"\" with \""+_a5+"\"");console.warn("alp.util.html_tmpl() exception e:",e);return "";}});};alp.util.new_id=function(_a6){_a6||(_a6={prefix:""});while(true){var id=_a6.prefix+""+Math.round(Math.random()*10000000000)+"_"+(new Date()>>0);if(!dojo.byId(id)){return id;}}};alp.util.node_show=function(_a7){var ns=_a7.style,_a8=(ns.display==="none"),_a9=(ns.visibility==="hidden"),_aa=_a8&&_a9;if(!_aa){if(window.getComputedStyle){var s=window.getComputedStyle(_a7,"");if(s){_a8=_a8||s.display==="none";_a9=_a9||s.visibility==="hidden";}}else{var s=_a7.currentStyle;if(s){_a8=_a8||s["display"]==="none";_a9=_a9||s["visibility"]==="hidden";}}}if(_a8){ns.display="";}if(_a9){ns.visibility="visible";}};alp.util.setNodeText=function(_ab,_ac){if(typeof _ab==="string"){_ab=dojo.query(_ab);}if(_ac===undefined){_ac="";}if(alp.util.isNodeList(_ab)){return _ab.map(function(_ad){return alp.util.setNodeText(_ad,_ac);});}alp.util.empty(_ab);_ab.appendChild(document.createTextNode(""+_ac));return _ab;};alp.util.setNodeTextAsync=function(_ae,_af,_b0){_b0||(_b0=new alp.util.SafeDeferred());if(typeof _af!=="function"){alp.util.setNodeText(_ae,_af);_b0.done();}else{var _b1=_af();if(_b1!=null){alp.util.setNodeText(_ae,_b1);_b0.done();}else{alp.util.asyncHitch("setNodeTextAsync",alp.util,150)(_ae,_af,_b0);}}return _b0;};alp.util.setTextDataAsync=function(_b2,_b3){var _b4=_b3();if(_b4){_b2.data=_b4;return;}alp.util.asyncHitch("setTextDataAsync",alp.util,150)(_b2,_b3);};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(_b5){alp.util.try_to_forbid_text_selection(_b5);});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(_b6,min,max,_b7,_b8){var mm=alp.util.minmax([min,max]),get=_b7;if(get(mm[0])>get(mm[1])){throw new Error("alp.util.dichotomy(): get_value_increasing must return increasing values!");}if(_b6>get(mm[1])){throw new Error("alp.util.dichotomy(): maximum too low!");}if(_b6<get(mm[0])){throw new Error("alp.util.dichotomy(): minimum too high!");}_b8=dojo.delegate({niter_max:100,precision:0},_b8);var x,y,_b9,_ba=_b8.niter_max,_bb=_b8.precision;for(_b9=0;(Math.abs(mm[1]-mm[0])>_bb)&&(_b9<_ba);_b9++){x=alp.util.mean(mm);y=get(x);mm[y<_b6?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=_bc(arr,opt),_bd=new alp.util.SortedDataSearcher(o.length,o.compare_fun,o.equals_fun,o.other_opts);arr.sortedsearch=_be;function _be(){return _bd.search.apply(_bd,arguments);};};alp.util.sortedsearch=function(x,arr,opt){var o=_bc(arr,opt),_bf=new alp.util.SortedDataSearcher(o.length,o.compare_fun,o.equals_fun,o.other_opts);return _bf.search(x);};function _bc(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,_c0){return opt.data_compare_fun(arr[ind],_c0);},equals_fun:opt.arr_equals_fun&&function(ind,_c1){return opt.data_equals_fun(arr[ind],_c1);},other_opts:{read_only_optim:opt.read_only_optim,data_compare_fun:opt.data_compare_fun}};};})();dojo.declare("alp.util.SortedDataSearcher",null,{constructor:function(_c2,_c3,_c4,opt){var me=this;me.length=_c2;me.compare_fun=_c3;me.equals_fun=_c4||function(ind,_c5){return (0===me.compare_fun(ind,_c5));};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(_c6,_c7,_c8,_c9){if(this.read_only_optim_fun){_c9=_c9||(_c7==null&&_c8==null);var _ca=this._prev_result;if(_ca&&(_c7==null||_c8==null)){var _cb=this.read_only_optim_fun(_c6,_ca.data);if(_c8==null&&_cb<0){_c8=_ca.first-1;}if(_c7==null&&_cb>0){_c7=_ca.last+1;}}}if(_c7==null){_c7=0;}if(_c8==null){_c8=this._length()-1;}if(_c8<_c7){return;}if(_c6===undefined){return {first:_c7,last:_c8};}if(this.compare_fun(_c7,_c6)>0){return;}if(this.compare_fun(_c8,_c6)<0){return;}var _cc=(_c8>-1)&&this.equals_fun(_c7,_c6),_cd=(_c8>-1)&&this.equals_fun(_c8,_c6),_ce=_c8-_c7,_cf=_c8-_c7,_d0,_d1,_d2,_d3,_d4,_d5,_d6,_d7,_d8;while(!((_c8<=_c7)||(_cc&&_cd)||(_d8))){var _d9=_c8-_c7;if(!_cc){_d0=Math.max(1,Math.min(_ce,_d9)>>1);}if(!_cd){_d1=Math.max(1,Math.min(_cf,_d9)>>1);}_d8=(_ce===_d0&&_cf===_d1);_ce=_d0;_cf=_d1;if(!_cc){_d2=Math.max(_c7+1,Math.min(_c8,_c7+_ce));_d3=this.compare_fun(_d2,_c6);_d4=(_d3===0);if((_d3<0)||(_d2===_c7+1)){_c7=_d2;_cc=_d4;_d8=false;}}if(!_cd){_d5=Math.min(_c8-1,Math.max(_c7,_c8-_cf));_d6=this.compare_fun(_d5,_c6);_d7=(_d6===0);if((_d6>0)||(_d5===_c8-1)){_c8=_d5;_cd=_d7;_d8=false;}}}if((_c8<_c7)||(!_cc)||(!_cd)){return;}if(_c9){this._prev_result={data:_c6,first:_c7,last:_c8};}return {first:_c7,last:_c8};}});}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(_da,_db,_dc){var ret=true;dojun.forIn(_db,function(v,k){ret=ret&&v[_da];});return !!ret;},on_select:undefined,minlevel:null,constructor:function(_dd){var _de=["id"];if(!dojun.every(_de,function(x){return _dd[x];})){console.error(this.declaredClass+".constructor(opts): opts is missing mandatory parameters, please provide: "+_de);return;}var me=this;dojo.mixin(me,_dd);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(_df){alp.util.getDfrd("alp.x.i18n.areaselector_none").then(function(){me._init(_df);});});});},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(_e0){var c=this._container;return c&&alp.util.isDescendant(c,_e0);},focus_text_input:function(){this.init_cb(this,function(){this._sub.text_input.focus();});},select_top:function(){this._toparea_selected();},area_inherits_from:function(_e1,_e2){return this.areas.inherits_from.apply(this.areas,arguments);},area_info:function(_e3){return this.areas.info.apply(this.areas,arguments);},area_indexBy:function(_e4,_e5){return this.areas.indexBy.apply(this.areas,arguments);},area_infoBy:function(_e6,_e7){return this.areas.infoBy.apply(this.areas,arguments);},selectBy:function(_e8,_e9){var _ea=arguments;this.init_cb(this,function(){this.area_indexBy.apply(this,_ea).addCallback(this,"_areaindex_selected");});},selectByName:function(_eb){this.selectBy("name",""+_eb);},_init:function(_ec){var a,_ed=this.declaredClass,me=this;if(!_ec){console.error(_ed,"._init(): failed to find the container node \""+me.id+"\". Aborting.");return;}me._container=_ec;me._sub={};var rx=/^id_(.+)/;dojun.forIn(me,function(_ee,k){var g=rx.exec(k),_ef=g&&(g.length>1)&&g[me._TI_NAME];if(!_ef){return;}dojo.query("[id=\""+_ee+"\"]",me._container).at(0).forEach(function(_f0){me._sub[_ef]=_f0;},me);if(!(me._sub[_ef]||(_ef==="select_all")||(_ef==="select_top"))){console.error(_ed+": could not find subcontrol \""+_ef+"\" (id: \""+_ee+"\" 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(_ed+"._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 _f1=me._sub.text_input,_f2;var _f3,_f4;dojo.connect(_f1,"onkeypress",function(e){alp.util.asyncHitch(function(_f5){_f4(_f1.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(){_f1.value=_f3();}));_f3=dojo.hitch(me,function(){return _f2||"";});_f4=dojo.hitch(me,function(v){if(v!==_f2){_f2=""+v;me._text_changed(_f2);}});dojo.connect(me,"refresh",function(){me._text_changed(_f3());});})();dojo.connect(me,"text_changed",me,"text_search");dojo.connect(me,"text_search_result",me,"list_update");dojo.hitch(me,function(){var _f6,_f7,_f8,_f9,_fa;_f6=alp.util.asyncHitch(function(){_f8=me._sub.text_select.value;me._sub.text_ok.style.visibility=_f8?"":"hidden";_f7();},me);_f7=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);_f9=alp.util.asyncHitch(function(){if(_f8){me._areaindex_selected(_f8);}},me);_fa=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;}_f6();}_f7();});dojo.connect(me._sub.text_select,"onchange",_f6);dojo.connect(me,"list_update",_f6);dojo.connect(me._sub.text_ok,"onclick",_f9);dojo.connect(me,"text_arrow_down",function(){_fa("down");});dojo.connect(me,"text_arrow_up",function(){_fa("up");});dojo.connect(me,"text_arrow_enter",_f9);_f6();})();me._init_dfrd.addCallback(me,function(){var a,arr,f_1,f_2,_fb,geo,_fc,mm,_fd,_fe;_fb=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(_ff){ret=_ff;});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(_fb,function(opt){return new alp.x._AreaGeoLevel(me.areas,opt);},me);me._geo=geo;_fd=alp.util.asyncHitch(function(){alp.util.conlog(me.declaredClass+": update_geo_ok --- ");var a,b,_100=null;for(a=geo.length-1;a>=0;a--){b=parseInt(geo[a].get_selected_area(),10);if(alp.util.isFiniteNumber(b)){_100=b;break;}}if(_fe!==_100){_fe=_100;me._sub.geo_ok.style.visibility=((_fe!==undefined)&&me._is_area_choosable(_fe))?"":"hidden";}},me);dojo.connect(me._sub.geo_ok,"onclick",alp.util.asyncHitch(function(){if(alp.util.isFiniteNumber(_fe)){me._areaindex_selected(_fe);}},me,0,_fe));f_1=dojo.hitch(me,function(a){dojo.connect(geo[a],"selection_changed",me,function(sel){var b,_101,_102;_101=sel&&me.areas.children[sel];if((typeof sel!=="number")||(isNaN(sel))||(!(_101&&(_101.length>0)))){geo[a+1].set_contents();return;}_102=me.areas.tree[_101[0]][me._TI_LEVEL];for(b=a+1;b<Math.min(geo.length-1,_102);b++){geo[b].set_contents();}if(_102<geo.length){window.setTimeout(function(){geo[_102].set_contents(sel);});}});});f_2=function(a){dojo.connect(geo[a],"selection_changed",_fd);};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);_fc=dojun.map([me.minlevel,me.maxlevel],dojo.hitch(alp.util,"isFiniteNumber"));if(!alp.util.and(_fc)){mm=alp.util.minmax(dojun.map(me.areas.tree,"x->x[0]"));if(!_fc[0]){me.minlevel=mm[0];}if(!_fc[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,_103=geo.length;a<_103;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 _104={};if(this._instanced){for(var k in this._instanced){if(!(k in _104)){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(_105,v){if(this.areas.tree[_105][this._TI_NAME].length<v.length){return false;}return 0===this._areaname_compare_with(_105,v);},_areaname_compare_with:function(_106,v){var _107=this.areas.tree[_106][this._TI_NAME],_108,cn_v;if(_107.substr(0,v.length).toLowerCase()===v.toLowerCase()){return 0;}_108=this._make_comparable_name(_107);cn_v=this._make_comparable_name(v);if(_108<cn_v){return -1;}if(_108>cn_v){return +1;}console.error(this.declaredClass+"._areaname_compare_with(): bug!",_107,v,_108,cn_v);},_make_comparable_name:function(v){var a,arr,cc,me=this._make_comparable_name,n,_109=this.areas.order,_10a;me._cache=me._cache||{};if(me._cache[v]===undefined){_10a=v.toLowerCase();arr=new Array(_10a.length);for(a=0;a<_10a.length;a++){n=_109.indexOf(_10a.charAt(a));cc=_10a.charCodeAt(a);if(n>-1){cc=32+n;}else{cc=Math.max(32+_109.length,cc);}arr[a]=String.fromCharCode(cc);}me._cache[v]=arr.join("");}return me._cache[v];},list_update:function list_update(_10b,last){var a,frag,n,ts,_10c=this.areas.HIDDEN_NAME;alp.util.conlog(this.declaredClass+".list_update( ",_10b,", ",last," )");ts=this._sub.text_select;if(!ts){return;}frag=document.createDocumentFragment();n=0;if((_10b!==undefined)&&(last!==undefined)){for(a=_10b;(n<this.text_select_max)&&(a<=last);a++){if(!this._is_area_choosable(a)){continue;}var x=this.areas.tree[a],_10d=(x&&x[this._TI_NAME]===_10c);if(_10d){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(_10e){if(this._init_dfrd.fired!==0){console.error(this.declaredClass+"._is_subtree_choosable("+_10e+"): 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[_10e]===undefined){me._cache[_10e]=this.is_choosable(_10e,attr.subtrees,true);}return me._cache[_10e];},_is_area_choosable:function(_10f){if(this._init_dfrd.fired!==0){console.error(this.declaredClass+"._is_area_choosable("+_10f+"): 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[_10f]===undefined){me._cache[_10f]=this.is_choosable(_10f,attr.nodes,false);}return me._cache[_10f];},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,_110){alp.util.conlog(this.declaredClass+" area_selected, id:",id,", more info:",_110);},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(_111,last){alp.util.conlog(this.declaredClass+" text_search_result, first: "+_111+", last: "+last);},_allareas_selected:alp.util.asyncHitch("allareas_selected"),_toparea_selected:alp.util.asyncHitch("toparea_selected"),_areaindex_selected:function(_112){var info=this.area_info(parseInt(_112,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(_113,opts){var me=this;me.areas=_113;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(_114){this.select.value=(_114!=null)?(_114+""):"";this._fire_selection_changed();},set_contents:function(_115){var c,frag,_116,_117,n,_118,_119=this.areas.HIDDEN_NAME;alp.util.conlog(this.declaredClass+".set_contents(",_115,")");c=_115&&this.areas.children[_115];c=c&&dojo.filter(c,this.is_subtree_choosable,this);if(!alp.util.equal_array(this._c,c)){_116=c&&(c.length>0);_117=false;if(_116&&c.length===1){var ind=c[0],x=this.areas.tree[ind];_117=(x&&x[this._TI_NAME]===_119);}frag=document.createDocumentFragment();n=0;if(_116){frag.appendChild(dojo.create("option",{innerHTML:this.choice_text,value:""}));dojo.forEach(c,function(_11a){var a=this.areas.tree[_11a][this._TI_NAME];_118=""+_11a;frag.appendChild(dojo.create("option",{innerHTML:a,value:_118}));n++;},this);}dojox.html.set(this.select,frag);if((n===1)&&this.autoselect_single){this.select.value=_118;alp.util.attr(this.select,"disabled","disabled");}else{this.select.removeAttribute("disabled");}this._minor_vis.set(_116&&(!_117));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 _11b=this._c&&(this._c.length>0);this._selection_changed(_11b?(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["alp.util.bg"]){typeof dojo==="undefined"||(dojo._hasResource["alp.util.bg"]=true);dojo.provide("alp.util.bg");dojo.declare("alp.util.Background",null,{pause_work_ratio:1,work_max_ms:(alp.util.likeIE()?200:100),pause_min_ms:(alp.util.likeIE()?100:10),pause_max_ms:500,waker_required:true,waker_interval_ms:1000,sleepy:null,constructor:function(opts){var me=this;dojo.mixin(me,opts);me.sleepy=new alp.data.BoolState();me.sleepy.changed_v_cb(true,function(){me.do_some();});if(me.waker_required){window.setInterval(dojo.hitch(me,"waker"),me.waker_interval_ms);}me.waker();},do_some:function(){var args,_11c,_11d,me,_11e,_11f,_120,_121,_122,_123;if(this.sleepy.get()){return;}me=dojo.getObject("_instanced.do_some",true,this);if(djConfig.isDebug>2){console.log(this.declaredClass+".do_some( ... ), arguments:",arguments);}args=((arguments.lenth>0)?arguments:me._last_args)||[];me._last_args=args;_122=alp.util.now_time();_11f=undefined;_11f=(me._thrown>0)&&me._last_pause_start_time&&Math.max(0,_122-me._last_pause_start_time);if(!(me._thrown>0)){me._thrown=0;}else{me._thrown--;}_11d=false;_123=undefined;while(!(_123>=this.work_max_ms)){_11c=this.do_one_impl.apply(this,args);_121=alp.util.now_time();_123=_121-_122;_11d=_11d||_11c;if(!_11c){break;}}me._last_pause_start_time=undefined;if(_11c&&(me._thrown<1)){me._last_pause_start_time=_121;_11e=_123*this.pause_work_ratio;if(_11f){_11e+=Math.max(_11e,_11f);_11e>>=1;}_120=Math.max(this.pause_min_ms,Math.min(this.pause_max_ms,_11e));alp.util.asyncHitch("do_some",this,_120).apply(null,args);me._thrown=1;if(djConfig.isDebug){console.log("alp.util.Background.do_some(): me._thrown:",me._thrown,"last_pause_duration:",_11f,", work_duration:",_123,", desired_pause_duration:",_11e,", pause_duration:",_120);}}},waker:function(){if(djConfig.isDebug>2){console.log(this.declaredClass+".waker()");}if((!this.do_some._thrown)||(this.do_some._thrown<1)){if(djConfig.isDebug>2){console.log(this.declaredClass+".waker() calling this.do_some()");}this.do_some();}},do_one_impl:function(){throw new Error("alp.util.Background.do_one_impl() not implemented yet. Please implement.");}});}if(typeof dojo==="undefined"||!dojo._hasResource["alp.x.animation"]){typeof dojo==="undefined"||(dojo._hasResource["alp.x.animation"]=true);dojo.provide("alp.x.animation");(function(){var aux=alp.x;aux.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){var s;if(Math.abs(t)<1e-10){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){var s;if(Math.abs(t)<1e-10){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){var s;if(Math.abs(t)<1e-10){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(!a||a<Math.abs(c)){a=c;s=p/4;}else{s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-aux.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}}}return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return aux.Easing.bounceIn(t*2,0,c,d)*0.5+b;}return aux.Easing.bounceOut(t*2-d,0,c,d)*0.5+c*0.5+b;}};(function(){var _124=new alp.util.Background({pause_work_ratio:1,work_max_ms:0,pause_min_ms:(alp.util.likeIE()?10:0),pause_max_ms:10,_entry_list:[],do_one_impl:function(){var _125="alp.x: _animator.do_one_impl()";var _126=false;var _127=[];dojo.forEach(this._entry_list,function(x){var arr=x.arr;var _128=x.start_sec;var _129=alp.util.now_time_sec();var _12a=[];dojo.forEach(arr,function(o){if(!(o&&o.node&&o.attr&&o.duration_sec)){return;}var _12b=_128+o.duration_sec;var prop=Math.max(0,Math.min(1,(_129-_128)/o.duration_sec));this._update_anim(o.node,o.attr,prop,o.easing);_126=true;if(_129<_12b){_12a.push(o);return;}if(o.on_end){try{_126=true;o.on_end();}catch(e){console.error(_125+": caught exception while calling on_end:",o.on_end," of o:",o);console.error(_125+": exception:",e);}}},this);if(_12a.length>0){_127.push({arr:_12a,start_sec:_128});}},this);this._entry_list=_127;return _126;},start_anim:function start_anim(arr){this._entry_list.push({arr:arr,start_sec:alp.util.now_time_sec()});this.do_some();},_update_anim:function _update_anim(node,attr,prop,_12c){_12c=_12c||aux.Easing.easeNone;dojun.forIn(attr,function(v,k){var val=_12c(prop,v.from,v.delta,1);if(v.no_neg){val=Math.max(val,0);}if(node.style){dojo.style(node,k,val+(v.unit||""));}else{if(node[k]){node[k]=val;}}});}});var _12d={noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i};aux.animate=function animate(){var _12e="alp.x.animate()";var _12f;_12f=dojo.filter(Array.prototype.slice.apply(arguments),function(x){return (typeof x==="object")&&x.node&&x.duration_sec&&x.from&&x.to;});if(_12f.length!==arguments.length){console.error(_12e+": some invalid arguments were dropped ",arguments," -> ",_12f);}_12f=dojo.map(_12f,function(o){var ret={};ret.node=o.node;ret.duration_sec=o.duration_sec;ret.easing=o.easing||aux.Easing.easeNone;ret.on_end=o.on_end;ret.attr=undefined;var f=function(v){return (typeof v==="function")?v(o.node):v;};dojun.forIn(o.from,function(v,k){if(o.to[k]===undefined){return;}ret.attr=ret.attr||{};var _130=f(o.from[k]);var _131=f(o.to[k]);ret.attr[k]={from:_130,delta:_131-_130,unit:(o.unit&&o.unit[k])||(_12d.defaultUnit.test(k)?"px":""),no_neg:_12d.noNegatives.test(k)};});return ret;});_124.start_anim(_12f);};})();})();}if(typeof dojo==="undefined"||!dojo._hasResource["alp.x.slideshow"]){typeof dojo==="undefined"||(dojo._hasResource["alp.x.slideshow"]=true);dojo.provide("alp.x.slideshow");(function(){var aux=alp.x;aux.Transitions={none:{},staticTL:{from:{top:0,left:0},to:{top:0,left:0}},staticTR:{from:{top:0,right:0},to:{top:0,right:0}},staticBL:{from:{bottom:0,left:0},to:{bottom:0,left:0}},staticBR:{from:{bottom:0,right:0},to:{bottom:0,right:0}},fadeIn:{from:{opacity:0},to:{opacity:1}},fadeOut:{from:{opacity:1},to:{opacity:0}},swipeInLTR:{from:{left:function(node){return parseInt(-node.parentNode.offsetWidth,10);}},to:{left:0}},swipeOutLTR:{from:{left:0},to:{left:function(node){return parseInt(node.parentNode.offsetWidth,10);}}},swipeInRTL:{from:{right:function(node){return parseInt(-node.parentNode.offsetWidth,10);}},to:{right:0}},swipeOutRTL:{from:{right:0},to:{right:function(node){return parseInt(node.parentNode.offsetWidth,10);}}},swipeInTTB:{from:{top:function(node){return parseInt(-node.parentNode.offsetHeight,10);}},to:{top:0}},swipeOutTTB:{from:{top:0},to:{top:function(node){return parseInt(node.parentNode.offsetHeight,10);}}},swipeInBTT:{from:{bottom:function(node){return parseInt(-node.parentNode.offsetHeight,10);}},to:{bottom:0}},swipeOutBTT:{from:{bottom:0},to:{bottom:function(node){return parseInt(node.parentNode.offsetHeight,10);}}}};dojo.declare("alp.x.SlideShow",null,{zIndex:{container:1,slides:2,nextSlide:3,currentSlide:4},transIn:aux.Transitions.fadeIn,transOut:aux.Transitions.fadeOut,easingIn:aux.Easing.easeOut,easingOut:aux.Easing.easeOut,initTransTo:true,currentSlide:0,interval:7000,duration_sec:0.5,autoplay:true,debug:false,loop:false,previousButton:false,nextButton:false,playButton:false,pauseButton:false,stopOnUser:true,current_slide_number_display_q:undefined,max_slide_number_display_q:undefined,HTML_EXAMPLE:"<div id=\"controls\">"+"<span class=\"prev\">&nbsp;</span>"+"<span class=\"play\">&nbsp;</span>"+"<span class=\"pause hidden\">&nbsp;</span>"+"<span class=\"next\">&nbsp;</span>"+"</div>"+"<ul id=\"emotionals\">"+"<li class=\"slide\">"+"<img src=\"res/temp/img_claim_startseite.jpg\" alt=\"#\" />"+"<div class=\"claim\">"+"<h2>Foobar</h2>"+"<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>"+"</div>"+"</li>"+"<li class=\"slide\">"+"<img src=\"res/temp/img_claim_startseite.jpg\" alt=\"#\" />"+"<div class=\"claim\">"+"<h2>Foobar 2</h2>"+"<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>"+"</div>"+"</li>"+"<li class=\"slide show\">"+"<img src=\"res/temp/img_claim_startseite.jpg\" alt=\"#\" />"+"<div class=\"claim\">"+"<h2>Hier werden Touren gemacht!</h2>"+"<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>"+"</div>"+"</li>"+"</ul>",constructor:function(_132,_133){var _134=function(o){var a=new alp.x.SlideShow(o,_133);};if(dojo.isString(_132)){if(!dojo.byId(_132)){var ad=alp.util.getDfrd(function(){return dojo.byId(_132)||undefined;});ad.addCallback(_134);return ad;}this.id=_132;this.container=dojo.byId(this.id);}else{if(dojo.isArray(_132)){dojo.forEach(_132,_134);return true;}else{if(dojo.isObject(_132)){this.id=_132.id;this.container=dojo.byId(this.id);}else{return false;}}}this.slides=dojo.filter(this.container.childNodes,function(x){return !!x.style;});if(!(this.slides&&this.slides.length)){console.error("alp.x.SlideShow.constructor(): did not find any slide!");}dojo.mixin(this,_133);this._init();},_slide_index:function(i){var n=this.slides.length;var c=parseInt(i,10)||0;while(c<0){c+=n;}c=c%n;if((typeof c!=="number")||isNaN(c)){return undefined;}return c;},slideChange:function(_135){if(!(this.slides&&this.slides.length)){return;}var _136=this.declaredClass+".slideChange()";if(typeof _135==="string"){if(_135==="next"){this.slideChange(this.currentSlide+1);return;}if(_135==="previous"){this.slideChange(this.currentSlide-1);return;}console.error(_136+": invalid parameter ",_135);return;}this._setCurrentSlide(this._slide_index(this.currentSlide));var _137=this._slide_index(_135);var _138=dojo.mixin({node:this.slides[this.currentSlide||0],duration_sec:this.duration_sec,easing:this.easingOut,on_end:dojo.hitch(this,function(){dojo.style(_138.node,"zIndex",this.zIndex.slides);})},this.transOut);var _139=dojo.mixin({node:this.slides[_137],duration_sec:this.duration_sec,easing:this.easingIn,on_end:dojo.hitch(this,function(){dojo.style(_139.node,"zIndex",this.zIndex.currentSlide);})},this.transIn);dojo.style(_139.node,"zIndex",this.zIndex.nextSlide);aux.animate(_138,_139);this._setCurrentSlide(_137);},startLoop:function(){if(this.loop){return;}if(this.autoplay===true){if(this.debug===false){this.loop=window.setInterval(dojo.hitch(this,function(){this.slideChange("next");}),this.interval);}else{if(this.debug===true){this.loop=window.setTimeout(dojo.hitch(this,function(){this.slideChange("next");}),this.interval);}}}},stopLoop:function(){if(this.loop){window.clearInterval(this.loop);}this.loop=undefined;},_init:function(){var a,f_1,f_2,f_3,node;this._setCurrentSlide(this._slide_index(this.currentSlide));dojo.style(this.container,{position:"relative",zIndex:this.zIndex.container});dojo.forEach(this.slides,function(s){dojo.style(s,{position:"absolute",zIndex:this.zIndex.slides});},this);if(this.slides&&this.slides.length){dojo.style(this.slides[this.currentSlide],"zIndex",this.zIndex.currentSlide);dojo.style(this.slides[this._slide_index(this.currentSlide+1)],"zIndex",this.zIndex.nextSlide);}if(this.initTransTo){f_3=function(v,k){return (typeof v==="function")?v(node):v;};for(a=0;a<this.slides.length;a++){node=this.slides[a];dojo.style(node,dojun.mapIn((a===this.currentSlide)?this.transIn.to:this.transOut.to,f_3,this));}}a=this.previousButton;if(a){dojo.query(a).onclick(dojo.hitch(this,function(){if(this.stopOnUser){this.stopLoop();}this.slideChange("previous");}));}a=this.nextButton;if(a){dojo.query(a).onclick(dojo.hitch(this,function(){if(this.stopOnUser){this.stopLoop();}this.slideChange("next");}));}a=this.playButton;if(a){dojo.query(a).onclick(dojo.hitch(this,this.startLoop));}a=this.pauseButton;if(a){dojo.query(a).onclick(dojo.hitch(this,this.stopLoop));}if(this.current_slide_number_display_q){f_1=dojo.hitch(this,function(){dojo.query(this.current_slide_number_display_q).attr("innerHTML",""+(1+this._slide_index(this.currentSlide)));});dojo.connect(this,"slide_changed",f_1);f_1();}if(this.max_number_display_q){f_2=dojo.hitch(this,function(){dojo.query(this.max_slide_number_display_q).attr("innerHTML",""+this.slides.length);});dojo.connect(this,"slide_changed",f_2);f_2();}alp.later(function(){if(alp.util.likeIE()&&dojo.isIE<9){this.slideChange(this._slide_index(this.currentSlide));}this.startLoop();},10,this);},_setCurrentSlide:function(n){this.currentSlide=n;this._slide_changed();},slide_changed:function(){},_slide_changed:alp.util.asyncHitch("slide_changed")});})();}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=_13a;alp.likeIE_onactivate=_13b;alp.likeIE8minus_backslash_v=_13c;alp.likeIE9plus=_13d;var _13e;function _13a(){return _13e!=null?_13e:(_13e=_13c()||_13b());};var _13f;function _13c(){return _13f!=null?_13f:(_13f=!+"\v1");};var _140;function _13b(){return _140!=null?_140:(_140="onactivate" in document.createElement("div"));};var _141;function _13d(){return _141!=null?_141:(_141=_13b()&&!_13c());};})();}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 _142=Array.prototype.slice,_143={};var _144=/\bie9nofix\b/.test(document.location.search);var _145={DOMContentLoaded:"onload"},_146,_147=[],_148=_149(document,"DOMContentLoaded",function(){_146=true;_14a();_14b(_148);});alp.aC=_14c;alp.aEL=_149;alp.autoRedrawIE9plus=_14d;alp.body=_14e;alp.cE=_14f;alp.cookie=_150;alp.cookie.isSupported=_151;alp.cTxN=_152;alp.domWalkSelect=_153;alp.gA=_154;alp.gBodyNode=_155;alp.gEBI=_156;alp.gEBCN=_157;alp.gEBTN=_158;alp.gWindowScroll=_159;alp.hA=_15a;alp.hasClass=_15b;alp.head=_15c;alp.newId=_15d;alp.onDCL=_15e;alp.orphan=_15f;alp.place=_160;alp.rEL=_14b;alp.redrawIE9=_161;alp.rA=_162;alp.sA=_163;alp.setProp=_164;alp.setClass=_165;function _14c(_166,_167){_166.appendChild(_167);};function _149(_168,type,_169,_16a){var arr=_168 instanceof Array?_168:[_168];for(var a=arr.length;a--;){var _16b=arr[a];if(_16b.addEventListener){_16b.addEventListener(type,_169,_16a);}else{if(_16b.attachEvent){var _16c=_145[type]||("on"+type);(type==="DOMContentLoaded"?window:_16b).attachEvent(_16c,_169);}else{console.error("alp_aEL failed.",a,arguments);}}}var ret=_142.call(arguments);ret.alp_aEL=true;return ret;};var _16d;function _14e(){return _16d||(_16d=document.body||_158("body")[0]||_153(document,function(node){return node!==document&&/body/i.test(node.tagName);},true));};function _14f(_16e,_16f,_170,_171){if(_170&&alp.likeIE8minus_backslash_v()){if(!/^[^\<\>]+$/.test(_16e)){console.error("alp.cE(): the IE8- workaround needs a simple tag name. Workaround skipped.");}else{_16e="<"+_16e;for(var k in _170){if(!(k in _143)){_16e+=" "+k+"=\""+_170[k].replace(/"/g,"\\\"")+"\"";}}_170=null;_16e+=">";}}var ret=document.createElement(_16e);if(_170){_163(ret,_170);}if(_171){_164(ret,_171);}if(_16f){_14c(_16f,ret);}return ret;};function _150(name,_172,_173){var doc=document;if(_172==null){var c=doc.cookie,m=c.match(new RegExp("(?:^|; )"+name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return (m||[])[1];}_173||(_173={});var exp=_173.expires;if(typeof exp==="number"){var d=new Date();d.setTime(d.getTime()+exp*24*60*60*1000);exp=_173.expires=d;}if(exp&&exp.toUTCString){_173.expires=exp.toUTCString();}_172=encodeURIComponent(_172);var _174=name+"="+_172,_175,_176={};for(_175 in _173){if(!(_175 in _176)){_174+="; "+_175;var _177=_173[_175];if(_177!==true){_174+="="+_177;}}}document.cookie=_174;};function _151(){if(!("cookieEnabled" in navigator)){this("__alpCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__alpCookieTest__")=="CookiesAllowed";if(navigator.cookieEnabled){this("__alpCookieTest__","",{expires:-1});}}return navigator.cookieEnabled;};function _152(text,_178){var ret=document.createTextNode(text);if(_178){_14c(_178,ret);}return ret;};function _14b(_179){var arg=arguments.length>1?arguments:_179;var arg0=arg[0],_17a=arg0 instanceof Array?arg0:[arg0],type=arg[1],_17b=arg[2],_17c=arg[3];for(var a=_17a.length;a--;){var _17d=_17a[a];if(_17d.removeEventListener){_17d.removeEventListener(type,_17b,_17c);}else{if(_17d.detachEvent){var _17e=_145[type]||("on"+type);(type==="DOMContentLoaded"?window:_17d).detachEvent(_17e,_17b);}else{console.error("alp_rEL failed.",a,arguments);}}}};function _14d(){if(!alp.likeIE9plus()||_14d.isActive){return;}_14d.isActive=true;var d=document,w=window,_17f=/(html|body|select|option|input|textarea)/i;_149(d,"activate",_180);_149(d,"deactivate",_180);_149(d,"click",_180);_149(d,"mouseover",_180);_149(d,"mouseout",_180);_149(d,"mousemove",_180);_149(d,"mouseenter",_180);_149(d,"mouseleave",_180);function _180(e){e=e||w.event;var t=e&&(e.target||e.srcElement);if(t&&!_17f.test(t.tagName)&&!_181(t,"iframe")){alp.redrawIE9(t);}return e;};function _181(t,_182){var rx=new RegExp(_182,"i");while(t){if(rx.test(t.tagName)){return true;}t=t.parentNode;}return false;};};function _153(_183,_184,_185){var ret=[],node=_183,prev;while(true){var up=prev&&prev.parentNode===node;if(!up&&_184(node)){if(_185){return node;}else{ret.push(node);}}var _186=((!up&&node.firstChild)||node.nextSibling||node.parentNode);if(!_186||_186===_183){break;}prev=node;node=_186;}if(_185){return;}return ret;};function _154(_187,_188){return _187.getAttribute(_188);};var _189;function _155(){if(_189){return _189;}var dgb=document.getElementsByTagName("body");return (_189=(dgb&&dgb[0])||document.body||_153(document.documentElement||document,function(node){return node.tagName==="body";},true));};var _18a="getElementById";function _156(id){if(document[_18a]){return document[_18a](id);}else{return _153(_155(),function(node){return node&&node.id===id;},true);}};var _18b="getElementsByClassName";function _157(_18c,_18d){_18d||(_18d=document);if(typeof _18c==="string"){if(_18d[_18b]){return _142.call(_18d[_18b](_18c));}var rx=new RegExp("\\b"+_18c+"\\b");return _153(_18d,function(node){return node!==_18d&&node.className&&rx.test(node.className);});}var ret=[];for(var n=_18c.length,a=0;a<n;a++){var _18e=_18c[a];if(_18d[_18b]){ret=ret.concat(_142.call(_18d[_18b](_18e)));}else{var rx=new RegExp("\\b"+_18e+"\\b");ret=ret.concat(_153(_18d,function(node){return node!==_18d&&node.className&&rx.test(node.className);}));}}return ret;};function _158(_18f){return document.getElementsByTagName(_18f);};function _159(){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 _15a(_190,_191){if(_190.hasAttribute){return _190.hasAttribute(_191);}else{return null!=_190.getAttribute(_191);}};function _15b(_192,_193){var rx=new RegExp("\\b"+_193+"\\b");return rx.test(_192.className);};var _194;function _15c(){return _194||(_194=document.head||_158("head")[0]||_153(document,function(node){return node!==document&&/head/i.test(node.tagName);},true));};function _15d(_195){_195||(_195="alp");var _196=null;while(true){var _197=_195+(_196==null?"":_196);if(!alp.gEBI(_197)){return _197;}if(_196==null){_196=0;}else{_196++;}}};function _15e(_198){_147.push(_198);_14a();};function _15f(_199){var arr="parentNode" in _199?[_199]:_199;for(var a=arr.length;a--;){var node=arr[a],p=node.parentNode;if(p){p.removeChild(node);}}};var _19a=0,_19b=1,_19c=2,_19d=3,_19e={first:_19a,last:_19b,before:_19c,after:_19d};function _160(_19f,ref,_1a0){_1a0||(_1a0="first");var arr="parentNode" in _19f?[_19f]:_19f,pos=_19e[_1a0.toLowerCase()];for(var n=arr.length,a=0;a<n;a++){var node=arr[a];if(pos===_19b||(pos===_19a&&!ref.firstChild)){ref.appendChild(node);}else{if(pos===_19a){ref.insertBefore(node,ref.firstChild);}else{if(pos===_19c){ref.parentNode.insertBefore(node,ref);}else{if(pos===_19d){if(ref.nextSibling){ref.parentNode.insertBefore(node,ref.nextSibling);}else{ref.parentNode.appendChild(node);}}else{throw new Error("alp.place(): unknown position string \""+_1a0+"\". Please use \"first\", \"last\", \"before\" or \"after\".");}}}}}};function _161(node){if(_144||!alp.likeIE9plus()){return;}if(!node||node===window||!("tagName" in node&&"style" in node)){return;}if(alp.util&&alp.util.asyncHitch){alp.util.asyncHitch(_1a1,null,37)();}else{setTimeout(_1a1,37);}function _1a1(){var _1a2=node.style.visibility;node.style.visibility="hidden";node.offsetWidth;node.offsetHeight;node.style.visibility=_1a2;node.offsetWidth;node.offsetHeight;};};function _162(_1a3,_1a4){_1a3.removeAttribute(_1a4);};function _163(_1a5,_1a6,_1a7){if(arguments.length>2){_1a5.setAttribute(_1a6,""+_1a7);}else{for(var k in _1a6){if(!(k in _143)){_1a5.setAttribute(k,""+_1a6[k]);}}}};function _164(_1a8,_1a9,_1aa){if(arguments.length>2){_1a8[_1a9]=_1aa;}else{for(var k in _1a9){if(!(k in _143)){_1a8[k]=_1a9[k];}}}};function _165(_1ab,_1ac,_1ad){var obj;if(arguments.length>2){obj={};obj[_1ac]=_1ad;}else{obj=_1ac;}var s=_1ab.className,_1ae=s;for(var k in obj){if(!(k in _143)){var rx=new RegExp("\\b"+k+"\\b","g");if(obj[k]){if(!rx.test(_1ae)){_1ae+=" "+k;}}else{_1ae=_1ae.replace(rx,"");}}}_1ae=_1ae.replace(/(^\s+|\s+$)/g,"");if(_1ae!=s){_1ab.className=_1ae;}};function _14a(){if(_146){while(_147.length){try{_147.shift()();}finally{_14a();}}}};})();}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(_1af){return function(){dojo.query("#filterOptionsWrapper").forEach(function(node){if(!_1af(node)){closeSelectBox();}dojo.style(node,{display:_1af(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(_1b0){closeSelectBox();};dojo.global.switchSelectBox=(function(_1b1){return function(el,_1b2){var sb=dojo.byId(_1b2);if(!sb){console.error("switchSelectBox did not find the DOM node with id: "+_1b2);return;}var _1b3=_1b1(sb);closeSelectBox();if(_1b3){return;}var _1b4=topPos(el);var _1b5=leftPos(el);sb.style.top=(_1b4+21)+"px";sb.style.left=(_1b5)+"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(_1b6).next(_1b7).next(_1b8).nextHitch(ret,"callback",true);return ret;function _1b6(_1b9){alp.util.getDfrd("Shadowbox.init").then(_1b9);};function _1b7(_1ba){Shadowbox.init(cfg);_1ba();};function _1b8(_1bb){alp.util.getDfrd(function(){return (true===Shadowbox.isLoaded)||undefined;}).then(_1bb);};};})();}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(_1bc){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(_1bd,anos){return anos.hastour[_1bd];}});}};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"]});}});}if(typeof dojo==="undefined"||!dojo._hasResource["oa_v2.misc"]){typeof dojo==="undefined"||(dojo._hasResource["oa_v2.misc"]=true);dojo.provide("oa_v2.misc");}dojo.i18n._preloadLocalizations("oa_v2.nls.misc",["ROOT","de","de-de","en","en-gb","en-nz","en-us","fr","it","nl","xx"]);

