Same issue in Chrome and other browsers? Maybe https://stackoverflow.com/questions/2758608/window-focus-not-working-in-google-chrome will help.
Hard to say without a JS demo showing the problem.
Do more on the web, with a fast and secure browser!
Download Opera browser with: