views:

18

answers:

0

I have a bunch of small pop-up pages that are designed to self-close when they lose focus- i.e. the user clicks on the parent document.

Unfortunately in IE8, the blur also occurs when the user starts to fill out an input form inside the pop-up page. Indeed clicking ANYWHERE inside the form causes this, or even when the user accidentally clicks on some text. It seems these items are not part of the pop-up document.
How can I make them so?
Here's my blur code (inside a .js script) that I use on the several pop-ups -

var fClose=0 

onload=function() {   
 fClose=0  
 setTimeout("doClose()",111);  
 document.onblur=Blur_Me;  
 document.onfocusout = Blur_Me;  
}  

function Blur_Me(){  
 fClose=1;  
 setTimeout("doClose()",111);  
}    
function doClose(){  
 if(fClose)close();  
}