Different code examples on how to control windows with Javascript.
Put all of the code examples from the links below between these script tags.
<script language="JavaScript"> <!-- //--> </script>
Close a window from a link or checkbox (or button,etc).
<input type="checkbox" name="checkOne" onClick="window.close()"> <a href="close.shtml" onClick="window.close()">click here to close window</a>
Open a window.
window.open('whatever.shtml','whatever','width=300,height=610,resizable=no,scrollbars=yes');
On window open bring to top and in front.
<BODY onBlur="self.focus()"> <body>
This redirects an html document or link back to the page that a pop window opened from. Then closes the popup.
function DoStuff() { opener.location.href = 'foo.shtml'; window.close(); }