/* * FILE: listanchors.js * The function listanchors() is passed a document as its argument, and * opens a new window to serve as a "navigation window" for that * document. The new window displays a list of all anchors in the document. * Clicking on any anchor in the list causes the document to scroll to * the position of that anchor. */ // First, figure out what browser we're running in. // Assume Navigator, but check for IE. We assume version 4 of either. listanchors.nav = true; if (navigator.appName.indexOf("Microsoft") != -1) listanchors.nav = false; // Now define the function. Pass the document that is to have its anchors // listed as the sole argument. Call it once the document is fully (or // mostly) parsed, not at the beginning of the document. function listanchors(d) { // Open the new window. var newwin = window.open("", "navwin", "menubar=yes,scrollbars=yes,resizable=yes," + "width=600,height=300"); // Give it a title. newwin.document.writeln("