fixed autocomplete. Clicking a result in autocomplete now populates the field.

Added code for the pop-up.