rem: var row; var newHTML = matches[i].replace(regexp, '<span class="autoCompleteHighlight">' + source.value + '</span>'); 
add: var row, newHTML = matches[i].replace(regexp, '<span class="autoCompleteHighlight">$1</span>'); 
context: function autoCompleteRender(id) {    var autoCompleteId = id + '_autocomplete';    var source = document.getElementById(id);    var ac = document.getElementById(autoCompleteId);    if (!ac) {	ac = document.createElement('div');	ac.className = 'autoCompleteBackground';	ac.style.position = 'absolute';	ac.id = autoCompleteId;	document.body.appendChild(ac);    }    ac.style.top = eval(autoCompleteGetTop(source) + source.offsetHeight) + 'px';    ac.style.left = autoCompleteGetLeft(source) + 'px';    var matches = autoCompleteFindMatches(source.value, autoCompleteContexts[id]['results']);    // Escape regexp characters (quotemeta)..    escapedValue = source.value.replace(/([\\\[\]\{\}()^$.*+?|])/g, '\\$1');    var regexp = new RegExp(escapedValue, "i");    if (matches.length > 0) {	for (i = 0; i < Math.min(matches.length, 10); i++) {	    var row;	    var newHTML = matches[i].replace(regexp,		'<span class="autoCompleteHighlight">' + source.value + '</span>');	    if (i >= ac.childNodes.length) {		row = document.createElement('div');		ac.appendChild(row);	    } else {		row = ac.childNodes[i];		if (row.innerHTML == newHTML) {		    // Already up to date		    continue;		}	    }	    row.className = 'autoCompleteNotSelected';	    row.innerHTML = newHTML;	    row.ac_data = matches[i];	    row.ac_index = i;	    row.onmousedown = function() { source.value = this.ac_data };	    row.onmouseover = function() { autoCompleteSelect(id, this); };	    row.onmouseout = function() { autoCompleteDeselect(id); };	}	while (i < ac.childNodes.length) {	    ac.removeChild(ac.childNodes[i]);	}	ac.style.visibility = 'visible';	autoCompleteContexts[id]['current'] = -1;    } else {	ac.style.visibility = 'hidden';    }}
meta: 3727	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3727/e8500290086939a6af06356c22e65f086cf7cb43/AutoComplete.js/buggy/gallery2/lib/javascript/AutoComplete.js