Using autocomplete and Scriptaculous

Using this fine page as a reference (http://metapundit.net/sections/blog/ajax_autocomplete_with_scriptaculous), I finally got the autocomplete function working as I wanted.
I wanted to show a venue with some extra info in brackets and when it was selected, to update a hidden input with the id of the venue from the database.
The secret to this was realising that even [...]