var Novajax={Version:"1.1",Build:"58",voidString:"javascript:void(0)",_ajaxErrorHandler:false,defaultAjaxErrorHandler:function(A,C,B){Novajax.handleError("Ajax.Request",['Fehler beim Laden von "'+A+'".',"HTTP-Status: "+C.status+" ("+C.statusText+")",new Date()].join("\n"))},handleError:function(C,B){var A=B.message?B.message:B;alert(["Es ist ein Problem aufgetreten.",'Quelle: "'+C+'"',"Nachricht: "+A].join("\n"))},getAjaxErrorHandler:function(A,B){if(this._ajaxErrorHandler){return this._ajaxErrorHandler.bind(this,A)}else{return Novajax.defaultAjaxErrorHandler.bind(Novajax,A)}},setAjaxErrorHandler:function(A){this._ajaxErrorHandler=A}};var XML_NS={XSI:"http://www.w3.org/2001/XMLSchema-instance",XLINK:"http://www.w3.org/1999/xlink",SVG:"http://www.w3.org/2000/svg",GML:"http://www.opengis.net/gml",WFS:"http://www.opengis.net/wfs",OGC:"http://www.opengis.net/ogc",NOVASIB:"http://www.novasib.de"};Novajax.Validator={minLength:function(A){return{validate:function(B){return B!=null&&B.length>=A},getText:function(){return"Mindestlänge: "+A}}},isInteger:function(){return{validate:function(A){return isNaN(parseInt(A))==false},getText:function(){return"Muss eine Zahl sein."}}},isValidDate:function(A){return{format:A,validate:function(B){return B.isValidDate(this.format)},getText:function(){return"Format: "+this.format}}}};Novajax.Abstract={};Novajax.Abstract.Pool=Class.create({initialize:function(){this._objs=[]},requestObject:function(){if(this._objs.length==0){return this.createObject()}return this._objs.pop()},releaseObject:function(A){this._objs.push(A)}});Novajax.Comparator={_isWhitespaceChar:function(A){return A.charCodeAt(0)<=32},_isDigitChar:function(A){var B=A.charCodeAt(0);return B>=48&&B<=57},_compareRight:function(E,B){var G=0;var F=0;var D=0;var C;var A;for(;;F++,D++){C=E.charAt(F);A=B.charAt(D);if(!this._isDigitChar(C)&&!this._isDigitChar(A)){return G}else{if(!this._isDigitChar(C)){return -1}else{if(!this._isDigitChar(A)){return +1}else{if(C<A){if(G==0){G=-1}}else{if(C>A){if(G==0){G=+1}}else{if(C==0&&A==0){return G}}}}}}}},natural:function(){return(function(H,G){var D=0,B=0;var C=0,A=0;var F,E;var I;while(true){C=A=0;F=H.charAt(D);E=G.charAt(B);while(this._isWhitespaceChar(F)||F=="0"){if(F=="0"){C++}else{C=0}F=H.charAt(++D)}while(this._isWhitespaceChar(E)||E=="0"){if(E=="0"){A++}else{A=0}E=G.charAt(++B)}if(this._isDigitChar(F)&&this._isDigitChar(E)){if((I=this._compareRight(H.substring(D),G.substring(B)))!=0){return I}}if(F==0&&E==0){return C-A}if(F<E){return -1}else{if(F>E){return +1}}++D;++B}}).bind(this)},number:function(){return(function(B,A){if(!B&&!B){return 0}if(!B){return -1}if(!A){return 1}return B-A}).bind(this)}};Object.wrap=function(A,B,D){var C=A[B];A[B]=function(){D.apply(A,arguments);C.apply(A,arguments)}};var $D=function(A){return(A?A.ownerDocument:null)||document};Object.extend(location,{getParameter:function(B,A){var C=new RegExp("[?|&]"+B+"=([^&]+)");var D;if(D=C.exec(location.search)){return D[1]}return A},absoluteUrl:function(B){if(B.startsWith("http://")||B.startsWith("https://")){return B}var A=location.protocol+"//"+location.host;if(!B.startsWith("/")){A+=location.pathname;A=A.substring(0,A.lastIndexOf("/"))+"/"}return A+B}});Object.extend(Date.prototype,{getWeek:function(D){D=Number(D)==NaN?0:D;var C=new Date(this.getFullYear(),0,1);var A=C.getDay()-D;A=(A>=0?A:A+7);var B=Math.floor((this.getTime()-C.getTime()-(this.getTimezoneOffset()-C.getTimezoneOffset())*60000)/86400000)+1;var E;if(A<4){E=Math.floor((B+A-1)/7)+1;if(E>52){nYear=new Date(this.getFullYear()+1,0,1);nday=nYear.getDay()-D;nday=nday>=0?nday:nday+7;E=nday<4?1:53}}else{E=Math.floor((B+A-1)/7)}return E},formatSpokenDate:function(C,B){B=B||C;var A=(new Date()).clearTime();var D=(new Date(this)).clearTime();var E=A.diff("d",D);switch(E){case 0:return"Heute";case 1:return"Gestern"}if(E<=90){switch(A.getWeek(1)-D.getWeek(1)){case 0:return D.getDayName();case 1:return"Letzte Woche";case 2:return"Vorletzte Woche";case 3:return"Vorvorletzte Woche"}switch(A.diff("M",D)){case 0:return"Diesen Monat";case 1:return"Letzten Monat"}}if(A.getYear()==D.getYear()){return this.format(C)}else{return this.format(B)}},formatSpokenTime:function(){var A=new Date();var C=new Date(this);var B=Math.floor(A.diff("h",this));if(B<1){return""}if(B==1){return"Älter als eine Stunde"}if(B<10){return"Älter als "+B+" Stunden"}B=A.clearTime().diff("d",C.clearTime());switch(B){case 0:return"Älter";case 1:return this.format("HH:00");default:return""}},diff:function(A,B){if(typeof (A)=="undefined"||A==null||B==null){return 0}if(A=="y"){return this.getFullYear()-B.getFullYear()}else{if(A=="M"){return this.getMonth()-B.getMonth()}else{if(A=="d"){return(this-B)/1000/60/60/24}else{if(A=="h"){return(this-B)/1000/60/60;return this.getHours()-B.getHours()}else{if(A=="m"){return(this-B)/1000/60;return this.getMinutes()-B.getMinutes()}else{if(A=="s"){return(this-B)/1000}}}}}}return 0}});Object.extend(Number.prototype,{toLeadingZero:function(B){var A=""+this;while(A.length<B){A="0"+A}return A},toNumberFormat:function(B,E,A){B=typeof B=="undefined"?2:B;E=typeof E=="undefined"?",":E;A=typeof A=="undefined"?".":A;var F=Math.floor(this);var G=""+F;var D="";while(G.length>3){D=A+G.substr(G.length-3,G.length)+D;G=G.substr(0,G.length-3)}D=G+D;var C="";if(B>0){C=""+this.toFixed(B);C=E+C.substring(C.length-B)}return D+C},toRad:function(){return this*Math.PI/180}});Object.extend(String,{PLACEHOLDER_REGEX:/\{([^\}]+)\}/g,LTRIM_REGEX:/^\s+/,RTRIM_REGEX:/\s+$/,BASE_DIGITS:"0123456789ABCDEF"});Object.extend(String.prototype,{wordwrap:function(B,A){B=B?B:75;A=A?A:"\n";if(this.length<=B){return this}return this.substring(0,B)+A+this.substring(B).wordwrap(B,A)},parseDate:function(A){return Date.parseString(this,A)},isValidDate:function(A){return this.parseDate(A)!=null},addXMLHeader:function(A){A=A||"UTF-8";return'<?xml version="1.0" encoding="'+A+'"?>'+this},startsWith:function(A){return this.indexOf(A)==0},getPlaceholderNames:function(){var A=[];while(m=String.PLACEHOLDER_REGEX.exec(this)){A.push(m[1])}return A},replacePlaceholder:function(A){var B=""+this;while(m=String.PLACEHOLDER_REGEX.exec(this)){B=B.replace(m[0],A(m[1]))}return B},convertBase:function(F,B){var E=0,D=1,A="";for(var C=this.length-1;C>=0;--C){E+=String.BASE_DIGITS.indexOf(this.substring(C,C+1))*D;D*=F}while(E>0){A=String.BASE_DIGITS.charAt(E%B)+A;E=Math.floor(E/B)}return A.length==0?"0":A},bin2hex:function(){return this.convertBase(2,16)},lTrim:function(){return this.replace(String.LTRIM_REGEX,"")},rTrim:function(){return this.replace(String.RTRIM_REGEX,"")},trim:function(){return this.lTrim().rTrim()}});Object.extend(Array.prototype,{add:function(A,C){var D=[];for(var B=0;B<A;B++){D.push(this.shift())}D.push(C);return D.concat(this)},addAll:function(A,C){var D=[];for(var B=0;B<A;B++){D.push(this.shift())}D=D.concat(C);return D.concat(this)}});Object.extend(Object,{observers:false,_observeAndCache:function(C,B,A){if(!this.observers){this.observers=[]}this.observers.push([C,B,A]);this._addEventListener(C,B,A)},unloadCache:function(){if(!Object.observers){return }for(var A=0,B=Object.observers.length;A<B;A++){Object.stopObserving.apply(this,Object.observers[A]);Object.observers[A][0]=null}Object.observers=false},observe:function(C,B,A,D){A=A.bind(D);Object._observeAndCache(C,B,A)},observeOnce:function(C,B,A){A=A.wrap(function(E){var D=$A(arguments);D.shift();E.apply(null,D);Object.stopObserving(C,B,A)});Object.observe(C,B,A)},stopObserving:function(C,B,A){Object._removeEventListener(C,B,A)},fireEvent:function(C,B){var A=$A(arguments);var C=A.shift();var B=A.shift();if(!C.__observers__){return }if(!C.__observers__[B]){C.__observers__[B]=[]}C.__observers__[B].each(function(D){D.apply(C,A)})},_addEventListener:function(C,B,A){if(!C.__observers__){C.__observers__={}}if(!C.__observers__[B]){C.__observers__[B]=[]}C.__observers__[B].push(A)},_removeEventListener:function(D,C,B){if(!D.__observers__){return }if(!D.__observers__[C]){return }var A=D.__observers__[C];D.__observers__[C]=A.reject(function(E){return E==B})}});Object.fire=Object.fireEvent;if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Object.unloadCache,false)}Object.extend(Event,{observeOnce:function(B,A,C){C=C.wrap(function(E){var D=$A(arguments);D.shift();E.apply(null,D);Event.stopObserving(B,A,C)});Event.observe(B,A,C)}});ElementUserObjects=Class.create({id:"",initialize:function(){this.id="a"+new Date().getMilliseconds()},set:function(B,A){B[this.id]=A},get:function(A){return A[this.id]},destroy:function(A){var C=this.get(A);if(C&&typeof (C.destroy)=="function"){C.destroy()}try{delete A[this.id]}catch(B){A[this.id]==null}}});Object.extend(Element,{isDisplayed:function(A){while(A){try{if(Element.getStyle(A,"display")=="none"){return false}}catch(B){}finally{A=A.parentNode}}return true}});Form.Element.Unserializers={input:function(B,C){switch(B.type.toLowerCase()){case"checkbox":case"radio":var D=$D(B).getElementsByName(B.name);for(var A=0;A<D.length;A++){if(D[A].value==C){D[A].checked=true;break}}break;default:B.value=C}},textarea:function(A,B){A.value=B},select:function(A,B){return Form.Element.Unserializers[A.type=="select-one"?"selectOne":"selectMany"](A,B)},selectOne:function(C,D){for(var B=0;B<C.length;B++){var A=C.options[B];if(A.value==D){A.selected=true;return }}},selectMany:function(D,E){for(var C=0;C<D.length;C++){var B=D.options[C];for(var A=0;A<E.length;A++){if(B.value==E[C]){B.selected=true;return }}}}};Object.extend(Form.Element,{setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();if(!Form.Element.Unserializers[C]){alert('"'+C+'" ist nicht in Form.Element.Unserializers implementiert.')}else{Form.Element.Unserializers[C](A,B)}},setEnabled:function(B,A){if(A){Form.Element.enable(B)}else{Form.Element.disable(B)}}});Object.extend(Form.Element.Serializers,{input:function(C){switch(C.type.toLowerCase()){case"checkbox":var A=[];var D=$D(C).getElementsByTagName("input");for(var B=0;B<D.length;B++){if(D[B].name==C.name&&D[B].checked){A.push(D[B].value)}}return A;case"radio":var D=$D(C).getElementsByName(C.name);for(var B=0;B<D.length;B++){if(D[B].checked){return D[B].value}}return null;default:return Form.Element.Serializers.textarea(C)}}});NXML=DOMExtensions={eachChildNode:function(C,B){for(var A=C.firstChild;A;A=A.nextSibling){B(A)}},eachElementNode:function(C,B){for(var A=C.firstChild;A;A=A.nextSibling){if(A.nodeType==Node.ELEMENT_NODE){B(A)}}},eachElementFromNodeList:function(A,E,C){E=E.bind(C);for(var B=0,F=A.length;B<F;B++){var D=A.item(B);if(D.nodeType==Node.ELEMENT_NODE){E(D)}}},nodeListToArray:function(B){var A=[];for(var C=0,D=B.length;C<D;C++){A.push(B.item(C))}return A},eachNamedNode:function(C,D,B){for(var A=C.firstChild;A;A=A.nextSibling){if(A.nodeName==D){B(A)}}},getFirstElementNode:function(B){for(var A=B.firstChild;A;A=A.nextSibling){if(A.nodeType==Node.ELEMENT_NODE){return A}}},getAttributeAsFloat:function(C,A,B){var D=C.getAttribute(A);return(D&&(""+D).length>0)?parseFloat(D):B},getAttributeAsInt:function(C,A,B){var D=C.getAttribute(A);return(D&&(""+D).length>0)?parseInt(D):B},appendTextChild:function(B,A,C){B.appendChild($D(B).createElement(A)).appendChild($D(B).createTextNode(C))},getNodeText:function(A){return A&&A.text?A.text:""},getText:function(C){if(!C){return false}var A="";for(var B=C.firstChild;B;B=B.nextSibling){if(B.nodeType==Node.TEXT_NODE||B.nodeType==Node.CDATA_SECTION_NODE){A+=B.data}}return A}};var Base64={_64s:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",encode:function(A){var C;var E;var B=0;var D="";while(A.length>=B+3){C=(A.charCodeAt(B++)&255)<<16|(A.charCodeAt(B++)&255)<<8|A.charCodeAt(B++)&255;D+=Base64._64s.charAt((C&16515072)>>18)+Base64._64s.charAt((C&258048)>>12)+Base64._64s.charAt((C&4032)>>6)+Base64._64s.charAt((C&63))}if(A.length-B>0&&A.length-B<3){E=Boolean(A.length-B-1);C=((A.charCodeAt(B++)&255)<<16)|(E?(A.charCodeAt(B)&255)<<8:0);D+=Base64._64s.charAt((C&16515072)>>18)+Base64._64s.charAt((C&258048)>>12)+(E?Base64._64s.charAt((C&4032)>>6):"=")+"="}return(D)},decode:function(A){var D;var B="";for(var C=0;C<A.length;C+=4){D=(Base64._64s.indexOf(A.charAt(C))&255)<<18|(Base64._64s.indexOf(A.charAt(C+1))&255)<<12|(Base64._64s.indexOf(A.charAt(C+2))&255)<<6|Base64._64s.indexOf(A.charAt(C+3))&255;B+=String.fromCharCode((D&16711680)>>16,(D&65280)>>8,D&255)}if(A.charCodeAt(C-2)==61){return(B.substring(0,B.length-2))}else{if(A.charCodeAt(C-1)==61){return(B.substring(0,B.length-1))}else{return(B)}}}};Element.ResizeObserver=Class.create({getValue:function(){return Element.getDimensions(this.element)},onTimerEvent:function(){var A=this.getValue();if(this.lastValue.width!=A.width||this.lastValue.height!=A.height){this.callback(this.element,A);this.lastValue=A}}});if(!Window){var Window={}}Window=Object.extend(Window,{getDimensions:function(){if(typeof (window.innerWidth)=="number"){return{width:window.innerWidth,height:window.innerHeight}}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return{width:document.body.clientWidth,height:document.body.clientHeight}}}}throw"size of window could not determined"}});Window.ResizeObserver=Class.create(Abstract.TimedObserver,{getValue:function(){return Window.getDimensions()},destroy:function(){},onTimerEvent:function(){var A=this.getValue();if(this.lastValue.width!=A.width||this.lastValue.height!=A.height){this.callback(this.element,A);this.lastValue=A}}});if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])<1.6){throw ("Novajax requires the Prototype JavaScript framework >= 1.6.0")};
