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