function fillSearchResults(string) {
	
//	window.status = "Searching for: "+string;
	
	if(string.length == 0) {
		// Hide the suggestions
		$j('#searchResults').hide();
	} else {
		$j.post("/ajax/search.php", {search: string},
			function(html) {			
				if (html) {
					$j('#searchResults').show();
					if(html.length > 0) {
						$j('#searchResults').html('<select multiple="multiple" onchange="updateSearchField()" onclick="	$j(\'#searchResults\').hide();">'+html+'</select>');
					}
					else {	
						$j('#searchResults').html('');
					}
				}
				else {
					$j('#searchResults').html('');
				}		
			}
		);
	}
}

function selectSearchResults(e) {
	if (window.event) { // IE
	  keynum = e.keyCode;
  }
	else if(e.which) {
	  keynum = e.which;
  }
	if (keynum == 40 || keynum == 9) {
		// If the user presses the down arrow, or TAB, jump to the results list
		// IE may not fire the event on TAB: this is TBC
		
		$j('#searchResults select').focus();
		$j('#searchResults select')[0].selectedIndex = 0;
		updateSearchField();
		
		return false;
	}
}

function updateSearchField() {
	var option = $j("#searchResults select option:selected").val();
	$j("#search").val(option);
}

function runSearch() {
	$j('#searchResults').hide();
	var keyword = $j("#search").val();
	setCategory('search',keyword);
	return false;
}

/*
function initFill() {
	setTimeout("fill()", 500);
}
function fill() {
	var string = $j("#search").val();
	search(string);
}
*/