var Prototype={Version:"1.5.0_rc0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(h){return h;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(h,R){for(var A in R){h[A]=R[A];}return h;};Object.inspect=function(h){try{if(h==undefined){return "undefined";}if(h==null){return "null";}return h.inspect?h.inspect():h.toString();}catch(A){if(A instanceof RangeError){return "...";}throw A;}};Function.prototype.bind=function(){var h=this,R=$A(arguments),A=R.shift();return function(){return h.apply(A,R.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(A){var h=this;return function(R){return h.call(A,R||window.event);};};Object.extend(Number.prototype,{toColorPart:function(){var h=this.toString(16);if(this<16){return "0"+h;}return h;},succ:function(){return this+1;},times:function(h){$R(0,this,true).each(h);return this;}});var Try={these:function(){var R;for(var A=0;A<arguments.length;A++){var h=arguments[A];try{R=h();break;}catch(q){}}return R;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(A,h){this.callback=A;this.frequency=h;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}};Object.extend(String.prototype,{gsub:function(w,R){var h="",q=this,A;R=arguments.callee.prepareReplacement(R);while(q.length>0){if(A=q.match(w)){h+=q.slice(0,A.index);h+=(R(A)||"").toString();q=q.slice(A.index+A[0].length);}else{h+=q,q="";}}return h;},sub:function(R,h,A){h=this.gsub.prepareReplacement(h);A=A===undefined?1:A;return this.gsub(R,function(q){if(--A<0){return q[0];}return h(q);});},scan:function(A,h){this.gsub(A,h);return this;},truncate:function(A,h){A=A||30;h=h===undefined?"...":h;return this.length>A?this.slice(0,A-h.length)+h:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var A=new RegExp(Prototype.ScriptFragment,"img");var h=new RegExp(Prototype.ScriptFragment,"im");return (this.match(A)||[]).map(function(R){return (R.match(h)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});},escapeHTML:function(){var A=document.createElement("div");var h=document.createTextNode(this);A.appendChild(h);return A.innerHTML;},unescapeHTML:function(){var h=document.createElement("div");h.innerHTML=this.stripTags();return h.childNodes[0]?h.childNodes[0].nodeValue:"";},toQueryParams:function(){var h=this.match(/^\??(.*)$/)[1].split("&");return h.inject({},function(q,A){var R=A.split("=");q[R[0]]=R[1];return q;});},toArray:function(){return this.split("");},camelize:function(){var q=this.split("-");if(q.length==1){return q[0];}var A=this.indexOf("-")==0?q[0].charAt(0).toUpperCase()+q[0].substring(1):q[0];for(var R=1,h=q.length;R<h;R++){var w=q[R];A+=w.charAt(0).toUpperCase()+w.substring(1);}return A;},inspect:function(){return "'"+this.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'";}});String.prototype.gsub.prepareReplacement=function(A){if(typeof A=="function"){return A;}var h=new Template(A);return function(R){return h.evaluate(R);};};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(h,A){this.template=h.toString();this.pattern=A||Template.Pattern;},evaluate:function(h){return this.template.gsub(this.pattern,function(A){var R=A[1];if(R=="\\"){return A[2];}return R+(h[A[3]]||"").toString();});}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(A){var h=0;try{this._each(function(q){try{A(q,h++);}catch(w){if(w!=$continue){throw w;}}});}catch(R){if(R!=$break){throw R;}}},all:function(A){var h=true;this.each(function(q,R){h=h&&!!(A||Prototype.K)(q,R);if(!h){throw $break;}});return h;},any:function(A){var h=true;this.each(function(q,R){if(h=!!(A||Prototype.K)(q,R)){throw $break;}});return h;},collect:function(A){var h=[];this.each(function(q,R){h.push(A(q,R));});return h;},detect:function(A){var h;this.each(function(q,R){if(A(q,R)){h=q;throw $break;}});return h;},findAll:function(A){var h=[];this.each(function(q,R){if(A(q,R)){h.push(q);}});return h;},grep:function(R,A){var h=[];this.each(function(x,w){var q=x.toString();if(q.match(R)){h.push((A||Prototype.K)(x,w));}});return h;},include:function(h){var A=false;this.each(function(R){if(R==h){A=true;throw $break;}});return A;},inject:function(h,A){this.each(function(q,R){h=A(h,q,R);});return h;},invoke:function(A){var h=$A(arguments).slice(1);return this.collect(function(R){return R[A].apply(R,h);});},max:function(A){var h;this.each(function(q,R){q=(A||Prototype.K)(q,R);if(h==undefined||q>=h){h=q;}});return h;},min:function(A){var h;this.each(function(q,R){q=(A||Prototype.K)(q,R);if(h==undefined||q<h){h=q;}});return h;},partition:function(R){var A=[],h=[];this.each(function(w,q){((R||Prototype.K)(w,q)?A:h).push(w);});return [A,h];},pluck:function(A){var h=[];this.each(function(q,R){h.push(q[A]);});return h;},reject:function(A){var h=[];this.each(function(q,R){if(!A(q,R)){h.push(q);}});return h;},sortBy:function(h){return this.collect(function(R,A){return {value:R,criteria:h(R,A)};}).sort(function(w,q){var R=w.criteria,A=q.criteria;return R<A?-1:R>A?1:0;}).pluck("value");},toArray:function(){return this.collect(Prototype.K);},zip:function(){var A=Prototype.K,h=$A(arguments);if(typeof h.last()=="function"){A=h.pop();}var R=[this].concat(h).map($A);return this.map(function(w,q){return A(R.pluck(q));});},inspect:function(){return "#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(R){if(!R){return [];}if(R.toArray){return R.toArray();}else{var A=[];for(var h=0;h<R.length;h++){A.push(R[h]);}return A;}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(A){for(var h=0;h<this.length;h++){A(this[h]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(h){return h!=undefined||h!=null;});},flatten:function(){return this.inject([],function(A,h){return A.concat(h&&h.constructor==Array?h.flatten():[h]);});},without:function(){var h=$A(arguments);return this.select(function(A){return !h.include(A);});},indexOf:function(h){for(var A=0;A<this.length;A++){if(this[A]==h){return A;}}return -1;},reverse:function(h){return (h!==false?this:this.toArray())._reverse();},inspect:function(){return "["+this.map(Object.inspect).join(", ")+"]";}});var Hash={_each:function(A){for(var h in this){var R=this[h];if(typeof R=="function"){continue;}var q=[h,R];q.key=h;q.value=R;A(q);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(h){return $H(h).inject($H(this),function(A,R){A[R.key]=R.value;return A;});},toQueryString:function(){return this.map(function(h){return h.map(encodeURIComponent).join("=");}).join("&");},inspect:function(){return "#<Hash:{"+this.map(function(h){return h.map(Object.inspect).join(": ");}).join(", ")+"}>";}};function $H(h){var A=Object.extend({},h||{});Object.extend(A,Enumerable);Object.extend(A,Hash);return A;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(R,h,A){this.start=R;this.end=h;this.exclusive=A;},_each:function(h){var A=this.start;do{h(A);A=A.succ();}while(this.include(A));},include:function(h){if(h<this.start){return false;}if(this.exclusive){return h<this.end;}return h<=this.end;}});var $R=function(R,h,A){return new ObjectRange(R,h,A);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(h){this.responders._each(h);},register:function(h){if(!this.include(h)){this.responders.push(h);}},unregister:function(h){this.responders=this.responders.without(h);},dispatch:function(q,A,R,h){this.each(function(w){if(w[q]&&typeof w[q]=="function"){try{w[q].apply(w,[A,R,h]);}catch(x){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(h){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,h||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return !this.responseIsSuccess();}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(A,h){this.transport=Ajax.getTransport();this.setOptions(h);this.request(A);},request:function(A){var R=this.options.parameters||"";if(R.length>0){R+="&_=";}try{this.url=A;if(this.options.method=="get"&&R.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+R;}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1);}).bind(this),10);}this.setRequestHeaders();var h=this.options.postBody?this.options.postBody:R;this.transport.send(this.options.method=="post"?h:null);}catch(q){this.dispatchException(q);}},setRequestHeaders:function(){var A=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){A.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){A.push("Connection","close");}}if(this.options.requestHeaders){A.push.apply(A,this.options.requestHeaders);}for(var h=0;h<A.length;h+=2){this.transport.setRequestHeader(A[h],A[h+1]);}},onStateChange:function(){var h=this.transport.readyState;if(h!=1){this.respondToReadyState(this.transport.readyState);}},header:function(h){try{return this.transport.getResponseHeader(h);}catch(A){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")");}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(h){var R=Ajax.Request.Events[h];var w=this.transport,A=this.evalJSON();if(R=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(w,A);}catch(q){this.dispatchException(q);}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse();}}try{(this.options["on"+R]||Prototype.emptyFunction)(w,A);Ajax.Responders.dispatch("on"+R,this,w,A);}catch(q){this.dispatchException(q);}if(R=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},dispatchException:function(h){(this.options.onException||Prototype.emptyFunction)(this,h);Ajax.Responders.dispatch("onException",this,h);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(h,R,A){this.containers={success:h.success?$(h.success):$(h),failure:h.failure?$(h.failure):(h.success?null:$(h))};this.transport=Ajax.getTransport();this.setOptions(A);var q=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(x,w){this.updateContent();q(x,w);}).bind(this);this.request(R);},updateContent:function(){var A=this.responseIsSuccess()?this.containers.success:this.containers.failure;var h=this.transport.responseText;if(!this.options.evalScripts){h=h.stripScripts();}if(A){if(this.options.insertion){new this.options.insertion(A,h);}else{Element.update(A,h);}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10);}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(h,R,A){this.setOptions(A);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=h;this.url=R;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(h){if(this.options.decay){this.decay=(h.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=h.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(){var R=[],A;for(var h=0;h<arguments.length;h++){A=arguments[h];if(typeof A=="string"){A=document.getElementById(A);}R.push(Element.extend(A));}return R.length<2?R[0]:R;}document.getElementsByClassName=function(R,h){var A=($(h)||document.body).getElementsByTagName("*");return $A(A).inject([],function(q,w){if(w.className.match(new RegExp("(^|\\s)"+R+"(\\s|$)"))){q.push(Element.extend(w));}return q;});};if(!window.Element){var Element=new Object();}Element.extend=function(R){if(!R){return ;}if(_nativeExtensions){return R;}if(!R._extended&&R.tagName&&R!=window){var A=Element.Methods,h=Element.extend.cache;for(property in A){var q=A[property];if(typeof q=="function"){R[property]=h.findOrStore(q);}}}R._extended=true;return R;};Element.extend.cache={findOrStore:function(h){return this[h]=this[h]||function(){return h.apply(null,[this].concat($A(arguments)));};}};Element.Methods={visible:function(h){return $(h).style.display!="none";},toggle:function(){for(var A=0;A<arguments.length;A++){var h=$(arguments[A]);Element[Element.visible(h)?"hide":"show"](h);}},hide:function(){for(var A=0;A<arguments.length;A++){var h=$(arguments[A]);h.style.display="none";}},show:function(){for(var A=0;A<arguments.length;A++){var h=$(arguments[A]);h.style.display="";}},remove:function(h){h=$(h);h.parentNode.removeChild(h);},update:function(A,h){$(A).innerHTML=h.stripScripts();setTimeout(function(){h.evalScripts();},10);},replace:function(R,A){R=$(R);if(R.outerHTML){R.outerHTML=A.stripScripts();}else{var h=R.ownerDocument.createRange();h.selectNodeContents(R);R.parentNode.replaceChild(h.createContextualFragment(A.stripScripts()),R);}setTimeout(function(){A.evalScripts();},10);},getHeight:function(h){h=$(h);return h.offsetHeight;},classNames:function(h){return new Element.ClassNames(h);},hasClassName:function(h,A){if(!(h=$(h))){return ;}return Element.classNames(h).include(A);},addClassName:function(h,A){if(!(h=$(h))){return ;}return Element.classNames(h).add(A);},removeClassName:function(h,A){if(!(h=$(h))){return ;}return Element.classNames(h).remove(A);},cleanWhitespace:function(A){A=$(A);for(var h=0;h<A.childNodes.length;h++){var R=A.childNodes[h];if(R.nodeType==3&&!/\S/.test(R.nodeValue)){Element.remove(R);}}},empty:function(h){return $(h).innerHTML.match(/^\s*$/);},childOf:function(A,h){A=$(A),h=$(h);while(A=A.parentNode){if(A==h){return true;}}return false;},scrollTo:function(A){A=$(A);var h=A.x?A.x:A.offsetLeft,R=A.y?A.y:A.offsetTop;window.scrollTo(h,R);},getStyle:function(A,R){A=$(A);var q=A.style[R.camelize()];if(!q){if(document.defaultView&&document.defaultView.getComputedStyle){var h=document.defaultView.getComputedStyle(A,null);q=h?h.getPropertyValue(R):null;}else{if(A.currentStyle){q=A.currentStyle[R.camelize()];}}}if(window.opera&&["left","top","right","bottom"].include(R)){if(Element.getStyle(A,"position")=="static"){q="auto";}}return q=="auto"?null:q;},setStyle:function(A,R){A=$(A);for(var h in R){A.style[h.camelize()]=R[h];}},getDimensions:function(A){A=$(A);if(Element.getStyle(A,"display")!="none"){return {width:A.offsetWidth,height:A.offsetHeight};}var h=A.style;var w=h.visibility;var R=h.position;h.visibility="hidden";h.position="absolute";h.display="";var x=A.clientWidth;var q=A.clientHeight;h.display="none";h.position=R;h.visibility=w;return {width:x,height:q};},makePositioned:function(h){h=$(h);var A=Element.getStyle(h,"position");if(A=="static"||!A){h._madePositioned=true;h.style.position="relative";if(window.opera){h.style.top=0;h.style.left=0;}}},undoPositioned:function(h){h=$(h);if(h._madePositioned){h._madePositioned=undefined;h.style.position=h.style.top=h.style.left=h.style.bottom=h.style.right="";}},makeClipping:function(h){h=$(h);if(h._overflow){return ;}h._overflow=h.style.overflow;if((Element.getStyle(h,"overflow")||"visible")!="hidden"){h.style.overflow="hidden";}},undoClipping:function(h){h=$(h);if(h._overflow){return ;}h.style.overflow=h._overflow;h._overflow=undefined;}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){var HTMLElement={};HTMLElement.prototype=document.createElement("div").__proto__;}Element.addMethods=function(A){Object.extend(Element.Methods,A||{});if(typeof HTMLElement!="undefined"){var A=Element.Methods,h=Element.extend.cache;for(property in A){var R=A[property];if(typeof R=="function"){HTMLElement.prototype[property]=h.findOrStore(R);}}_nativeExtensions=true;}};Element.addMethods();var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(h){this.adjacency=h;};Abstract.Insertion.prototype={initialize:function(A,R){this.element=$(A);this.content=R.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(q){var h=this.element.tagName.toLowerCase();if(h=="tbody"||h=="tr"){this.insertContent(this.contentFromAnonymousTable());}else{throw q;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){R.evalScripts();},10);},contentFromAnonymousTable:function(){var h=document.createElement("div");h.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(h.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(h){h.each((function(A){this.element.parentNode.insertBefore(A,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(h){h.reverse(false).each((function(A){this.element.insertBefore(A,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(h){h.each((function(A){this.element.appendChild(A);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(h){h.each((function(A){this.element.parentNode.insertBefore(A,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(h){this.element=$(h);},_each:function(h){this.element.className.split(/\s+/).select(function(A){return A.length>0;})._each(h);},set:function(h){this.element.className=h;},add:function(h){if(this.include(h)){return ;}this.set(this.toArray().concat(h).join(" "));},remove:function(h){if(!this.include(h)){return ;}this.set(this.select(function(A){return A!=h;}).join(" "));},toString:function(){return this.toArray().join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(h){this.params={classNames:[]};this.expression=h.toString().strip();this.parseExpression();this.compileMatcher();},parseExpression:function(){function e(u){throw "Parse error in selector: "+u;}if(this.expression==""){e("empty expression");}var x=this.params,w=this.expression,A,h,q,R;while(A=w.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){x.attributes=x.attributes||[];x.attributes.push({name:A[2],operator:A[3],value:A[4]||A[5]||""});w=A[1];}if(w=="*"){return this.params.wildcard=true;}while(A=w.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){h=A[1],q=A[2],R=A[3];switch(h){case "#":x.id=q;break;case ".":x.classNames.push(q);break;case "":case undefined:x.tagName=q.toUpperCase();break;default:e(w.inspect());}w=R;}if(w.length>0){e(w.inspect());}},buildMatchExpression:function(){var q=this.params,R=[],A;if(q.wildcard){R.push("true");}if(A=q.id){R.push("element.id == "+A.inspect());}if(A=q.tagName){R.push("element.tagName.toUpperCase() == "+A.inspect());}if((A=q.classNames).length>0){for(var h=0;h<A.length;h++){R.push("Element.hasClassName(element, "+A[h].inspect()+")");}}if(A=q.attributes){A.each(function(x){var e="element.getAttribute("+x.name.inspect()+")";var w=function(u){return e+" && "+e+".split("+u.inspect()+")";};switch(x.operator){case "=":R.push(e+" == "+x.value.inspect());break;case "~=":R.push(w(" ")+".include("+x.value.inspect()+")");break;case "|=":R.push(w("-")+".first().toUpperCase() == "+x.value.toUpperCase().inspect());break;case "!=":R.push(e+" != "+x.value.inspect());break;case "":case undefined:R.push(e+" != null");break;default:throw "Unknown operator "+x.operator+" in selector";}});}return R.join(" && ");},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());},findElements:function(q){var R;if(R=$(this.params.id)){if(this.match(R)){if(!q||Element.childOf(R,q)){return [R];}}}q=(q||document).getElementsByTagName(this.params.tagName||"*");var A=[];for(var h=0;h<q.length;h++){if(this.match(R=q[h])){A.push(Element.extend(R));}}return A;},toString:function(){return this.expression;}};function $$(){return $A(arguments).map(function(h){return h.strip().split(/\s+/).inject([null],function(R,q){var A=new Selector(q);return R.map(A.findElements.bind(A)).flatten();});}).flatten();}var Field={clear:function(){for(var h=0;h<arguments.length;h++){$(arguments[h]).value="";}},focus:function(h){$(h).focus();},present:function(){for(var h=0;h<arguments.length;h++){if($(arguments[h]).value==""){return false;}}return true;},select:function(h){$(h).select();},activate:function(h){h=$(h);h.focus();if(h.select){h.select();}}};var Form={serialize:function(q){var w=Form.getElements($(q));var R=new Array();for(var A=0;A<w.length;A++){var h=Form.Element.serialize(w[A]);if(h){R.push(h);}}return R.join("&");},getElements:function(R){R=$(R);var q=new Array();for(var A in Form.Element.Serializers){var w=R.getElementsByTagName(A);for(var h=0;h<w.length;h++){q.push(w[h]);}}return q;},getInputs:function(x,R,q){x=$(x);var h=x.getElementsByTagName("input");if(!R&&!q){return h;}var e=new Array();for(var w=0;w<h.length;w++){var A=h[w];if((R&&A.type!=R)||(q&&A.name!=q)){continue;}e.push(A);}return e;},disable:function(R){var q=Form.getElements(R);for(var A=0;A<q.length;A++){var h=q[A];h.blur();h.disabled="true";}},enable:function(R){var q=Form.getElements(R);for(var A=0;A<q.length;A++){var h=q[A];h.disabled="";}},findFirstElement:function(h){return Form.getElements(h).find(function(A){return A.type!="hidden"&&!A.disabled&&["input","select","textarea"].include(A.tagName.toLowerCase());});},focusFirstElement:function(h){Field.activate(Form.findFirstElement(h));},reset:function(h){$(h).reset();}};Form.Element={serialize:function(A){A=$(A);var q=A.tagName.toLowerCase();var R=Form.Element.Serializers[q](A);if(R){var h=encodeURIComponent(R[0]);if(h.length==0){return ;}if(R[1].constructor!=Array){R[1]=[R[1]];}return R[1].map(function(w){return h+"="+encodeURIComponent(w);}).join("&");}},getValue:function(h){h=$(h);var R=h.tagName.toLowerCase();var A=Form.Element.Serializers[R](h);if(A){return A[1];}}};Form.Element.Serializers={input:function(h){switch(h.type.toLowerCase()){case "submit":case "hidden":case "password":case "text":return Form.Element.Serializers.textarea(h);case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(h);}return false;},inputSelector:function(h){if(h.checked){return [h.name,h.value];}},textarea:function(h){return [h.name,h.value];},select:function(h){return Form.Element.Serializers[h.type=="select-one"?"selectOne":"selectMany"](h);},selectOne:function(R){var q="",A,h=R.selectedIndex;if(h>=0){A=R.options[h];q=A.value||A.text;}return [R.name,q];},selectMany:function(R){var q=[];for(var A=0;A<R.length;A++){var h=R.options[A];if(h.selected){q.push(h.value||h.text);}}return [R.name,q];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(h,A,R){this.frequency=A;this.element=$(h);this.callback=R;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var h=this.getValue();if(this.lastValue!=h){this.callback(this.element,h);this.lastValue=h;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(h,A){this.element=$(h);this.callback=A;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var h=this.getValue();if(this.lastValue!=h){this.callback(this.element,h);this.lastValue=h;}},registerFormCallbacks:function(){var A=Form.getElements(this.element);for(var h=0;h<A.length;h++){this.registerCallback(A[h]);}},registerCallback:function(h){if(h.type){switch(h.type.toLowerCase()){case "checkbox":case "radio":Event.observe(h,"click",this.onElementEvent.bind(this));break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":Event.observe(h,"change",this.onElementEvent.bind(this));break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(h){return h.target||h.srcElement;},isLeftClick:function(h){return (((h.which)&&(h.which==1))||((h.button)&&(h.button==1)));},pointerX:function(h){return h.pageX||(h.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(h){return h.pageY||(h.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(h){if(h.preventDefault){h.preventDefault();h.stopPropagation();}else{h.returnValue=false;h.cancelBubble=true;}},findElement:function(R,A){var h=Event.element(R);while(h.parentNode&&(!h.tagName||(h.tagName.toUpperCase()!=A.toUpperCase()))){h=h.parentNode;}return h;},observers:false,_observeAndCache:function(q,R,A,h){if(!this.observers){this.observers=[];}if(q.addEventListener){this.observers.push([q,R,A,h]);q.addEventListener(R,A,h);}else{if(q.attachEvent){this.observers.push([q,R,A,h]);q.attachEvent("on"+R,A);}}},unloadCache:function(){if(!Event.observers){return ;}for(var h=0;h<Event.observers.length;h++){Event.stopObserving.apply(this,Event.observers[h]);Event.observers[h][0]=null;}Event.observers=false;},observe:function(q,R,A,h){var q=$(q);h=h||false;if(R=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||q.attachEvent)){R="keydown";}this._observeAndCache(q,R,A,h);},stopObserving:function(q,R,A,h){var q=$(q);h=h||false;if(R=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||q.detachEvent)){R="keydown";}if(q.removeEventListener){q.removeEventListener(R,A,h);}else{if(q.detachEvent){q.detachEvent("on"+R,A);}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false);}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(A){var h=0,R=0;do{h+=A.scrollTop||0;R+=A.scrollLeft||0;A=A.parentNode;}while(A);return [R,h];},cumulativeOffset:function(A){var h=0,R=0;do{h+=A.offsetTop||0;R+=A.offsetLeft||0;A=A.offsetParent;}while(A);return [R,h];},positionedOffset:function(A){var h=0,R=0;do{h+=A.offsetTop||0;R+=A.offsetLeft||0;A=A.offsetParent;if(A){p=Element.getStyle(A,"position");if(p=="relative"||p=="absolute"){break;}}}while(A);return [R,h];},offsetParent:function(h){if(h.offsetParent){return h.offsetParent;}if(h==document.body){return h;}while((h=h.parentNode)&&h!=document.body){if(Element.getStyle(h,"position")!="static"){return h;}}return document.body;},within:function(A,h,R){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(A,h,R);}this.xcomp=h;this.ycomp=R;this.offset=this.cumulativeOffset(A);return (R>=this.offset[1]&&R<this.offset[1]+A.offsetHeight&&h>=this.offset[0]&&h<this.offset[0]+A.offsetWidth);},withinIncludingScrolloffsets:function(A,h,q){var R=this.realOffset(A);this.xcomp=h+R[0]-this.deltaX;this.ycomp=q+R[1]-this.deltaY;this.offset=this.cumulativeOffset(A);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+A.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+A.offsetWidth);},overlap:function(A,h){if(!A){return 0;}if(A=="vertical"){return ((this.offset[1]+h.offsetHeight)-this.ycomp)/h.offsetHeight;}if(A=="horizontal"){return ((this.offset[0]+h.offsetWidth)-this.xcomp)/h.offsetWidth;}},clone:function(A,R){A=$(A);R=$(R);R.style.position="absolute";var h=this.cumulativeOffset(A);R.style.top=h[1]+"px";R.style.left=h[0]+"px";R.style.width=A.offsetWidth+"px";R.style.height=A.offsetHeight+"px";},page:function(q){var h=0,R=0;var A=q;do{h+=A.offsetTop||0;R+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break;}}}while(A=A.offsetParent);A=q;do{h-=A.scrollTop||0;R-=A.scrollLeft||0;}while(A=A.parentNode);return [R,h];},clone:function(R,w){var h=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});R=$(R);var q=Position.page(R);w=$(w);var x=[0,0];var A=null;if(Element.getStyle(w,"position")=="absolute"){A=Position.offsetParent(w);x=Position.page(A);}if(A==document.body){x[0]-=document.body.offsetLeft;x[1]-=document.body.offsetTop;}if(h.setLeft){w.style.left=(q[0]-x[0]+h.offsetLeft)+"px";}if(h.setTop){w.style.top=(q[1]-x[1]+h.offsetTop)+"px";}if(h.setWidth){w.style.width=R.offsetWidth+"px";}if(h.setHeight){w.style.height=R.offsetHeight+"px";}},absolutize:function(A){A=$(A);if(A.style.position=="absolute"){return ;}Position.prepare();var q=Position.positionedOffset(A);var x=q[1];var w=q[0];var R=A.clientWidth;var h=A.clientHeight;A._originalLeft=w-parseFloat(A.style.left||0);A._originalTop=x-parseFloat(A.style.top||0);A._originalWidth=A.style.width;A._originalHeight=A.style.height;A.style.position="absolute";A.style.top=x+"px";A.style.left=w+"px";A.style.width=R+"px";A.style.height=h+"px";},relativize:function(h){h=$(h);if(h.style.position=="relative"){return ;}Position.prepare();h.style.position="relative";var R=parseFloat(h.style.top||0)-(h._originalTop||0);var A=parseFloat(h.style.left||0)-(h._originalLeft||0);h.style.top=R+"px";h.style.left=A+"px";h.style.height=h._originalHeight;h.style.width=h._originalWidth;}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(A){var h=0,R=0;do{h+=A.offsetTop||0;R+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break;}}A=A.offsetParent;}while(A);return [R,h];};}