// fermer.js

var hWin = null;
window.onfocus = fermer;
function fermer() {
if (hWin != null) hWin.close();
}