var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(Z){return Z;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(Z,I){for(property in I){Z[property]=I[property];}return Z;};Object.inspect=function(Z){try{if(Z==undefined){return "undefined";}if(Z==null){return "null";}return Z.inspect?Z.inspect():Z.toString();}catch(I){if(I instanceof RangeError){return "...";}throw I;}};Function.prototype.bind=function(){var Z=this,O=$A(arguments),I=O.shift();return function(){return Z.apply(I,O.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(I){var Z=this;return function(O){return Z.call(I,O||window.event);};};Object.extend(Number.prototype,{toColorPart:function(){var Z=this.toString(16);if(this<16){return "0"+Z;}return Z;},succ:function(){return this+1;},times:function(Z){$R(0,this,true).each(Z);return this;}});var Try={these:function(){var O;for(var I=0;I<arguments.length;I++){var Z=arguments[I];try{O=Z();break;}catch(H){}}return O;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(I,Z){this.callback=I;this.frequency=Z;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;}}}};function $(){var O=new Array();for(var I=0;I<arguments.length;I++){var Z=arguments[I];if(typeof Z=="string"){Z=document.getElementById(Z);}if(arguments.length==1){return Z;}O.push(Z);}return O;}Object.extend(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var I=new RegExp(Prototype.ScriptFragment,"img");var Z=new RegExp(Prototype.ScriptFragment,"im");return (this.match(I)||[]).map(function(O){return (O.match(Z)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(eval);},escapeHTML:function(){var I=document.createElement("div");var Z=document.createTextNode(this);I.appendChild(Z);return I.innerHTML;},unescapeHTML:function(){var Z=document.createElement("div");Z.innerHTML=this.stripTags();return Z.childNodes[0]?Z.childNodes[0].nodeValue:"";},toQueryParams:function(){var Z=this.match(/^\??(.*)$/)[1].split("&");return Z.inject({},function(H,I){var O=I.split("=");H[O[0]]=O[1];return H;});},toArray:function(){return this.split("");},camelize:function(){var H=this.split("-");if(H.length==1){return H[0];}var I=this.indexOf("-")==0?H[0].charAt(0).toUpperCase()+H[0].substring(1):H[0];for(var O=1,Z=H.length;O<Z;O++){var S=H[O];I+=S.charAt(0).toUpperCase()+S.substring(1);}return I;},inspect:function(){return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'";}});String.prototype.parseQuery=String.prototype.toQueryParams;var $break=new Object();var $continue=new Object();var Enumerable={each:function(I){var Z=0;try{this._each(function(H){try{I(H,Z++);}catch(S){if(S!=$continue){throw S;}}});}catch(O){if(O!=$break){throw O;}}},all:function(I){var Z=true;this.each(function(H,O){Z=Z&&!!(I||Prototype.K)(H,O);if(!Z){throw $break;}});return Z;},any:function(I){var Z=true;this.each(function(H,O){if(Z=!!(I||Prototype.K)(H,O)){throw $break;}});return Z;},collect:function(I){var Z=[];this.each(function(H,O){Z.push(I(H,O));});return Z;},detect:function(I){var Z;this.each(function(H,O){if(I(H,O)){Z=H;throw $break;}});return Z;},findAll:function(I){var Z=[];this.each(function(H,O){if(I(H,O)){Z.push(H);}});return Z;},grep:function(O,I){var Z=[];this.each(function(R,S){var H=R.toString();if(H.match(O)){Z.push((I||Prototype.K)(R,S));}});return Z;},include:function(Z){var I=false;this.each(function(O){if(O==Z){I=true;throw $break;}});return I;},inject:function(Z,I){this.each(function(H,O){Z=I(Z,H,O);});return Z;},invoke:function(I){var Z=$A(arguments).slice(1);return this.collect(function(O){return O[I].apply(O,Z);});},max:function(I){var Z;this.each(function(H,O){H=(I||Prototype.K)(H,O);if(H>=(Z||H)){Z=H;}});return Z;},min:function(I){var Z;this.each(function(H,O){H=(I||Prototype.K)(H,O);if(H<=(Z||H)){Z=H;}});return Z;},partition:function(O){var I=[],Z=[];this.each(function(S,H){((O||Prototype.K)(S,H)?I:Z).push(S);});return [I,Z];},pluck:function(I){var Z=[];this.each(function(H,O){Z.push(H[I]);});return Z;},reject:function(I){var Z=[];this.each(function(H,O){if(!I(H,O)){Z.push(H);}});return Z;},sortBy:function(Z){return this.collect(function(O,I){return {value:O,criteria:Z(O,I)};}).sort(function(S,H){var O=S.criteria,I=H.criteria;return O<I?-1:O>I?1:0;}).pluck("value");},toArray:function(){return this.collect(Prototype.K);},zip:function(){var I=Prototype.K,Z=$A(arguments);if(typeof Z.last()=="function"){I=Z.pop();}var O=[this].concat(Z).map($A);return this.map(function(S,H){I(S=O.pluck(H));return S;});},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(O){if(!O){return [];}if(O.toArray){return O.toArray();}else{var I=[];for(var Z=0;Z<O.length;Z++){I.push(O[Z]);}return I;}};Object.extend(Array.prototype,Enumerable);Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(I){for(var Z=0;Z<this.length;Z++){I(this[Z]);}},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(Z){return Z!=undefined||Z!=null;});},flatten:function(){return this.inject([],function(I,Z){return I.concat(Z.constructor==Array?Z.flatten():[Z]);});},without:function(){var Z=$A(arguments);return this.select(function(I){return !Z.include(I);});},indexOf:function(Z){for(var I=0;I<this.length;I++){if(this[I]==Z){return I;}}return -1;},reverse:function(Z){return (Z!==false?this:this.toArray())._reverse();},shift:function(){var Z=this[0];for(var I=0;I<this.length-1;I++){this[I]=this[I+1];}this.length--;return Z;},inspect:function(){return "["+this.map(Object.inspect).join(", ")+"]";}});var Hash={_each:function(Z){for(key in this){var I=this[key];if(typeof I=="function"){continue;}var O=[key,I];O.key=key;O.value=I;Z(O);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(Z){return $H(Z).inject($H(this),function(I,O){I[O.key]=O.value;return I;});},toQueryString:function(){return this.map(function(Z){return Z.map(encodeURIComponent).join("=");}).join("&");},inspect:function(){return "#<Hash:{"+this.map(function(Z){return Z.map(Object.inspect).join(": ");}).join(", ")+"}>";}};function $H(Z){var I=Object.extend({},Z||{});Object.extend(I,Enumerable);Object.extend(I,Hash);return I;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(O,Z,I){this.start=O;this.end=Z;this.exclusive=I;},_each:function(Z){var I=this.start;do{Z(I);I=I.succ();}while(this.include(I));},include:function(Z){if(Z<this.start){return false;}if(this.exclusive){return Z<this.end;}return Z<=this.end;}});var $R=function(O,Z,I){return new ObjectRange(O,Z,I);};var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");},function(){return new XMLHttpRequest();})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(Z){this.responders._each(Z);},register:function(Z){if(!this.include(Z)){this.responders.push(Z);}},unregister:function(Z){this.responders=this.responders.without(Z);},dispatch:function(H,I,O,Z){this.each(function(S){if(S[H]&&typeof S[H]=="function"){try{S[H].apply(S,[I,O,Z]);}catch(R){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(Z){this.options={method:"post",asynchronous:true,parameters:""};Object.extend(this.options,Z||{});},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(I,Z){this.transport=Ajax.getTransport();this.setOptions(Z);this.request(I);},request:function(I){var O=this.options.parameters||"";if(O.length>0){O+="&_=";}try{this.url=I;if(this.options.method=="get"&&O.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+O;}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 Z=this.options.postBody?this.options.postBody:O;this.transport.send(this.options.method=="post"?Z:null);}catch(H){this.dispatchException(H);}},setRequestHeaders:function(){var I=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];if(this.options.method=="post"){I.push("Content-type","application/x-www-form-urlencoded");if(this.transport.overrideMimeType){I.push("Connection","close");}}if(this.options.requestHeaders){I.push.apply(I,this.options.requestHeaders);}for(var Z=0;Z<I.length;Z+=2){this.transport.setRequestHeader(I[Z],I[Z+1]);}},onStateChange:function(){var Z=this.transport.readyState;if(Z!=1){this.respondToReadyState(this.transport.readyState);}},header:function(Z){try{return this.transport.getResponseHeader(Z);}catch(I){}},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(Z){var O=Ajax.Request.Events[Z];var S=this.transport,I=this.evalJSON();if(O=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(S,I);}catch(H){this.dispatchException(H);}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse();}}try{(this.options["on"+O]||Prototype.emptyFunction)(S,I);Ajax.Responders.dispatch("on"+O,this,S,I);}catch(H){this.dispatchException(H);}if(O=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},dispatchException:function(Z){(this.options.onException||Prototype.emptyFunction)(this,Z);Ajax.Responders.dispatch("onException",this,Z);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(Z,O,I){this.containers={success:Z.success?$(Z.success):$(Z),failure:Z.failure?$(Z.failure):(Z.success?null:$(Z))};this.transport=Ajax.getTransport();this.setOptions(I);var H=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(R,S){this.updateContent();H(R,S);}).bind(this);this.request(O);},updateContent:function(){var I=this.responseIsSuccess()?this.containers.success:this.containers.failure;var Z=this.transport.responseText;if(!this.options.evalScripts){Z=Z.stripScripts();}if(I){if(this.options.insertion){new this.options.insertion(I,Z);}else{Element.update(I,Z);}}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(Z,O,I){this.setOptions(I);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=Z;this.url=O;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(Z){if(this.options.decay){this.decay=(Z.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=Z.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);}});document.getElementsByClassName=function(O,Z){var I=($(Z)||document.body).getElementsByTagName("*");return $A(I).inject([],function(H,S){if(S.className.match(new RegExp("(^|\\s)"+O+"(\\s|$)"))){H.push(S);}return H;});};if(!window.Element){var Element=new Object();}Object.extend(Element,{visible:function(Z){return $(Z).style.display!="none";},toggle:function(){for(var I=0;I<arguments.length;I++){var Z=$(arguments[I]);Element[Element.visible(Z)?"hide":"show"](Z);}},hide:function(){for(var I=0;I<arguments.length;I++){var Z=$(arguments[I]);Z.style.display="none";}},show:function(){for(var I=0;I<arguments.length;I++){var Z=$(arguments[I]);Z.style.display="";}},remove:function(Z){Z=$(Z);Z.parentNode.removeChild(Z);},update:function(I,Z){$(I).innerHTML=Z.stripScripts();setTimeout(function(){Z.evalScripts();},10);},getHeight:function(Z){Z=$(Z);return Z.offsetHeight;},classNames:function(Z){return new Element.ClassNames(Z);},hasClassName:function(Z,I){if(!(Z=$(Z))){return ;}return Element.classNames(Z).include(I);},addClassName:function(Z,I){if(!(Z=$(Z))){return ;}return Element.classNames(Z).add(I);},removeClassName:function(Z,I){if(!(Z=$(Z))){return ;}return Element.classNames(Z).remove(I);},cleanWhitespace:function(I){I=$(I);for(var Z=0;Z<I.childNodes.length;Z++){var O=I.childNodes[Z];if(O.nodeType==3&&!/\S/.test(O.nodeValue)){Element.remove(O);}}},empty:function(Z){return $(Z).innerHTML.match(/^\s*$/);},scrollTo:function(I){I=$(I);var Z=I.x?I.x:I.offsetLeft,O=I.y?I.y:I.offsetTop;window.scrollTo(Z,O);},getStyle:function(I,O){I=$(I);var H=I.style[O.camelize()];if(!H){if(document.defaultView&&document.defaultView.getComputedStyle){var Z=document.defaultView.getComputedStyle(I,null);H=Z?Z.getPropertyValue(O):null;}else{if(I.currentStyle){H=I.currentStyle[O.camelize()];}}}if(window.opera&&["left","top","right","bottom"].include(O)){if(Element.getStyle(I,"position")=="static"){H="auto";}}return H=="auto"?null:H;},setStyle:function(Z,I){Z=$(Z);for(name in I){Z.style[name.camelize()]=I[name];}},getDimensions:function(I){I=$(I);if(Element.getStyle(I,"display")!="none"){return {width:I.offsetWidth,height:I.offsetHeight};}var Z=I.style;var S=Z.visibility;var O=Z.position;Z.visibility="hidden";Z.position="absolute";Z.display="";var R=I.clientWidth;var H=I.clientHeight;Z.display="none";Z.position=O;Z.visibility=S;return {width:R,height:H};},makePositioned:function(Z){Z=$(Z);var I=Element.getStyle(Z,"position");if(I=="static"||!I){Z._madePositioned=true;Z.style.position="relative";if(window.opera){Z.style.top=0;Z.style.left=0;}}},undoPositioned:function(Z){Z=$(Z);if(Z._madePositioned){Z._madePositioned=undefined;Z.style.position=Z.style.top=Z.style.left=Z.style.bottom=Z.style.right="";}},makeClipping:function(Z){Z=$(Z);if(Z._overflow){return ;}Z._overflow=Z.style.overflow;if((Element.getStyle(Z,"overflow")||"visible")!="hidden"){Z.style.overflow="hidden";}},undoClipping:function(Z){Z=$(Z);if(Z._overflow){return ;}Z.style.overflow=Z._overflow;Z._overflow=undefined;}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(Z){this.adjacency=Z;};Abstract.Insertion.prototype={initialize:function(Z,I){this.element=$(Z);this.content=I.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(O){if(this.element.tagName.toLowerCase()=="tbody"){this.insertContent(this.contentFromAnonymousTable());}else{throw O;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){I.evalScripts();},10);},contentFromAnonymousTable:function(){var Z=document.createElement("div");Z.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(Z.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(Z){Z.each((function(I){this.element.parentNode.insertBefore(I,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(Z){Z.reverse(false).each((function(I){this.element.insertBefore(I,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(Z){Z.each((function(I){this.element.appendChild(I);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(Z){Z.each((function(I){this.element.parentNode.insertBefore(I,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(Z){this.element=$(Z);},_each:function(Z){this.element.className.split(/\s+/).select(function(I){return I.length>0;})._each(Z);},set:function(Z){this.element.className=Z;},add:function(Z){if(this.include(Z)){return ;}this.set(this.toArray().concat(Z).join(" "));},remove:function(Z){if(!this.include(Z)){return ;}this.set(this.select(function(I){return I!=Z;}).join(" "));},toString:function(){return this.toArray().join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Field={clear:function(){for(var Z=0;Z<arguments.length;Z++){$(arguments[Z]).value="";}},focus:function(Z){$(Z).focus();},present:function(){for(var Z=0;Z<arguments.length;Z++){if($(arguments[Z]).value==""){return false;}}return true;},select:function(Z){$(Z).select();},activate:function(Z){Z=$(Z);Z.focus();if(Z.select){Z.select();}}};var Form={serialize:function(H){var S=Form.getElements($(H));var O=new Array();for(var I=0;I<S.length;I++){var Z=Form.Element.serialize(S[I]);if(Z){O.push(Z);}}return O.join("&");},getElements:function(I){I=$(I);var O=new Array();for(tagName in Form.Element.Serializers){var H=I.getElementsByTagName(tagName);for(var Z=0;Z<H.length;Z++){O.push(H[Z]);}}return O;},getInputs:function(R,O,H){R=$(R);var Z=R.getElementsByTagName("input");if(!O&&!H){return Z;}var n=new Array();for(var S=0;S<Z.length;S++){var I=Z[S];if((O&&I.type!=O)||(H&&I.name!=H)){continue;}n.push(I);}return n;},disable:function(O){var H=Form.getElements(O);for(var I=0;I<H.length;I++){var Z=H[I];Z.blur();Z.disabled="true";}},enable:function(O){var H=Form.getElements(O);for(var I=0;I<H.length;I++){var Z=H[I];Z.disabled="";}},findFirstElement:function(Z){return Form.getElements(Z).find(function(I){return I.type!="hidden"&&!I.disabled&&["input","select","textarea"].include(I.tagName.toLowerCase());});},focusFirstElement:function(Z){Field.activate(Form.findFirstElement(Z));},reset:function(Z){$(Z).reset();}};Form.Element={serialize:function(I){I=$(I);var H=I.tagName.toLowerCase();var O=Form.Element.Serializers[H](I);if(O){var Z=encodeURIComponent(O[0]);if(Z.length==0){return ;}if(O[1].constructor!=Array){O[1]=[O[1]];}return O[1].map(function(S){return Z+"="+encodeURIComponent(S);}).join("&");}},getValue:function(Z){Z=$(Z);var O=Z.tagName.toLowerCase();var I=Form.Element.Serializers[O](Z);if(I){return I[1];}}};Form.Element.Serializers={input:function(Z){switch(Z.type.toLowerCase()){case "submit":case "hidden":case "password":case "text":return Form.Element.Serializers.textarea(Z);case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(Z);}return false;},inputSelector:function(Z){if(Z.checked){return [Z.name,Z.value];}},textarea:function(Z){return [Z.name,Z.value];},select:function(Z){return Form.Element.Serializers[Z.type=="select-one"?"selectOne":"selectMany"](Z);},selectOne:function(O){var H="",I,Z=O.selectedIndex;if(Z>=0){I=O.options[Z];H=I.value;if(!H&&!("value" in I)){H=I.text;}}return [O.name,H];},selectMany:function(O){var H=new Array();for(var I=0;I<O.length;I++){var Z=O.options[I];if(Z.selected){var S=Z.value;if(!S&&!("value" in Z)){S=Z.text;}H.push(S);}}return [O.name,H];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(Z,I,O){this.frequency=I;this.element=$(Z);this.callback=O;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var Z=this.getValue();if(this.lastValue!=Z){this.callback(this.element,Z);this.lastValue=Z;}}};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(Z,I){this.element=$(Z);this.callback=I;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var Z=this.getValue();if(this.lastValue!=Z){this.callback(this.element,Z);this.lastValue=Z;}},registerFormCallbacks:function(){var I=Form.getElements(this.element);for(var Z=0;Z<I.length;Z++){this.registerCallback(I[Z]);}},registerCallback:function(Z){if(Z.type){switch(Z.type.toLowerCase()){case "checkbox":case "radio":Event.observe(Z,"click",this.onElementEvent.bind(this));break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":Event.observe(Z,"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(Z){return Z.target||Z.srcElement;},isLeftClick:function(Z){return (((Z.which)&&(Z.which==1))||((Z.button)&&(Z.button==1)));},pointerX:function(Z){return Z.pageX||(Z.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(Z){return Z.pageY||(Z.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(Z){if(Z.preventDefault){Z.preventDefault();Z.stopPropagation();}else{Z.returnValue=false;Z.cancelBubble=true;}},findElement:function(O,I){var Z=Event.element(O);while(Z.parentNode&&(!Z.tagName||(Z.tagName.toUpperCase()!=I.toUpperCase()))){Z=Z.parentNode;}return Z;},observers:false,_observeAndCache:function(H,O,I,Z){if(!this.observers){this.observers=[];}if(H.addEventListener){this.observers.push([H,O,I,Z]);H.addEventListener(O,I,Z);}else{if(H.attachEvent){this.observers.push([H,O,I,Z]);H.attachEvent("on"+O,I);}}},unloadCache:function(){if(!Event.observers){return ;}for(var Z=0;Z<Event.observers.length;Z++){Event.stopObserving.apply(this,Event.observers[Z]);Event.observers[Z][0]=null;}Event.observers=false;},observe:function(H,O,I,Z){var H=$(H);Z=Z||false;if(O=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||H.attachEvent)){O="keydown";}this._observeAndCache(H,O,I,Z);},stopObserving:function(H,O,I,Z){var H=$(H);Z=Z||false;if(O=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||H.detachEvent)){O="keydown";}if(H.removeEventListener){H.removeEventListener(O,I,Z);}else{if(H.detachEvent){H.detachEvent("on"+O,I);}}}});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(I){var Z=0,O=0;do{Z+=I.scrollTop||0;O+=I.scrollLeft||0;I=I.parentNode;}while(I);return [O,Z];},cumulativeOffset:function(I){var Z=0,O=0;do{Z+=I.offsetTop||0;O+=I.offsetLeft||0;I=I.offsetParent;}while(I);return [O,Z];},positionedOffset:function(I){var Z=0,O=0;do{Z+=I.offsetTop||0;O+=I.offsetLeft||0;I=I.offsetParent;if(I){p=Element.getStyle(I,"position");if(p=="relative"||p=="absolute"){break;}}}while(I);return [O,Z];},offsetParent:function(Z){if(Z.offsetParent){return Z.offsetParent;}if(Z==document.body){return Z;}while((Z=Z.parentNode)&&Z!=document.body){if(Element.getStyle(Z,"position")!="static"){return Z;}}return document.body;},within:function(I,Z,O){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(I,Z,O);}this.xcomp=Z;this.ycomp=O;this.offset=this.cumulativeOffset(I);return (O>=this.offset[1]&&O<this.offset[1]+I.offsetHeight&&Z>=this.offset[0]&&Z<this.offset[0]+I.offsetWidth);},withinIncludingScrolloffsets:function(I,Z,H){var O=this.realOffset(I);this.xcomp=Z+O[0]-this.deltaX;this.ycomp=H+O[1]-this.deltaY;this.offset=this.cumulativeOffset(I);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+I.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+I.offsetWidth);},overlap:function(I,Z){if(!I){return 0;}if(I=="vertical"){return ((this.offset[1]+Z.offsetHeight)-this.ycomp)/Z.offsetHeight;}if(I=="horizontal"){return ((this.offset[0]+Z.offsetWidth)-this.xcomp)/Z.offsetWidth;}},clone:function(I,O){I=$(I);O=$(O);O.style.position="absolute";var Z=this.cumulativeOffset(I);O.style.top=Z[1]+"px";O.style.left=Z[0]+"px";O.style.width=I.offsetWidth+"px";O.style.height=I.offsetHeight+"px";},page:function(H){var Z=0,O=0;var I=H;do{Z+=I.offsetTop||0;O+=I.offsetLeft||0;if(I.offsetParent==document.body){if(Element.getStyle(I,"position")=="absolute"){break;}}}while(I=I.offsetParent);I=H;do{Z-=I.scrollTop||0;O-=I.scrollLeft||0;}while(I=I.parentNode);return [O,Z];},clone:function(O,S){var Z=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});O=$(O);var H=Position.page(O);S=$(S);var R=[0,0];var I=null;if(Element.getStyle(S,"position")=="absolute"){I=Position.offsetParent(S);R=Position.page(I);}if(I==document.body){R[0]-=document.body.offsetLeft;R[1]-=document.body.offsetTop;}if(Z.setLeft){S.style.left=(H[0]-R[0]+Z.offsetLeft)+"px";}if(Z.setTop){S.style.top=(H[1]-R[1]+Z.offsetTop)+"px";}if(Z.setWidth){S.style.width=O.offsetWidth+"px";}if(Z.setHeight){S.style.height=O.offsetHeight+"px";}},absolutize:function(I){I=$(I);if(I.style.position=="absolute"){return ;}Position.prepare();var H=Position.positionedOffset(I);var R=H[1];var S=H[0];var O=I.clientWidth;var Z=I.clientHeight;I._originalLeft=S-parseFloat(I.style.left||0);I._originalTop=R-parseFloat(I.style.top||0);I._originalWidth=I.style.width;I._originalHeight=I.style.height;I.style.position="absolute";I.style.top=R+"px";I.style.left=S+"px";I.style.width=O+"px";I.style.height=Z+"px";},relativize:function(Z){Z=$(Z);if(Z.style.position=="relative"){return ;}Position.prepare();Z.style.position="relative";var O=parseFloat(Z.style.top||0)-(Z._originalTop||0);var I=parseFloat(Z.style.left||0)-(Z._originalLeft||0);Z.style.top=O+"px";Z.style.left=I+"px";Z.style.height=Z._originalHeight;Z.style.width=Z._originalWidth;}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(I){var Z=0,O=0;do{Z+=I.offsetTop||0;O+=I.offsetLeft||0;if(I.offsetParent==document.body){if(Element.getStyle(I,"position")=="absolute"){break;}}I=I.offsetParent;}while(I);return [O,Z];};}