function lookup_sug(inputString) {
    if(inputString.length == 0) {

        // Hide the suggestion box.
        $('#suggestions').hide();
    } else {
	var category_id = 'all';
	$.post("rpc.php", {query_string: ""+inputString+"", categoryid : "" + category_id + "" }, function(data){
            if(data.length >0) {
                $('#suggestions').show();
                $('#autoSuggestionsList').html(data);
	    } else $('#suggestions').hide();
        });
    }
} 

function lookup_sug_adv(inputString) {
    if(inputString.length == 0) {

        // Hide the suggestion box.
        $('#suggestionsAdv').hide();
    } else {
	var category_id = 'all';
	$.post("rpc.php", {query_string: ""+inputString+"", categoryid : "" + category_id + "" }, function(data){
            if(data.length >0) {
                $('#suggestionsAdv').show();
                $('#autoSuggestionsListAdv').html(data);
           } else $('#suggestionsAdv').hide();
        });
    }
} 

function fill(thisValue) {
    //$('#inputString').val(thisValue);
    $('#suggestions').hide();
    window.location = thisValue;
}

function fill_adv(thisValue) {
    //$('#inputStringAdv').val(thisValue);
    $('#suggestionsAdv').hide();
    window.location = thisValue;
}


