--- loncom/interface/loncommon.pm 2004/12/08 00:56:00 1.242 +++ loncom/interface/loncommon.pm 2004/12/20 19:57:14 1.243 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.242 2004/12/08 00:56:00 albertel Exp $ +# $Id: loncommon.pm,v 1.243 2004/12/20 19:57:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -691,20 +691,30 @@ sub help_open_menu { $template .= <<"ENDTEMPLATE"; <script type="text/javascript"> //<!-- BEGIN LON-CAPA Internal -function helpMenu(caller) { - if (caller == 'open') { - newWindow = window.open("","helpmenu","HEIGHT=$height,WIDTH=$width,resize=yes,scrollbars=yes" ) - caller = newWindow.document - } else { - caller = this.document - } - caller.write("<html><head><title>LON-CAPA Help Menu</title><meta http-equiv='pragma' content='no-cache'></head>") - caller.write("<frameset rows='105,*' border='0'><frame name='bannerframe' src='$banner_link'><frame name='bodyframe' src='$details_link'></frameset>") - caller.write("</html>") - caller.close() - if (caller == newWindow.document) { - caller.focus() - } +function helpMenu(target) { + var caller = this; + if (target == 'open') { + var newWindow = null; + try { + newWindow = window.open("","helpmenu","HEIGHT=$height,WIDTH=$width,resize=yes,scrollbars=yes" ) + } + catch(error) { + writeHelp(caller); + return; + } + if (newWindow) { + caller = newWindow; + } + } + writeHelp(caller); + return; +} +function writeHelp(caller) { + caller.document.write("<html><head><title>LON-CAPA Help Menu</title><meta http-equiv='pragma' content='no-cache'></head>") + caller.document.write("<frameset rows='105,*' border='0'><frame name='bannerframe' src='$banner_link'><frame name='bodyframe' src='$details_link'></frameset>") + caller.document.write("</html>") + caller.document.close() + caller.focus() } // END LON-CAPA Internal --> </script>