IE window.windowref.document causes problem

Hey

I need some help. I have a Flash movie that is using a getURL to perform the following javascript. It works beautifully on FireFox, however, hangs on IE if I try to access the document object of another window. Maybe an Access Denied error? I get no errors, it just fails silently.

Here’s what the script does:
When it launches the new window, it stores a reference to it on the parent window. If the user then tries to launch the popup again, that reference is used to close the existing window before relaunching the new one. This all works fine in both browsers, however, we wanted the form of the open window to be automatically submitted when it’s closed by the script before launching the new window. When we try to access the document object of the window reference on our parent window, IE doens’t give any notice, it just does nothing. Firefox works great.

“commentwindow” is the reference to the created popup
“addcomment” is the name of the form on “commentwindow”


if(window.commentwindow && window.commentwindow.document && window.commentwindow.document.addcomment) {
     window.commentwindow.document.addcomment.submit();
     setTimeout(function() {}, 1000); 
} 
if(window.commentwindow) {
     window.commentwindow.close(); 
} 
var nLeft = (screen.width - 450) / 2; 
var nTop = (screen.height - 320) / 2; 
window.commentwindow = open('http://webtest/ift/add-comment.jsp?project_id=1', '_blank', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=320,left=' + nLeft + ',top=' + nTop); 
void(0);

I would appreciate any help anybody could offer on this strange bug. I have burned up several of my and my collegues’ hours trying to debug this one. If you so much as do an alert(“window.commentwindow.document”); anywhere in the script IE won’t execute the JS. Is this just super-security on IE’s part?

Thanks so much,
John French
Enspire Learning, Inc.
www.enspire.com