text: /*
  	jQuery autoComplete v1.0.7
      Copyright (c) 2014 Simon Steinberger / Pixabay
      GitHub: https://github.com/Pixabay/jQuery-autoComplete
  	License: http://www.opensource.org/licenses/mit-license.php
  */
  
  !function(a){a.fn.autoComplete=function(b){var c=a.extend({},a.fn.autoComplete.defaults,b);return"string"==typeof b?(this.each(function(){var c=a(this);console.log(c.data("autocomplete")),console.log(c.data("autocomplete")?"autoComplete: true":"autoComplete: false"),"destroy"==b&&(a(window).off("resize.autocomplete",c.updateSC),c.off("blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete"),c.data("autocomplete")?c.attr("autocomplete",c.data("autocomplete")):c.removeAttr("autocomplete"),a(c.data("sc")).remove(),c.removeData("sc").removeData("autocomplete"))}),this):this.each(function(){function d(a){var d=b.val();if(b.cache[d]=a,a.length&&d.length>=c.minChars){for(var e="",f=0;f<a.length;f++)e+=c.renderItem(a[f],d);b.sc.html(e),b.updateSC(0)}else b.sc.hide()}var b=a(this);b.sc=a('<div class="autocomplete-suggestions '+c.menuClass+'"></div>'),b.data("sc",b.sc).data("autocomplete",b.attr("autocomplete")),b.attr("autocomplete","off"),b.cache={},b.last_val="",b.updateSC=function(c,d){if(b.sc.css({top:b.offset().top+b.outerHeight(),left:b.offset().left,width:b.outerWidth()+38}),!c&&(b.sc.show(),b.sc.maxHeight||(b.sc.maxHeight=parseInt(b.sc.css("max-height"))),b.sc.suggestionHeight||(b.sc.suggestionHeight=a(".autocomplete-suggestion",b.sc).first().outerHeight()),b.sc.suggestionHeight))if(d){var e=b.sc.scrollTop(),f=d.offset().top-b.sc.offset().top;f+b.sc.suggestionHeight-b.sc.maxHeight>0?b.sc.scrollTop(f+b.sc.suggestionHeight+e-b.sc.maxHeight):f<0&&b.sc.scrollTop(f+e)}else b.sc.scrollTop(0)},a(window).on("resize.autocomplete",b.updateSC),b.sc.appendTo("body"),b.sc.on("mouseleave",".autocomplete-suggestion",function(){a(".autocomplete-suggestion.selected").removeClass("selected")}),b.sc.on("mouseenter",".autocomplete-suggestion",function(){a(".autocomplete-suggestion.selected").removeClass("selected"),a(this).addClass("selected")}),b.sc.on("mousedown",".autocomplete-suggestion",function(d){var e=a(this),f=e.data("val");return(f||e.hasClass("autocomplete-suggestion"))&&(b.val(f),c.onSelect(d,f,e),b.sc.hide()),!1}),b.on("blur.autocomplete",function(){try{over_sb=a(".autocomplete-suggestions:hover").length}catch(c){over_sb=0}over_sb?b.is(":focus")||setTimeout(function(){b.focus()},20):(b.last_val=b.val(),b.sc.hide(),setTimeout(function(){b.sc.hide()},350))}),c.minChars||b.on("focus.autocomplete",function(){b.last_val="\n",b.trigger("keyup.autocomplete")}),b.on("keydown.autocomplete",function(d){if((40==d.which||38==d.which)&&b.sc.html()){var e,f=a(".autocomplete-suggestion.selected",b.sc);return f.length?(e=40==d.which?f.next(".autocomplete-suggestion"):f.prev(".autocomplete-suggestion"),e.length?(f.removeClass("selected"),b.val(e.addClass("selected").data("val"))):(f.removeClass("selected"),b.val(b.last_val),e=0)):(e=40==d.which?a(".autocomplete-suggestion",b.sc).first():a(".autocomplete-suggestion",b.sc).last(),b.val(e.addClass("selected").data("val"))),b.updateSC(0,e),!1}if(27==d.which)b.val(b.last_val).sc.hide();else if(13==d.which||9==d.which){var f=a(".autocomplete-suggestion.selected",b.sc);f.length&&b.sc.is(":visible")&&(c.onSelect(d,f.data("val"),f),setTimeout(function(){b.sc.hide()},20))}}),b.on("keyup.autocomplete",function(e){if(!~a.inArray(e.which,[13,27,35,36,37,38,39,40])){var f=b.val();if(f.length>=c.minChars){if(f!=b.last_val){if(b.last_val=f,clearTimeout(b.timer),c.cache){if(f in b.cache)return void d(b.cache[f]);for(var g=1;g<f.length-c.minChars;g++){var h=f.slice(0,f.length-g);if(h in b.cache&&!b.cache[h].length)return void d([])}}b.timer=setTimeout(function(){c.source(f,d)},c.delay)}}else b.last_val=f,b.sc.hide()}})})},a.fn.autoComplete.defaults={source:0,minChars:3,delay:150,cache:1,menuClass:"",renderItem:function(a,b){b=b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var c=new RegExp("("+b.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+a+'">'+a.replace(c,"<b>$1</b>")+"</div>"},onSelect:function(){}}}(jQuery);
  