Maybe I'm wrong but I think this is actually a bit more tricky than it seems.... The 'window name' is the name that you can use in the target attribute of a link (<a href="..." target="window_name">) and this isn't normally a globally scoped object or variable name.... therefore the following script:
<script>
window.open('myPage.htm','myWindowName');
myWindowName.close();
</script>
Would result in an error as myWindowName is not declared as a javascript object.... Normally you would create the window open as an instance of a script object so that you can access the properties and methods (like close()) e.g:
<script>
var objWindowInstance = window.open('myPage.htm','myWindowName');
objWindowInstance.close();
</script>
Now, this will work but the problem is you need to close it on the onload of a subsequent page after this page has unloaded.
This is a particular problem as the objects that belong to the initial page are 'undeclared' when the page unloads and therefore are no longer available for any subsequent pages. I've tried using