// window opener.  link format is URL/Width/Height: javascript:PopUpWindow(1,'../path/to/file.html', 680, 520)

var help_window = null;
var counter = 0;

function PopUpWindow(status, url, iw, ih)
{

        var new_help_window_opened = false;

        if(status != 0)
        {
                if ((navigator.appName == "Microsoft Internet Explorer") ||
                        (navigator.appName=="Netscape" && navigator.appVersion.substring(0,1) == "2"))
                {
                        if(counter > 0)
                        {
                                if (open(url,"help_window"+counter,"width="+iw+",height="+ih+",resizable=yes,scrollbars=yes,toolbar=no,status=no"))
                                {
                                        help_window2=open(url,"help_window"+counter,"width="+iw+",height="+ih+",resizable=yes,scrollbars=yes,toolbar=no,status=no");
                                        if (help_window2==help_window)
                                                help_window2.close();
                                        else
                                        {
                                                new_help_window_opened=true;
                                                help_window=help_window2;
                                        }
                                }
                        }
          
                        if(new_help_window_opened==false)
                        {
                                counter++; 
                                help_window=open(url, "help_window"+counter, "width="+iw+",height="+ih+",resizable=yes,scrollbars=yes,toolbar=no,status=no");
                        }

                }
        else if(navigator.appName=="Netscape")
        {
                        var help = open(url,"help_window", "width="+iw+",height="+ih+",resizable=yes,scrollbars=yes,toolbar=no,status=no");
                
                        help_window = help;
                        if (help_window != null)
                                help_window.focus();
                }                              
        }
    else 
        {                            
                if (help_window != null) 
                        help_window.close();
        }

}
