Fix IE8 failures in front end tests.

* Only focus an element if it is visible and enabled
* Blur previously focused elements before focusing new element.

fixes #3385