rem: gSubscribeTree.selectItem( currItem ); gSubscribeTree.ensureElementIsVisible( currItem ); return; 
add: SelectFirstMatch(lastLow, i, node.childNodes, aMatchString); return; 
context: function selectNodeByName( aMatchString ){  var lastDot = aMatchString.lastIndexOf(gFolderDelimiter);  var nodeValue = lastDot != -1 ? aMatchString.substring(0, lastDot) : aMatchString;    var chain = aMatchString.split(gFolderDelimiter);  var node;  if( chain.length == 1 ) {	if (lastTreeChildrenValue != "") {    	node = getTreechildren(gSubscribeTree);    	if( !node ) return;		lastTreeChildrenValue = "";		lastTreeChildren = node;		//dump("cache miss!\n");	}	else {		node = lastTreeChildren;		//dump("cache hit!\n");	}  }  else {	// if we can, use the cached tree children	if (nodeValue != lastTreeChildrenValue) {    	node = gSubscribeTree.getElementsByAttribute("name",nodeValue)[0];		// expand the node, if we need to    	if( node.getAttribute("container") == "true" &&         	node.getAttribute("open") != "true" ) {      		node.setAttribute("open","true");		}    	node = getTreechildren(node);    	//dump("*** node = " + node.localName + "\n");		lastTreeChildren = node;		lastTreeChildrenValue = nodeValue;		//dump("cache miss!\n");	}	else {		//dump("cache hit!\n");		node = lastTreeChildren;	}  }    // find the match, using a binary search.  var totalItems = node.childNodes.length;  if (totalItems == 0) return;  var lastLow = 0;  var lastHigh = totalItems;  while (true) {  	var i = Math.floor((lastHigh + lastLow) / 2);	//dump(i+","+lastLow+","+lastHigh+"\n");	var currItem = node.childNodes[i];	var currValue = (currItem.getAttribute("name")).substring(0,aMatchString.length);	//dump(currValue+" vs "+aMatchString+"\n");	if (currValue > aMatchString) {		if (lastHigh == i) return;		lastHigh = i;    }	else if (currValue < aMatchString) {		if (lastLow == i) return;		lastLow = i;	}	else {      gSubscribeTree.selectItem( currItem );      gSubscribeTree.ensureElementIsVisible( currItem );	  return;	}  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/3a79a2ff9bf6c3e0320be41803c1ce6dd02cfba4/subscribe.js/buggy/mailnews/base/resources/content/subscribe.js