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(b,a,d){a=a||{};d=d||[];b=b.toLowerCase();var c=new Element(b,a);for(var e=0;e<d.length;e++){if(typeof d[e]=="string"){d[e]=document.createTextNode(d[e])}c.appendChild(d[e])}return $(c)}};(function(){var c=("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 a,b=0;while(a=c[b++]){window["$"+a]=DOM.Builder.tagFunc(a)}})();DOM.Builder.fromHTML=function(a){var b;if(!(b=arguments.callee._root)){b=arguments.callee._root=document.createElement("div")}b.innerHTML=a;return b.childNodes[0]};Object.extend(Event,{onReady:function(a){if(document.body){a()}else{document.observe("dom:loaded",a)}}});Event.addBehavior=function(a){var b=this.addBehavior;Object.extend(b.rules,a);if(!b.responderApplied){Ajax.Responders.register({onComplete:function(){if(Event.addBehavior.reassignAfterAjax){setTimeout(function(){b.reload()},10)}}});b.responderApplied=true}if(b.autoTrigger){this.onReady(b.load.bind(b,a))}};Event.delegate=function(a){return function(d){var c=$(d.element());for(var b in a){if(c.match(b)){return a[b].apply(this,$A(arguments))}}}};Object.extend(Event.addBehavior,{rules:{},cache:[],reassignAfterAjax:false,autoTrigger:true,load:function(b){for(var c in b){var a=b[c];var d=c.split(",");d.each(function(h){var g=h.split(/:(?=[a-z]+$)/),e=g[0],f=g[1];$$(e).each(function(j){if(f){var i=Event.addBehavior._wrapObserver(a);$(j).observe(f,i);Event.addBehavior.cache.push([j,f,i])}else{if(!j.$$assigned||!j.$$assigned.include(a)){if(a.attach){a.attach(j)}else{a.call($(j))}j.$$assigned=j.$$assigned||[];j.$$assigned.push(a)}}})})}},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 a=null,b=$A(arguments);if(Object.isFunction(b[0])){a=b.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=a;e.subclasses=[];e.instances=[];if(a){var d=function(){};d.prototype=a.prototype;e.prototype=new d;a.subclasses.push(e)}for(var c=0;c<b.length;c++){e.addMethods(b[c])}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(b){for(var c in b){var a=c.match(/^on(.+)/);if(a&&typeof b[c]=="function"){b.element.observe(a[1],Event.addBehavior._wrapObserver(b[c].bindAsEventListener(b)))}}}}};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(a){var b=a.element();if(["input","button"].include(b.nodeName.toLowerCase())&&b.type=="submit"){this._submitButton=b}},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)}});