var ZoneUpdater=Class.create();ZoneUpdater.prototype={initialize:function(b,f,d,c,a,e){this.zoneElement=$(b);this.event=d;this.link=c;this.placeholder=e;$T(this.zoneElement).zoneId=a;f.observe(this.event,this.updateZone.bindAsEventListener(this))},updateZone:function(b){var a=Tapestry.findZoneManager(this.zoneElement);if(!a){return}var d;if(this.zoneElement.value){d=this.zoneElement.value}if(!d){d=" "}d=this.encodeForUrl(d);var c=this.link.gsub(this.placeholder,d);a.updateFromURL(c)},encodeForUrl:function(a){a=a.replace(/\r\n/g,"\n");var d="";for(var f=0;f<a.length;f++){var e=a.charCodeAt(f);if("$"==a.charAt(f)){d+="$$"}else{if(this.inRange(e,"AZ")||this.inRange(e,"az")||this.inRange(e,"09")||this.inRange(e,"..")||this.inRange(e,"__")){d+=a.charAt(f)}else{var b=e.toString(16);while(b.length<4){b="0"+b}d+="$"+b}}}return d},inRange:function(b,a){return b>=a.charCodeAt(0)&&b<=a.charCodeAt(1)}};