window.open('attendere.htm','attesa','width='+ width+',height='+height+',screenX='+x+',screenY='+ y+',top='+y+',left='+x);


associalo ad una variabile

fin=window.open('attendere.htm','attesa','width='+ width+',height='+height+',screenX='+x+',screenY='+ y+',top='+y+',left='+x);

e poi controlla su fin.closed

if (!fin.closed)
{//aperta}
else
{//apri popup}