if(Function.prototype.bind==null)Function.prototype.bind=function(a){var b=this;return function(){return b.apply(a,arguments)}};typeof Wicket=="undefined"&&(Wicket={});Wicket.$=function(a){if(a==null||typeof a=="undefined")return null;if(arguments.length>1){for(var b=[],d=0;d<arguments.length;d++)b.push(Wicket.$(arguments[d]));return b}else return typeof a=="string"?document.getElementById(a):a};
Wicket.$$=function(a){typeof a=="string"&&(a=Wicket.$(a));if(a==null||typeof a=="undefined"||a.tagName==null||typeof a.tagName=="undefined")return!0;var b=a.getAttribute("id");return typeof b=="undefined"||b==null||b==""?a.ownerDocument==document:document.getElementById(b)==a};Wicket.isPortlet=function(){return Wicket.portlet==!0};Wicket.emptyFunction=function(){};Wicket.Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};
if(typeof DOMParser=="undefined"&&Wicket.Browser.isSafari())DOMParser=function(){},DOMParser.prototype.parseFromString=function(){alert("You are using an old version of Safari.\nTo be able to use this page you need at least version 2.0.1.")};Wicket.Log={enabled:function(){return wicketAjaxDebugEnabled()},info:function(a){Wicket.Log.enabled()&&WicketAjaxDebug.logInfo(a)},error:function(a){Wicket.Log.enabled()&&WicketAjaxDebug.logError(a)},log:function(a){Wicket.Log.enabled()&&WicketAjaxDebug.log(a)}};
Wicket.FunctionsExecuter=Wicket.Class.create();Wicket.FunctionsExecuter.prototype={initialize:function(a){this.functions=a;this.depth=this.current=0},processNext:function(){if(this.current<this.functions.length){var a=this.functions[this.current],b=function(){a(this.notify.bind(this))}.bind(this);this.current++;this.depth>50||Wicket.Browser.isKHTML()||Wicket.Browser.isSafari()?(this.depth=0,window.setTimeout(b,1)):(this.depth++,b())}},start:function(){this.processNext()},notify:function(){this.processNext()}};
Wicket.replaceOuterHtmlIE=function(a,b){function d(a){for(var b=/<\s*iframe/i;(m=a.match(b))!=null;)a=Wicket.replaceAll(a,m[0],"<"+g+m[0].substring(1));return a}function c(a){return Wicket.replaceAll(a,g,"")}var g="__WICKET_JS_REMOVE_X9F4A__";if(a.tagName=="SCRIPT"){var e=document.createElement("div");e.innerHTML="<table>"+b+"</table>";e=e.childNodes[0].childNodes[0].innerHTML;a.outerHtml=b;try{eval(e)}catch(h){Wicket.Log.error(h)}}else{var n=a.parentNode,j=a.tagName,e=document.createElement("div"),
o=[];(window.parent==window||window.parent==null)&&document.body.appendChild(e);if(j!="TBODY"&&j!="TR"&&j!="TD"&&j!="THEAD"&&j!="TFOOT"&&j!="TH"){e.innerHTML='<table style="display:none">'+d(b)+"</table>";for(var l=e.getElementsByTagName("script"),k=0;k<l.length;++k)o.push(l[k]);e.innerHTML='<div style="display:none">'+b+"</div>";j=e.childNodes[0];j.parentNode.removeChild(j)}else{e.innerHTML='<div style="display:none">'+d(b)+"</div>";l=e.getElementsByTagName("script");for(k=0;k<l.length;++k)o.push(l[k]);
e.innerHTML='<table style="display: none">'+b+"</table>";j=e.getElementsByTagName(j).item(0).parentNode}for(;j.childNodes.length>0;)l=j.childNodes[0],j.removeChild(l),n.insertBefore(l,a),l=null;n.removeChild(a);a=a.outerHTML="";(window.parent==window||window.parent==null)&&document.body.removeChild(e);e.outerHTML="";j=e=n=null;for(k=0;k<o.length;++k)Wicket.Head.addJavascripts(o[k],c)}};
Wicket.replaceOuterHtmlSafari=function(a,b){if(a.tagName=="SCRIPT"){var d=document.createElement("div");d.innerHTML=b;var c=d.childNodes[0].innerHTML;if(typeof c!="string")c=d.childNodes[0].text;a.outerHTML=b;try{eval(c)}catch(g){Wicket.Log.error("Wicket.replaceOuterHtmlSafari: "+g+": eval -> "+c)}}else{d=a.parentNode;for(c=a.nextSibling;c!==null&&c.nodeType==3;)c=c.nextSibling;for(var e=0;d.childNodes[e]!=a;)++e;a.outerHTML=b;for(a=d.childNodes[e];a!=c;){try{Wicket.Head.addJavascripts(a)}catch(h){}a=
a.nextSibling}}};Wicket.replaceOuterHtml=function(a,b){if(Wicket.Browser.isIE())Wicket.replaceOuterHtmlIE(a,b);else if(Wicket.Browser.isSafari()||Wicket.Browser.isOpera())Wicket.replaceOuterHtmlSafari(a,b);else{var d=a.ownerDocument.createRange();d.selectNode(a);d=d.createContextualFragment(b);a.parentNode.replaceChild(d,a)}};Wicket.decode=function(a,b){if(a=="wicket1")return Wicket.decode1(b)};Wicket.decode1=function(a){return Wicket.replaceAll(a,"]^","]")};
Wicket.replaceAll=function(a,b,d){for(var c=a.indexOf(b);c>-1;)a=a.replace(b,d),c=a.indexOf(b);return a};Wicket.Form={};Wicket.Form.encode=function(a){return encodeURIComponent?encodeURIComponent(a):escape(a)};Wicket.Form.serializeSelect=function(a){if(a.multiple==!1)return Wicket.Form.encode(a.name)+"="+Wicket.Form.encode(a.value)+"&";for(var b="",d=0;d<a.options.length;++d){var c=a.options[d];c.selected&&(b+=Wicket.Form.encode(a.name)+"="+Wicket.Form.encode(c.value)+"&")}return b};
Wicket.Form.serializeInput=function(a){var b=a.type.toLowerCase();return(b=="checkbox"||b=="radio")&&a.checked?Wicket.Form.encode(a.name)+"="+Wicket.Form.encode(a.value)+"&":b=="text"||b=="password"||b=="hidden"||b=="textarea"||b=="search"?Wicket.Form.encode(a.name)+"="+Wicket.Form.encode(a.value)+"&":""};Wicket.Form.excludeFromAjaxSerialization={};
Wicket.Form.serializeElement=function(a){if(Wicket.Form.excludeFromAjaxSerialization&&a.id&&Wicket.Form.excludeFromAjaxSerialization[a.id]=="true")return"";var b=a.tagName.toLowerCase();return b=="select"?Wicket.Form.serializeSelect(a):b=="input"||b=="textarea"?Wicket.Form.serializeInput(a):""};Wicket.Form.doSerialize=function(a){for(var b="",d=0;d<a.elements.length;++d){var c=a.elements[d];c.name&&c.name!=""&&!c.disabled&&(b+=Wicket.Form.serializeElement(c))}return b};
Wicket.Form.serialize=function(a,b){if(a.tagName.toLowerCase()=="form")return Wicket.Form.doSerialize(a);else{var d=a;if(b!=!0){do a=a.parentNode;while(a.tagName.toLowerCase()!="form"&&a.tagName.toLowerCase()!="body")}if(a.tagName.toLowerCase()=="form")return Wicket.Form.doSerialize(a);else{var c=document.createElement("form"),g=d.parentNode;g.replaceChild(c,d);c.appendChild(d);var e=Wicket.Form.doSerialize(c);g.replaceChild(d,c);return e}}};Wicket.DOM={};
Wicket.DOM.serializeNodeChildren=function(a){if(a==null)return"";for(var b="",d=0;d<a.childNodes.length;d++){var c=a.childNodes[d];switch(c.nodeType){case 1:case 5:b+=Wicket.DOM.serializeNode(c);break;case 8:b+="<\!--"+c.nodeValue+"--\>";break;case 4:b+="<![CDATA["+c.nodeValue+"]]\>";break;case 3:case 2:b+=c.nodeValue}}return b};
Wicket.DOM.serializeNode=function(a){if(a==null)return"";var b="";b+="<"+a.nodeName;if(a.attributes&&a.attributes.length>0)for(var d=0;d<a.attributes.length;d++)b+=" "+a.attributes[d].name+'="'+a.attributes[d].value+'"';b+=">";b+=Wicket.DOM.serializeNodeChildren(a);b+="</"+a.nodeName+">";return b};Wicket.DOM.containsElement=function(a){a=a.getAttribute("id");return a!=null?Wicket.$(a)!=null:!1};Wicket.Channel=Wicket.Class.create();
Wicket.Channel.prototype={initialize:function(a){a=a.match(/^([^|]+)\|(d|s)$/);this.type=a==null?"s":a[2];this.callbacks=[];this.busy=!1},schedule:function(a){return this.busy==!1?(this.busy=!0,a()):(Wicket.Log.info("Channel busy - postponing..."),this.type=="s"?this.callbacks.push(a):this.callbacks[0]=a,null)},done:function(){var a=null;this.callbacks.length>0&&(a=this.callbacks.shift());a!=null&&typeof a!="undefined"?(Wicket.Log.info("Calling posponed function..."),window.setTimeout(a,1)):this.busy=
!1}};Wicket.ChannelManager=Wicket.Class.create();Wicket.ChannelManager.prototype={initialize:function(){this.channels=[]},schedule:function(a,b){var d=this.channels[a];d==null&&(d=new Wicket.Channel(a),this.channels[a]=d);return d.schedule(b)},done:function(a){a=this.channels[a];a!=null&&a.done()}};Wicket.channelManager=new Wicket.ChannelManager;
Wicket.Ajax={createTransport:function(){var a=null;window.ActiveXObject?(a=new ActiveXObject("Microsoft.XMLHTTP"),Wicket.Log.info("Using ActiveX transport")):window.XMLHttpRequest&&(a=new XMLHttpRequest,Wicket.Log.info("Using XMLHttpRequest transport"));a==null&&Wicket.Log.error("Could not locate ajax transport. Your browser does not support the required XMLHttpRequest object or wicket could not gain access to it.");return a},transports:[],getTransport:function(){for(var a=Wicket.Ajax.transports,
b=0;b<a.length;++b)if(a[b].readyState==0)return a[b];a.push(Wicket.Ajax.createTransport());return a[a.length-1]},preCallHandlers:[],postCallHandlers:[],failureHandlers:[],registerPreCallHandler:function(a){Wicket.Ajax.preCallHandlers.push(a)},registerPostCallHandler:function(a){Wicket.Ajax.postCallHandlers.push(a)},registerFailureHandler:function(a){Wicket.Ajax.failureHandlers.push(a)},invokePreCallHandlers:function(){var a=Wicket.Ajax.preCallHandlers;a.length>0&&Wicket.Log.info("Invoking pre-call handler(s)...");
for(var b=0;b<a.length;++b)a[b]()},invokePostCallHandlers:function(){var a=Wicket.Ajax.postCallHandlers;a.length>0&&Wicket.Log.info("Invoking post-call handler(s)...");for(var b=0;b<a.length;++b)a[b]()},invokeFailureHandlers:function(){var a=Wicket.Ajax.failureHandlers;a.length>0&&Wicket.Log.info("Invoking failure handler(s)...");for(var b=0;b<a.length;++b)a[b]()}};Wicket.Ajax.Request=Wicket.Class.create();
Wicket.Ajax.Request.prototype={initialize:function(a,b,d,c,g,e){this.url=a;this.loadedCallback=b;this.parseResponse=d!=null?d:!0;this.randomURL=c!=null?c:!0;this.failureHandler=g!=null?g:function(){};this.async=!0;this.channel=e;this.precondition=function(){return!0};this.suppressDone=!1;this.instance=Math.random();this.debugContent=!0},done:function(){Wicket.channelManager.done(this.channel)},createUrl:function(){return this.randomURL==!1?this.url:this.url+(this.url.indexOf("?")>-1?"&":"?")+"random="+
Math.random()},log:function(a,b){var d=Wicket.Log.info;d("");d("Initiating Ajax "+a+" request on "+b)},failure:function(){this.failureHandler();Wicket.Ajax.invokePostCallHandlers();Wicket.Ajax.invokeFailureHandlers()},get:function(){if(Wicket.isPortlet()){var a=this.url.indexOf("?");a==-1&&(a=this.url.indexOf("&"));if(a>-1){var b=this.url.substring(a+1);if(b&&b.length>0)return this.url=this.url.substring(0,a),b.charAt(b.length-1)!="&"&&(b+="&"),this.post(b)}}return this.channel!=null?(a=Wicket.channelManager.schedule(this.channel,
this.doGet.bind(this)),a!=null?a:!0):this.doGet()},doGet:function(){if(this.precondition()){this.transport=Wicket.Ajax.getTransport();var a=this.createUrl();this.log("GET",a);Wicket.Ajax.invokePreCallHandlers();var b=this.transport;return b!=null?(b.open("GET",a,this.async),b.onreadystatechange=this.stateChangeCallback.bind(this),b.setRequestHeader("Wicket-Ajax","true"),typeof Wicket.Focus.lastFocusId!="undefined"&&Wicket.Focus.lastFocusId!=""&&Wicket.Focus.lastFocusId!=null&&b.setRequestHeader("Wicket-FocusedElementId",
Wicket.Focus.lastFocusId),b.setRequestHeader("Accept","text/xml"),b.send(null),!0):(this.failure(),!1)}else return Wicket.Log.info("Ajax GET stopped because of precondition check, url:"+this.url),this.done(),!0},post:function(a){if(this.channel!=null){var b=Wicket.channelManager.schedule(this.channel,function(){this.doPost(a)}.bind(this));return b!=null?b:!0}else return this.doPost(a)},doPost:function(a){if(this.precondition()){this.transport=Wicket.Ajax.getTransport();var b=this.createUrl();this.log("POST",
b);Wicket.Ajax.invokePreCallHandlers();var d=this.transport;return d!=null?(typeof a=="function"&&(a=a()),d.open("POST",b,this.async),d.onreadystatechange=this.stateChangeCallback.bind(this),d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.setRequestHeader("Wicket-Ajax","true"),typeof Wicket.Focus.lastFocusId!="undefined"&&Wicket.Focus.lastFocusId!=""&&Wicket.Focus.lastFocusId!=null&&d.setRequestHeader("Wicket-FocusedElementId",Wicket.Focus.lastFocusId),d.setRequestHeader("Accept",
"text/xml"),d.send(a),!0):(this.failure(),!1)}else return Wicket.Log.info("Ajax POST stopped because of precondition check, url:"+this.url),this.done(),!0},stateChangeCallback:function(){var a=this.transport,b;if(a!=null&&a.readyState==4){try{b=a.status}catch(d){Wicket.Log.error("Exception evaluating AJAX status: "+d),b="unavailable"}if(b==200||b==""){b=a.responseText;var c;try{c=a.getResponseHeader("Ajax-Location")}catch(g){}if(typeof c!="undefined"&&c!=null&&c!="")if(a.onreadystatechange=Wicket.emptyFunction,
this.done(),c.charAt(0)=="/"||c.match("^http://")=="http://"||c.match("^https://")=="https://")window.location=c;else{for(var e=0;c.substring(0,3)=="../";)e++,c=c.substring(3);for(b=window.location.pathname;e>-1;)e--,i=b.lastIndexOf("/"),i>-1&&(b=b.substring(0,i));b+="/"+c;Wicket.Browser.isGecko()&&(b=window.location.protocol+"//"+window.location.host+b);window.location=b}else{c=Wicket.Log.info;c("Received ajax response ("+b.length+" characters)");this.debugContent!=!1&&c("\n"+b);if(this.parseResponse==
!0){if(typeof window.XMLHttpRequest!="undefined"&&typeof DOMParser!="undefined")e=(new DOMParser).parseFromString(b,"text/xml");else if(window.ActiveXObject)e=a.responseXML;this.loadedCallback(e)}else this.loadedCallback(b);this.suppressDone==!1&&this.done()}}else c=Wicket.Log.error,c("Received Ajax response with code: "+b),b==500&&c("500 error had text: "+a.responseText),this.done(),this.failure();a.onreadystatechange=Wicket.emptyFunction;a.abort();this.transport=null}}};Wicket.Ajax.Call=Wicket.Class.create();
Wicket.Ajax.Call.prototype={initialize:function(a,b,d,c){this.successHandler=b!=null?b:function(){};this.failureHandler=d!=null?d:function(){};this.request=new Wicket.Ajax.Request(a,this.loadedCallback.bind(this),!0,!0,d,c!=null?c:"0|s");this.request.suppressDone=!0},failure:function(a){a!=null&&Wicket.Log.error("Error while parsing response: "+a);this.request.done();this.failureHandler();Wicket.Ajax.invokePostCallHandlers();Wicket.Ajax.invokeFailureHandlers()},call:function(){return this.request.get()},
post:function(a){return this.request.post(a)},submitForm:function(a,b){return this.request.post(function(){var d=Wicket.Form.serialize(a);b!=null&&(d+=Wicket.Form.encode(b)+"=1");return d})},submitFormById:function(a,b){var d=Wicket.$(a);(d==null||typeof d=="undefined")&&Wicket.Log.error("Trying to submit form with id '"+a+"' that is not in document.");return this.submitForm(d,b)},loadedCallback:function(a){try{var b=a.getElementsByTagName("ajax-response")[0];if(b==null||b.tagName!="ajax-response")this.failure("Could not find root <ajax-response> element");
else{a=[];a.push(function(a){window.setTimeout(a,2)}.bind(this));if(Wicket.Browser.isKHTML())a.push=function(a){a(function(){})};for(var d=-1,c=0;c<b.childNodes.length;++c){var g=b.childNodes[c];g.tagName=="component"?(d==-1&&this.processFocusedComponentMark(a),d=a.length,this.processComponent(a,g)):g.tagName=="evaluate"?this.processEvaluation(a,g):g.tagName=="header-contribution"&&this.processHeaderContribution(a,g)}d!=-1&&this.processFocusedComponentReplaceCheck(a,d);this.success(a);Wicket.Browser.isKHTML()==
!1&&(Wicket.Log.info("Response parsed. Now invoking steps..."),(new Wicket.FunctionsExecuter(a)).start())}}catch(e){this.failure(e.message)}},success:function(a){a.push(function(a){Wicket.Log.info("Response processed successfully.");Wicket.Ajax.invokePostCallHandlers();Wicket.Focus.attachFocusEvent();this.request.done();this.successHandler();setTimeout("Wicket.Focus.requestFocus();",0);a()}.bind(this))},processComponent:function(a,b){a.push(function(a){var c=b.getAttribute("id"),g="";if(b.hasChildNodes())g=
b.firstChild.nodeValue;var e=b.getAttribute("encoding");e!=null&&e!=""&&(g=Wicket.decode(e,g));e=Wicket.$(c);e==null||typeof e=="undefined"?Wicket.Log.error("Component with id [["+c+"]] a was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update."):Wicket.replaceOuterHtml(e,g);a()})},processEvaluation:function(a,b){a.push(function(a){var c=b.firstChild.nodeValue,g=b.getAttribute("encoding");g!=
null&&(c=Wicket.decode(g,c));g=c.match(/^([a-z|A-Z_][a-z|A-Z|0-9_]*)\|((.|\n)*)$/);if(g!=null){c="var f = function("+g[1]+") {"+g[2]+"};";try{eval(c),f(a)}catch(e){Wicket.Log.error("Exception evaluating javascript: "+e)}}else{try{eval(c)}catch(h){Wicket.Log.error("Exception evaluating javascript: "+h)}a()}})},processHeaderContribution:function(a,b){(new Wicket.Head.Contributor).processContribution(a,b)},processFocusedComponentMark:function(a){a.push(function(a){Wicket.Focus.markFocusedComponent();
a()})},processFocusedComponentReplaceCheck:function(a,b){a.splice(b+1,0,function(a){Wicket.Focus.checkFocusedComponentReplaced();a()})}};Wicket.Head={};Wicket.Head.Contributor=Wicket.Class.create();
Wicket.Head.Contributor.prototype={initialize:function(){},parse:function(a){var b=a.firstChild.nodeValue,a=a.getAttribute("encoding");a!=null&&a!=""&&(b=Wicket.decode(a,b));Wicket.Browser.isKHTML()&&(b=b.replace(/<script/g,"<SCRIPT"),b=b.replace(/<\/script>/g,"<\/SCRIPT>"));window.ActiveXObject?(a=new ActiveXObject("Microsoft.XMLDOM"),a.loadXML(b)):a=(new DOMParser).parseFromString(b,"text/xml");return a},processContribution:function(a,b){for(var d=this.parse(b).documentElement,c=0;c<d.childNodes.length;c++){var g=
d.childNodes[c];if(g.tagName!=null){var e=g.tagName.toLowerCase();if(e=="wicket:link")for(var h=0;h<g.childNodes.length;++h){var n=g.childNodes[h];if(n.nodeType==1){g=n;e=g.tagName.toLowerCase();break}}e=="link"?this.processLink(a,g):e=="script"?this.processScript(a,g):e=="style"&&this.processStyle(a,g)}}},processLink:function(a,b){a.push(function(a){if(!Wicket.Head.containsElement(b,"href")){var c=Wicket.Head.createElement("link");c.id=b.getAttribute("id");c.rel=b.getAttribute("rel");c.href=b.getAttribute("href");
c.type=b.getAttribute("type");Wicket.Head.addElement(c)}a()})},processStyle:function(a,b){a.push(function(a){if(!Wicket.DOM.containsElement(b)){var c=Wicket.DOM.serializeNodeChildren(b),g=Wicket.Head.createElement("style");g.id=b.getAttribute("id");if(Wicket.Browser.isIE())try{document.createStyleSheet().cssText=c}catch(e){window.setTimeout(function(){try{document.createStyleSheet().cssText=c}catch(a){Wicket.Log.error(a)}},1)}else{var h=document.createTextNode(c);g.appendChild(h)}Wicket.Head.addElement(g)}a()})},
processScript:function(a,b){a.push(function(a){if(Wicket.DOM.containsElement(b)||Wicket.Head.containsElement(b,"src"))a();else{var c=b.getAttribute("src");if(c!=null&&c!=""){var g=function(b){Wicket.Head.addJavascript(b,null,c);Wicket.Ajax.invokePostCallHandlers();a()};window.setTimeout(function(){var a=new Wicket.Ajax.Request(c,g,!1,!1);a.debugContent=!1;if(Wicket.Browser.isKHTML())a.async=!1;a.get()},1)}else{var e=Wicket.DOM.serializeNodeChildren(b),e=e.replace(/^<\!--\/\*--\><!\[CDATA\[\/\*><\!--\*\//,
""),e=e.replace(/\/\*--\>]]\>\*\/$/,""),h=b.getAttribute("id");if(typeof h=="string"&&h.length>0)Wicket.Head.addJavascript(e,h);else try{eval(e)}catch(n){Wicket.Log.error(n)}a()}}})}};Wicket.Head.createElement=function(a){return document.createElement(a)};Wicket.Head.addElement=function(a){var b=document.getElementsByTagName("head");b[0]&&b[0].appendChild(a)};
Wicket.Head.containsElement=function(a,b){var d=a.getAttribute(b);if(d==null||d==""||typeof d=="undefined")return!1;var c=document.getElementsByTagName("head")[0];a.tagName=="script"&&(c=document);for(var c=c.getElementsByTagName(a.tagName),g=0;g<c.length;++g){var e=c[g];if(e.tagName.toLowerCase()==a.tagName.toLowerCase()&&(e.getAttribute(b)==d||e.getAttribute(b+"_")==d))return!0}return!1};
Wicket.Head.addJavascript=function(a,b,d){var c=Wicket.Head.createElement("script");c.id=b;c.setAttribute("src_",d);null==c.canHaveChildren||c.canHaveChildren?(a=document.createTextNode(a),c.appendChild(a)):c.text=a;Wicket.Head.addElement(c)};
Wicket.Head.addJavascripts=function(a,b){function d(a){var c=a.getAttribute("src");if(c!=null&&c.length>0)a=document.createElement("script"),a.setAttribute("type","text/javascript"),a.setAttribute("src",c),Wicket.Head.addElement(a);else{c=Wicket.DOM.serializeNodeChildren(a);if(c==null||c=="")c=a.text;typeof b=="function"&&(c=b(c));Wicket.Head.addJavascript(c)}}if(typeof a!="undefined"&&typeof a.tagName!="undefined"&&a.tagName.toLowerCase()=="script")d(a);else if(a.childNodes.length>0)for(var c=a.getElementsByTagName("script"),
g=0;g<c.length;++g)d(c[g])};Wicket.ThrottlerEntry=Wicket.Class.create();Wicket.ThrottlerEntry.prototype={initialize:function(a){this.func=a;this.timestamp=(new Date).getTime();this.timeoutVar=void 0},getTimestamp:function(){return this.timestamp},getFunc:function(){return this.func},setFunc:function(a){this.func=a},getTimeoutVar:function(){return this.timeoutVar},setTimeoutVar:function(a){this.timeoutVar=a}};Wicket.Throttler=Wicket.Class.create();
Wicket.Throttler.prototype={initialize:function(a){this.entries=[];this.postponeTimerOnUpdate=a!=void 0?a:!1},throttle:function(a,b,d){var c=this.entries[a],g=this;c==void 0?(c=new Wicket.ThrottlerEntry(d),c.setTimeoutVar(window.setTimeout(function(){g.execute(a)},b)),this.entries[a]=c):(c.setFunc(d),this.postponeTimerOnUpdate==!0&&(window.clearTimeout(c.getTimeoutVar()),c.setTimeoutVar(window.setTimeout(function(){g.execute(a)},b))))},execute:function(a){var b=this.entries[a];b!=void 0&&(b=b.getFunc(),
this.entries[a]=void 0,b())}};Wicket.throttler=new Wicket.Throttler;Wicket.stopEvent=function(a){a=Wicket.fixEvent(a);a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()};Wicket.fixEvent=function(a){if(typeof a=="undefined")a=window.event;return a};
Wicket.Drag={init:function(a,b,d,c){if(typeof b=="undefined")b=Wicket.emptyFunction;if(typeof d=="undefined")d=Wicket.emptyFunction;if(typeof c=="undefined")c=Wicket.emptyFunction;a.wicketOnDragBegin=b;a.wicketOnDrag=c;a.wicketOnDragEnd=d;Wicket.Event.add(a,"mousedown",Wicket.Drag.mouseDownHandler)},mouseDownHandler:function(a){a=Wicket.fixEvent(a);if(typeof a.ignore=="undefined")return Wicket.stopEvent(a),a.preventDefault&&a.preventDefault(),this.wicketOnDragBegin(this),this.lastMouseX=a.clientX,
this.lastMouseY=a.clientY,this.old_onmousemove=document.onmousemove,this.old_onmouseup=document.onmouseup,this.old_onselectstart=document.onselectstart,this.old_onmouseout=document.onmouseout,document.onselectstart=function(){return!1},document.onmousemove=Wicket.Drag.mouseMove,document.onmouseup=Wicket.Drag.mouseUp,document.onmouseout=Wicket.Drag.mouseOut,Wicket.Drag.current=this,!1},clean:function(a){a.onmousedown=null},mouseMove:function(a){var a=Wicket.fixEvent(a),b=Wicket.Drag.current;if(!(a.clientX<
0||a.clientY<0)){if(b!=null){var d=b.wicketOnDrag(b,a.clientX-b.lastMouseX,a.clientY-b.lastMouseY,a);d==null&&(d=[0,0]);b.lastMouseX=a.clientX+d[0];b.lastMouseY=a.clientY+d[1]}return!1}},mouseUp:function(a){Wicket.fixEvent(a);a=Wicket.Drag.current;if(a!=null&&typeof a!="undefined")a.wicketOnDragEnd(a),a.lastMouseX=null,a.lastMouseY=null,document.onmousemove=a.old_onmousemove,document.onmouseup=a.old_onmouseup,document.onselectstart=a.old_onselectstart,document.onmouseout=a.old_onmouseout,a.old_mousemove=
null,a.old_mouseup=null,a.old_onselectstart=null,a.old_onmouseout=null,Wicket.Drag.current=null},mouseOut:function(){}};
Wicket.ChangeHandler=function(a){a=Wicket.$(a);a.setAttribute("autocomplete","off");if(Wicket.Browser.isIE()||Wicket.Browser.isKHTML()||Wicket.Browser.isSafari()){var b=a.onchange;a.onkeyup=function(a){switch(wicketKeyCode(Wicket.fixEvent(a))){case 13:case 38:case 40:case 27:case 9:case 39:case 37:case 16:case 18:case 17:return Wicket.stopEvent(a);default:typeof b=="function"&&b()}return null};a.onpaste=function(){typeof b=="function"&&setTimeout(function(){b()},10);return null};a.oncut=function(){typeof b==
"function"&&setTimeout(function(){b()},10);return null}}else a.addEventListener("input",a.onchange,!0);a.onchange=function(a){Wicket.stopEvent(a)}};var wicketThrottler=Wicket.throttler;function wicketAjaxGet(a,b,d,c,g){a=new Wicket.Ajax.Call(a,b,d,g);if(typeof c!="undefined"&&c!=null)a.request.precondition=c;return a.call()}function wicketAjaxPost(a,b,d,c,g,e){a=new Wicket.Ajax.Call(a,d,c,e);if(typeof g!="undefined"&&g!=null)a.request.precondition=g;return a.post(b)}
function wicketSubmitForm(a,b,d,c,g,e,h){b=new Wicket.Ajax.Call(b,c,g,h);if(typeof e!="undefined"&&e!=null)b.request.precondition=e;return b.submitForm(a,d)}function wicketSubmitFormById(a,b,d,c,g,e,h){b=new Wicket.Ajax.Call(b,c,g,h);if(typeof e!="undefined"&&e!=null)b.request.precondition=e;return b.submitFormById(a,d)}wicketSerialize=Wicket.Form.serializeElement;wicketSerializeForm=Wicket.Form.serialize;wicketEncode=Wicket.Form.encode;wicketDecode=Wicket.decode;wicketAjaxGetTransport=Wicket.Ajax.getTransport;
Wicket.Ajax.registerPreCallHandler(function(){if(typeof window.wicketGlobalPreCallHandler!="undefined"){var a=wicketGlobalPreCallHandler;a!=null&&a()}});Wicket.Ajax.registerPostCallHandler(function(){if(typeof window.wicketGlobalPostCallHandler!="undefined"){var a=wicketGlobalPostCallHandler;a!=null&&a()}});Wicket.Ajax.registerFailureHandler(function(){if(typeof window.wicketGlobalFailureHandler!="undefined"){var a=wicketGlobalFailureHandler;a!=null&&a()}});
Wicket.Focus={lastFocusId:"",refocusLastFocusedComponentAfterResponse:!1,focusSetFromServer:!1,setFocus:function(a){a=Wicket.fixEvent(a);if(a=a.target?a.target:a.srcElement)Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1,Wicket.Focus.lastFocusId=a.id,Wicket.Log.info("focus set on "+Wicket.Focus.lastFocusId)},blur:function(a){a=Wicket.fixEvent(a);if((a=a.target?a.target:a.srcElement)&&Wicket.Focus.lastFocusId==a.id)Wicket.Focus.refocusLastFocusedComponentAfterResponse?Wicket.Log.info("focus removed from "+
a.id+" but ignored because of component replacement"):(Wicket.Focus.lastFocusId=null,Wicket.Log.info("focus removed from "+a.id))},getFocusedElement:function(){if(typeof Wicket.Focus.lastFocusId!="undefined"&&Wicket.Focus.lastFocusId!=""&&Wicket.Focus.lastFocusId!=null)return Wicket.Log.info("returned focused element: "+Wicket.$(Wicket.Focus.lastFocusId)),Wicket.$(Wicket.Focus.lastFocusId)},setFocusOnId:function(a){typeof a!="undefined"&&a!=""&&a!=null?(Wicket.Focus.refocusLastFocusedComponentAfterResponse=
!0,Wicket.Focus.focusSetFromServer=!0,Wicket.Focus.lastFocusId=a,Wicket.Log.info("focus set on "+Wicket.Focus.lastFocusId+" from serverside")):(Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1,Wicket.Log.info("refocus focused component after request stopped from serverside"))},markFocusedComponent:function(){var a=Wicket.Focus.getFocusedElement();typeof a!="undefined"&&a!=null?(a.wasFocusedBeforeComponentReplacements=!0,Wicket.Focus.refocusLastFocusedComponentAfterResponse=!0,Wicket.Focus.focusSetFromServer=
!1):Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1},checkFocusedComponentReplaced:function(){var a=Wicket.Focus.getFocusedElement();if(Wicket.Focus.refocusLastFocusedComponentAfterResponse==!0)if(typeof a!="undefined"&&a!=null){if(typeof a.wasFocusedBeforeComponentReplacements!="undefined")Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1}else Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1,Wicket.Focus.lastFocusId=""},requestFocus:function(){if(Wicket.Focus.refocusLastFocusedComponentAfterResponse&&
typeof Wicket.Focus.lastFocusId!="undefined"&&Wicket.Focus.lastFocusId!=""&&Wicket.Focus.lastFocusId!=null){var a=Wicket.$(Wicket.Focus.lastFocusId);if(a!=null&&typeof a!="undefined"){Wicket.Log.info("Calling focus on "+Wicket.Focus.lastFocusId);try{if(Wicket.Focus.focusSetFromServer)a.focus();else{var b=a.onfocus;a.onfocus=null;a.focus();setTimeout(function(){a.onfocus=b},0)}}catch(d){}}else Wicket.Focus.lastFocusId="",Wicket.Log.info("Couldn't set focus on "+Wicket.Focus.lastFocusId+" not on the page anymore")}else Wicket.Focus.refocusLastFocusedComponentAfterResponse?
Wicket.Log.info("last focus id was not set"):Wicket.Log.info("refocus last focused component not needed/allowed");Wicket.Focus.refocusLastFocusedComponentAfterResponse=!1},setFocusOnElements:function(a){for(var b=a.length,d=0;d<b;d++)if(a[d].wicketFocusSet!=!0)Wicket.Event.add(a[d],"focus",Wicket.Focus.setFocus),Wicket.Event.add(a[d],"blur",Wicket.Focus.blur),a[d].wicketFocusSet=!0},attachFocusEvent:function(){Wicket.Focus.setFocusOnElements(document.getElementsByTagName("input"));Wicket.Focus.setFocusOnElements(document.getElementsByTagName("select"));
Wicket.Focus.setFocusOnElements(document.getElementsByTagName("textarea"));Wicket.Focus.setFocusOnElements(document.getElementsByTagName("button"));Wicket.Focus.setFocusOnElements(document.getElementsByTagName("a"))}};Wicket.Event.addDomReadyEvent(Wicket.Focus.attachFocusEvent);function wicketAjaxDebugEnabled(){return typeof wicketAjaxDebugEnable=="undefined"?!1:wicketAjaxDebugEnable==!0}function wicketKeyCode(a){return typeof a.keyCode=="undefined"?a.which:a.keyCode}
function wicketGet(a){return Wicket.$(a)}function wicketShow(a){a=wicketGet(a);if(a!=null)a.style.display=""}function wicketHide(a){a=wicketGet(a);if(a!=null)a.style.display="none"};
