zk.load('zkmax.inp', function () {
    var _xChosenbox = {};
    zk.override(zkmax.inp.Chosenbox.prototype,
        _xChosenbox,
        {
            _fixSelDisplay: function (hliteFirst, str, fromServer) {
                var pp = this.$n('pp'),
                    $pp = jq(pp),
                    maxh = this._ppMaxHeight,
                    ppstyle = pp.style,
                    selItems = this._selItems,
                    options = jq(this.$n('sel')).children(),
                    found = false,
                    exist = false,
                    index, element, showAll, selected;
                str = str ? str.trim() : '';
                showAll = str && str == this._emptyMessage || str == '';

                for (index = 0, element = options[index];
                     index < options.length;
                     index++, element = options[index]) {

                    selected = selItems.indexOf(element.innerHTML) != -1;
                    if (fromServer || !selected) {
                        if (!selected &&
                            (showAll || this._renderByServer || str && (element.innerHTML.toLowerCase().indexOf(str.toLowerCase()) != -1)))
                        {
                            if (!found) {
                                found = true;
                                if (hliteFirst)
                                    this._hliteOpt(element, true);
                            }
                            element.style.display = 'block';
                        }
                        else {
                            this._hliteOpt(element, false);
                            element.style.display = 'none';
                        }
                    }
                    if (!exist && str && element.innerHTML.toLowerCase() == str.toLowerCase())
                        exist = true;
                }
                ppstyle.height = 'auto';
                if ($pp.height() > maxh)
                    ppstyle.height = maxh + 'px';
                return {_found: found, _exist: exist};
            }
        });
});