fix IE8 bugs

I found some bugs.

1. opacity is not work on IE8, use visibility.
2. focus() will throw exception when button is hidden by custom css on IE8.
3. document.attachEvent("onresize", function()) is not work on IE8, use document.body.onresize

This patch is to fix them.