Господа, а как бы принудительно закрыть окно когда с него уходит фокус. Это можно? Окно создаётся так:
Код:
<script>
function messageWindow(title, msg, w, h)
{
// var width="400", height="325";
var left = (screen.width/2) - w/2;
var top = (screen.height/2) - h/2;
var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+w+',height='+h+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
var msgWindow = window.open(title,"msgWindow", styleStr);
var head = '<head><title>'+title+'</title><LINK REL=stylesheet HREF=/style.css TYPE=text/css></head>';
var body = '<p class=cat_font>'+msg+'</p>';
msgWindow.document.write(head + body);
}
</script>
Хочется его грохнуть если юзер сам его не закрыл, а, скажем, просто мимо кликнул.