If you look at the source code of your example ;
$(document).click(function(){
$('.ddcontainer > div > ol').hide();
});
This hides the div when there has been a click on the document.
Give you div an ID like so:
and then:
$(document).click(function(){
$('#searchResults').hide();
});
Alternatively and maybe a better solution is to use focus and blur:
$("#kwd_search").focus(function(){
$('#searchResults').show();
}).blur(function(){
$('#searchResults').hide();
});
This will show the results when the focus is put onto the input, and removes it when you 'leave' the input.
UPDATE
With the autocomplete plugin, you can perform a task after the item has been selected like this:
$( "#tags" ).autocomplete({
source: availableTags
}).bind( "autocompleteselect", function(event, ui) {
location.href = ui.item.value; // If the value of the item is a url, this will forward you to it
});