Bringing new window to foreground

Hi everybody, I’m using the following code to open a new window, works just great, only thing is it goes to the background after user clicks on main window, so how does the user get it to the foreground again, I know it has something to do with windows.focus(); but thats all I know.

<head>
<script type=“text/JavaScript”>

<!-- Begin
function Openme(newin) {
flyout=window.open(newin,“flyout”,“resizable=yes,alwaysRaised=yes,scrollbars=yes,width=500,height=700,top=150,left=900”)
var URL = document.form.site.options[document.form.site.
selectedIndex].value;
window.location.href = URL;
}

// End –>
</script>
</head>
<body>

<form name=“form”>
<input type=“button” value=“Open me” onClick=“Openme(‘…/…/html/0-9.html’)”>
</form>

</body>

Any help as always is greatly appreciated, Cheers

You just need to focus the window, with flyout.focus();

Thanx for the reply paul_wilkins but it didn’t work, does it have to be placed anywhere in particular, I put it straight after the window.location.href=URL; line and before the end curly brace, I clicked on the open me button again but nothing happens, Cheers

After you change the URL of the current page, it’s kind of impossible for any other scripting to occur after that.

Ok so flyout.focus(); is pretty much useless as the window already initially loads in the foreground, then, what is a good work around, I know linking to it doesn’t work either, what about putting an iframe on the main page instead, or a hidden div that loads when the open me button is clicked? The page that loads in the new window has a drop down menu that links to 26 other pages, the users need to copy and paste data from any or all of these pages to a form thats on the main page. Any ideas how to go about this? Cheers