TPAC: AutoSuggest throws a JS error on login form
searchbar.tt2 includes a reference to the AutoSuggest widget that
results in an error if the dojo code has not been required, which is
par for the course. However, on the login form we disabled the
AutoSuggest inline code because we didn't want it to override the
autofocus for the login user name; unfortunately, the searchbar exists
on the login form, and a JS error is thrown. On most browsers, not a
problem, but on IE it throws up a nasty dialog if you have the
right/wrong settings.
The simplest way to resolve this is to not set autofocus if we're not on
the basic_search page, but keep the rest of the AutoSuggest code
around.
In addition, we can avoid some other undefined var warnings by stepping
carefully through the search for the dijit value.
Signed-off-by: Dan Scott <dscott@laurentian.ca>