Ciao a tutti ho questo javascript

<script language="javascript" type="text/javascript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scrollbar){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left ='+LeftPosition+',scrollbars=yes'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

che serve ad aprire una finsetra volante da un link come questo...

CLICCA QUI

io vorrei che alla perdita del focus della nuova finestra aperta, automaticamente la stessa si chiudesse in modo da non aver aperte 1200 popup sotto la schermata principale...

come si può fare?