<script>
function hola(){
alert('Funcion');
}
function abrir(){
ventana = window.open('ventana.html','nombre');
//return ventana
test();
}
function test(){
if(ventana.closed==true){
hola();
}
else{
setTimeout("test()",1000);
}
}
</script>
<body onload="abrir()">
te explicaría el funcionamiento, pero es muy simple