<script>
function newWin(){
var win = window.open("http://javascript.ru", "JSSite", "width=420, height=230, resizable=yes, scrollbars=yes, status=yes");
(function timer(){
if(win.closed) doSomething(win);
else setTimeout(timer, 100);
}())
return win;
}
function doSomething(win) {
return alert( win.closed );
}
</script>
<div onclick="newWin();">Open</div>