I need you help with the following script. It works perfectly with IE 5.5 or higher, but does not work with IE5 or earlier:

var win
function openDep1(URL) {
win = window.open('movie.asp?id=' + escape(URL), "dep1", 'toolbar=0,scrollbars=1,resizable=1,location=0,statusbar=0,menubar=0');

function closeDep1() {
if (win && win.open && !win.closed) win.close();

// -->

In IE5 the window is opened and it closes imidiatly, before it even starts loading.

The purpose of the script is to close the depending window when the partent window is closed.

Is there a way to modify the script so that it will work with older versions of IE?