function iswindowstillopen(Win12) { if (Win12.closed) { document.getElementById("formstatus").innerHTML="Ready"; document.getElementById("formstatus1").innerHTML= ""; } else setTimeout(function() { iswindowstillopen(Win12) } , 3000) // { } !!! }