﻿$.Autocompleter.defaults = {
    inputClass: "ac_input",
    resultsClass: "ac_results",
    loadingClass: "ac_loading",
    minChars: 2,
    delay: 400,
    matchCase: false,
    matchSubset: true,
    matchContains: true,
    cacheLength: 10,
    max: 10,
    mustMatch: false,
    extraParams: {},
    //selectFirst: true,
    selectFirst: false,
    formatItem: function (row) { return row[0]; },
    formatMatch: null,
    autoFill: false,
    width: 0,
    multiple: false,
    multipleSeparator: ", ",
    highlight: function (value, term) {
        return value.replace(new RegExp("(^|\s)(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1<strong>$2</strong>");
        //return value.replace(new RegExp('^(' + term + ')([\s\S]+)$', 'gi'), '<strong>$1<strong>$2');
        //return Regex.Replace(str, "(" + Regex.Escape(result.Keywords) + ")", string.Format("$1<b style=\"background-color:#ff0;{0}\">$2</b>", fontweight), RegexOptions.IgnoreCase);
        //return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
    },
    scroll: false,
    scrollHeight: 180
};
