function check() { if (!opener) { location.href='destroy.php'; } else { setTimeout("check()",10); } }