#2197: File search form retains focus after ajax finishes.
#2197: Refactor focus stuff to prevent errors.