Controlling Browser windows > javascript

Ok, I need some help here folks.

I have a site with a button on it, and when that button is clicked a smaller browser window opens up… simple right?

the problem is what happens is if that window is already opened and falls under the main window… the user sometimes clicks on the button again wondering why the window isn’t popping up again (because it’s already open, just underneath the window)

I need to know how to:

  1. move the lil window back on top of the main window when the button is clicked again

2)detect if the lil window is closed or open still and have the button prompt an appropriate action…

does that make sense??

thanks!

Try this…

After you window.open() action add a .focus()

window.open().focus()

This will bring your opened window into focus (in front) after it opens.