Moved autocomplete code to dialog.autocomplete.js