Autocompleter.Request=new Class({Extends:Autocompleter,options:{postData:{},ajaxOptions:{},postVar:"value"},query:function(){var C=$unlink(this.options.postData)||{};C[this.options.postVar]=this.queryValue;var B=$(this.options.indicator);if(B){B.setStyle("display","")}var A=this.options.indicatorClass;if(A){this.element.addClass(A)}this.fireEvent("onRequest",[this.element,this.request,C,this.queryValue]);this.request.send({data:C})},queryResponse:function(){var B=$(this.options.indicator);if(B){B.setStyle("display","none")}var A=this.options.indicatorClass;if(A){this.element.removeClass(A)}return this.fireEvent("onComplete",[this.element,this.request])}});Autocompleter.Request.JSON=new Class({Extends:Autocompleter.Request,initialize:function(C,B,A){this.parent(C,A);this.request=new Request.JSON($merge({url:B,link:"cancel"},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(A){this.parent();this.update(A)}});Autocompleter.Request.HTML=new Class({Extends:Autocompleter.Request,initialize:function(C,B,A){this.parent(C,A);this.request=new Request.HTML($merge({url:B,link:"cancel",update:this.choices},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(A,B){this.parent();if(!B||!B.length){this.hideChoices()}else{this.choices.getChildren(this.options.choicesMatch).each(this.options.injectChoice||function(C){var D=C.innerHTML;C.inputValue=D;this.addChoiceEvents(C.set("html",this.markQueryValue(D)))},this);this.showChoices()}}});Autocompleter.Ajax={Base:Autocompleter.Request,Json:Autocompleter.Request.JSON,Xhtml:Autocompleter.Request.HTML};