(function($){return $.fn.ajaxChosen=function(settings,callback,chosenOptions){var chosenXhr,defaultOptions,options,select;if(settings==null){settings={};}
if(callback==null){callback={};}
if(chosenOptions==null){chosenOptions=function(){};}
defaultOptions={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term",keepTypingMsg:"Keep typing...",lookingForMsg:"Looking for"};select=this;chosenXhr=null;options=$.extend({},defaultOptions,$(select).data(),settings);this.chosen(chosenOptions?chosenOptions:{});return this.each(function(){return $(this).next('.chzn-container').find(".search-field > input, .chzn-search > input").bind('keyup',function(){var field,msg,success,untrimmed_val,val;untrimmed_val=$(this).val();val=$(this).val();msg=val.length");}
group.attr('label',element.text).appendTo(select);return $.each(element.items,function(i,element){var text,value;if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
if($.inArray(value+"-"+text,selected_values)===-1){return $("").attr('value',value).html(text).appendTo(group);}});}else{if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
if($.inArray(value+"-"+text,selected_values)===-1){return $("").attr('value',value).html(text).appendTo(select);}}});if(nbItems){select.trigger("liszt:updated");}else{select.data().chosen.no_results_clear();select.data().chosen.no_results(field.val());}
if(success!=null){success(data);}
return field.attr('value',untrimmed_val);};return this.timer=setTimeout(function(){if(chosenXhr){chosenXhr.abort();}
return chosenXhr=$.ajax(options);},options.afterTypeDelay);});});};})(jQuery);