LowPro={};LowPro.Version="0.5";LowPro.CompatibleWithPrototype="1.6";if(Prototype.Version.indexOf(LowPro.CompatibleWithPrototype)!=0&&window.console&&window.console.warn){console.warn("This version of Low Pro is tested with Prototype "+LowPro.CompatibleWithPrototype+" it may not work as expected with this version ("+Prototype.Version+")")}if(!Element.addMethods){Element.addMethods=function(a){Object.extend(Element.Methods,a)}}DOM={};DOM.Builder={tagFunc:function(a){return function(){var b,c;if(arguments.length>0){if(arguments[0].constructor==Object){b=arguments[0];c=Array.prototype.slice.call(arguments,1)}else{c=arguments}c=$A(c).flatten()}return DOM.Builder.create(a,b,c)}},create:function(a,b,d){b=b||{};d=d||[];a=a.toLowerCase();var e=new Element(a,b);for(var c=0;c<d.length;c++){if(typeof d[c]=="string"){d[c]=document.createTextNode(d[c])}e.appendChild(d[c])}return $(e)}};(function(){var b=("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|label|dfn|kbd|samp|var").split("|");var c,a=0;while(c=b[a++]){window["$"+c]=DOM.Builder.tagFunc(c)}})();DOM.Builder.fromHTML=function(b){var a;if(!(a=arguments.callee._root)){a=arguments.callee._root=document.createElement("div")}a.innerHTML=b;return a.childNodes[0]};Object.extend(Event,{onReady:function(a){if(document.body){a()}else{document.observe("dom:loaded",a)}}});Event.addBehavior=function(b){var a=this.addBehavior;Object.extend(a.rules,b);if(!a.responderApplied){Ajax.Responders.register({onComplete:function(){if(Event.addBehavior.reassignAfterAjax){setTimeout(function(){a.reload()},10)}}});a.responderApplied=true}if(a.autoTrigger){this.onReady(a.load.bind(a,b))}};Event.delegate=function(a){return function(d){var c=$(d.element());for(var b in a){if(c.match&&c.match(b)){return a[b].apply(this,$A(arguments))}}}};Object.extend(Event.addBehavior,{rules:{},cache:[],reassignAfterAjax:false,autoTrigger:true,load:function(d){for(var b in d){var c=d[b];var a=b.split(",");a.each(function(g){var h=g.split(/:(?=[a-z]+$)/),e=h[0],f=h[1];$$(e).each(function(i){if(f){var j=Event.addBehavior._wrapObserver(c);$(i).observe(f,j);Event.addBehavior.cache.push([i,f,j])}else{if(!i.$$assigned||!i.$$assigned.include(c)){if(c.attach){c.attach(i)}else{c.call($(i))}i.$$assigned=i.$$assigned||[];i.$$assigned.push(c)}}})})}},unload:function(){this.cache.each(function(a){Event.stopObserving.apply(Event,a)});this.cache=[]},reload:function(){var a=Event.addBehavior;a.unload();a.load(a.rules)},_wrapObserver:function(a){return function(b){if(a.call(this,b)===false){b.stop()}}}});Event.observe(window,"unload",Event.addBehavior.unload.bind(Event.addBehavior));$$$=Event.addBehavior.bind(Event);var Behavior={create:function(){var d=null,c=$A(arguments);if(Object.isFunction(c[0])){d=c.shift()}var e=function(){if(!this.initialize){var f=$A(arguments);return function(){var g=[this].concat(f);e.attach.apply(e,g)}}else{var f=(arguments.length==2&&arguments[1] instanceof Array)?arguments[1]:Array.prototype.slice.call(arguments,1);this.element=$(arguments[0]);this.initialize.apply(this,f);e._bindEvents(this);e.instances.push(this)}};Object.extend(e,Class.Methods);Object.extend(e,Behavior.Methods);e.superclass=d;e.subclasses=[];e.instances=[];if(d){var a=function(){};a.prototype=d.prototype;e.prototype=new a;d.subclasses.push(e)}for(var b=0;b<c.length;b++){e.addMethods(c[b])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e},Methods:{attach:function(a){return new this(a,Array.prototype.slice.call(arguments,1))},_bindEvents:function(a){for(var c in a){var b=c.match(/^on(.+)/);if(b&&typeof a[c]=="function"){a.element.observe(b[1],Event.addBehavior._wrapObserver(a[c].bindAsEventListener(a)))}}}}};Remote=Behavior.create({initialize:function(a){if(this.element.nodeName=="FORM"){new Remote.Form(this.element,a)}else{new Remote.Link(this.element,a)}}});Remote.Base={initialize:function(a){this.options=Object.extend({evaluateScripts:true},a||{});this._bindCallbacks()},_makeRequest:function(a){if(a.update){new Ajax.Updater(a.update,a.url,a)}else{new Ajax.Request(a.url,a)}return false},_bindCallbacks:function(){$w("onCreate onComplete onException onFailure onInteractive onLoading onLoaded onSuccess").each(function(a){if(Object.isFunction(this.options[a])){this.options[a]=this.options[a].bind(this)}}.bind(this))}};Remote.Link=Behavior.create(Remote.Base,{onclick:function(){var a=Object.extend({url:this.element.href,method:"get"},this.options);return this._makeRequest(a)}});Remote.Form=Behavior.create(Remote.Base,{onclick:function(b){var a=b.element();if(["input","button"].include(a.nodeName.toLowerCase())&&a.type=="submit"){this._submitButton=a}},onsubmit:function(){var a=Object.extend({url:this.element.action,method:this.element.method||"get",parameters:this.element.serialize({submit:this._submitButton.name})},this.options);this._submitButton=null;return this._makeRequest(a)}});Observed=Behavior.create({initialize:function(b,a){this.callback=b.bind(this);this.options=a||{};this.observer=(this.element.nodeName=="FORM")?this._observeForm():this._observeField()},stop:function(){this.observer.stop()},_observeForm:function(){return(this.options.frequency)?new Form.Observer(this.element,this.options.frequency,this.callback):new Form.EventObserver(this.element,this.callback)},_observeField:function(){return(this.options.frequency)?new Form.Element.Observer(this.element,this.options.frequency,this.callback):new Form.Element.EventObserver(this.element,this.callback)}});