You can use a recursive function in the parent window to wait for the popup to close. E.g.
<html>
<head>
<script type="text/javascript">
var generator = null;
function show_prompt()
{
generator = window.open("", "New Popup", "width=400, height=400");
generator.document.write("<html><head><title>Test</title></head><body>");
generator.document.write("<p><a href=\"javascript:self.close()\"> Close</a></p>");
generator.document.write("</body></html>");
generator.document.close();
generator.focus();
WaitForClose();
}
function WaitForClose()
{
if(!generator.closed)
{
setTimeout("WaitForClose()", 500);
}
else
{
PopupClosed();
}
}
function PopupClosed()
{
alert("x");
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Show prompt box" />
</body>
</html>
Hope this helps,
Ed :)