// FileName:     navigation.js
// Author:       Carl F Moxey
// Contents:     Routines to write navigation menus
// DateCreated:  2002-09-19
// LastUpdated:  2003-04-07


// Define the "carriage return-line feed variable
var crlf = "\r\n";
// Set Netscape4 variable
var Netscape4 = false
  if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5) {
    Netscape4 = true;
  }

//
// Display the browser upgrade window
//
function ShowUpgradeWindow() {
    upgradeInfo = window.open("browser_upgrade.html", "smallPane", "width=450,height=220,top=220,left=50,menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}

//
// Load an alternative page for Netscape4.x
//
function LoadNetscape4Page(seite) {
  var locus

  if (Netscape4) {
    switch (seite) {
      case "home" :
        locus = "navigation_textview.html";
        break;
    }
    window.location = locus;
  }
} 

//
// Add the correct stylesheet (IE or Netscape4) to a page ...
//
function WriteStylesheet(style) {
  document.write("  <link rel=\"stylesheet\" "+crlf);
  document.write("        type=\"text/css\" "+crlf);
  if (Netscape4) {
    document.write("        href=\"./stylesheets/"+style+"_ns.css\" "+crlf);
  } else {
    document.write("        href=\"./stylesheets/"+style+".css\" "+crlf);
  }
  document.write("        title=\"Default\" /> "+crlf);
} 

function WriteStylesheetSD(style) {
  document.write("  <link rel=\"stylesheet\" "+crlf);
  document.write("        type=\"text/css\" "+crlf);
  if (Netscape4) {
    document.write("        href=\"../stylesheets/"+style+"_ns.css\" "+crlf);
  } else {
    document.write("        href=\"../stylesheets/"+style+".css\" "+crlf);
  }
  document.write("        title=\"Default\" /> "+crlf);
} 

//
// Add the correct taxonomy stylesheet to a page ...
//

function WriteTaxonomyStylesheet() {

  if (Netscape4) {
    document.write("  <link rel=\"stylesheet\" ");
    document.write("        type=\"text/css\" ");
    document.write("        href=\"./stylesheets/taxonomy_1.css\" ");
    document.write("        title=\"Default\" /> ");
  } else {
    document.write("  <link rel=\"stylesheet\" ");
    document.write("        type=\"text/css\" ");
    document.write("        href=\"./stylesheets/taxonomy.css\" ");
    document.write("        title=\"Default\" /> ");
  }
} 

//
// Add a footer to a page with or without a ReturnToHome indicator ...
//

function WriteFooter() {

  document.write("    [ <a href=\"#DocumentTop\">go to top</a> ]");

  if (!Netscape4) {
    document.write("[ <a href=\"index.html\" target=\"_top\">return to home</a> ]");
  }
} 

function ShowGoToTop() {
  if (Netscape4) {
    document.write("                [ <a href=\"#DocumentTop\">go to top</a> ] ");
  } else {
    document.write("                &nbsp; ");
  }
}

function WriteGoToTop(name) {
  if (!Netscape4) {
    document.write("                <a href=\""+name+"_text.html#DocumentTop\" target=\""+name+"\">go to top</a> ");
  } else {
    document.write("                &nbsp; ");
  }
}

function WriteN4Menu(page) {
  if (Netscape4) {
    document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"570\" "+crlf);
    document.write("       id=\"N4Menu\" "+crlf);
    document.write("       summary=\"Netscape4 site navigation links\"> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"normaltext\"> "+crlf);
    document.write("  phasmatodea.org | "+page+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"normaltext\"><span style=\"text-align: right;\"> "+crlf);
    document.write("      <a href=\"index.html\">home</a> | "+crlf);
    if (page == "battacus") {
      document.write("      battacus | "+crlf);
    } else {
//      document.write("      <a href=\"./battacus/battacus.html\">battacus</a> | "+crlf);
    }
    if (page == "classification") {
      document.write("      classification | "+crlf);
    } else {
      document.write("      <a href=\"classification_textview.html\">classification</a> | "+crlf);
    }
    if (page == "genera") {
      document.write("      genera | "+crlf);
    } else {
      document.write("      <a href=\"genuslist.html\">genera</a> | "+crlf);
    }
    if (page == "species") {
      document.write("      species | "+crlf);
    } else {
      document.write("      <a href=\"specieslist.html\">species</a> | "+crlf);
    }
    if (page == "morphology") {
      document.write("      morphology | "+crlf);
    } else {
      document.write("      <a href=\"morphology_overview_txt.html\">morphology</a> | "+crlf);
    }
    if (page == "references") {
      document.write("references | "+crlf);
    } else {
      document.write("      <a href=\"references_textview.html\">references</a> | "+crlf);
    }
    if (page == "links") {
      document.write("      links | "+crlf);
    } else {
      document.write("      <a href=\"links_txt.html\">links</a> &nbsp;"+crlf);
    }
    document.write("      </span><br />&nbsp;<br /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("</table> "+crlf);
  }
}

//
// Top menu navigation bar ...
//

function WriteTopMenu(page) {
  if (page == "home") {
    document.write("<span class=\"selbstseite\">home</span> | "+crlf);
  } else {
    document.write("<a href=\"index.html\" class=\"andersseite\">home</a> | "+crlf);
  }
  if (page == "battacus") {
    document.write("<span class=\"selbstseite\">battacus</span> | "+crlf);
  } else {
//    document.write("<a href=\"./battacus/index.html\" class=\"andersseite\">battacus</a> | "+crlf);
  }
  if (page == "classification") {
    document.write("<span class=\"selbstseite\">classification</span> | "+crlf);
  } else {
    document.write("<a href=\"classification_iframepage.html\" class=\"andersseite\">classification</a> | "+crlf);
  }
  if (page == "genera") {
    document.write("<span class=\"selbstseite\">genera</span> | "+crlf);
  } else {
    document.write("<a href=\"genera_iframepage.html\" class=\"andersseite\">genera</a> | "+crlf);
  }
  if (page == "species") {
    document.write("<span class=\"selbstseite\">species</span> | "+crlf);
  } else {
    document.write("<a href=\"species_iframepage.html\" class=\"andersseite\">species</a> | "+crlf);
  }
  if (page == "morphology") {
    document.write("<span class=\"selbstseite\">morphology</span> | "+crlf);
  } else {
    document.write("<a href=\"morphology_iframepage.html\" class=\"andersseite\">morphology</a> | "+crlf);
  }
  if (page == "references") {
    document.write("<span class=\"selbstseite\">references</span> | "+crlf);
  } else {
    document.write("<a href=\"references_iframepage.html\" class=\"andersseite\">references</a> | "+crlf);
  }
  if (page == "links") {
    document.write("<span class=\"selbstseite\">links</span> &nbsp;"+crlf);
  } else {
    document.write("<a href=\"links_iframepage.html\" class=\"andersseite\">links</a> &nbsp;"+crlf);
  }
}

function WriteTaxonTopMenu() {
  document.write("<a href=\"../index.html\" class=\"andersseite\">home</a> | "+crlf);
  document.write("<a href=\"../battacus/index.html\" class=\"andersseite\">battacus</a> | "+crlf);
  document.write("<a href=\"../classification_iframepage.html\" class=\"andersseite\">classification</a> | "+crlf);
  document.write("<a href=\"../genera_iframepage.html\" class=\"andersseite\">genera</a> | "+crlf);
  document.write("<a href=\"../species_iframepage.html\" class=\"andersseite\">species</a> | "+crlf);
  document.write("<a href=\"../morphology_iframepage.html\" class=\"andersseite\">morphology</a> | "+crlf);
  document.write("<a href=\"../references_iframepage.html\" class=\"andersseite\">references</a> | "+crlf);
  document.write("<a href=\"../links_iframepage.html\" class=\"andersseite\">links</a> &nbsp;"+crlf);
}

//
// Creating the HomePanel text for Netscape4 and all other browsers ...
//

var browserUpgrade = "browser_upgrade.html"

function WriteHomePanel() {

  if (Netscape4) {
    document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"350\" "+crlf);
    document.write("       id=\"IFRow\" "+crlf);
    document.write("       summary=\"Site navigation links\"> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"./battacus/index.html\" target=\"_top\">Battacus</a>, a journal of phasmatid research, <br /> "+crlf);
    document.write("      &nbsp; &nbsp; currently in design phase "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"classification_iframepage.html\" target=\"_top\">classification</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"genera_iframepage.html\" target=\"_top\">genus listing</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"species_iframepage.html\" target=\"_top\">species listing</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"morphology_iframepage.html\" target=\"_top\">morphology overview</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"references_iframepage.html\" target=\"_top\">references</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"literature.html\" target=\"_top\">old reference material</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"links_iframepage.html\" target=\"_top\">links</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"introduction_text.html\" target=\"_top\">introduction to this site</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"historicalreview_antilles.html\" target=\"_top\">historical review of the Antillean fauna</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"mailto:cmoxey@hologic.com?subject=Phasmatodea homepage; Netscape 4.x\">contact me</a> "+crlf);
    document.write("      <br /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <!-- "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      <span style=\"color: #c3c3c3;\">&nbsp; discussion board</span> "+crlf);
    document.write("      <br /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      <span style=\"color: #c3c3c3;\">&nbsp; sign or view the guestbook</span> "+crlf);
    document.write("      <br /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  --> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; <a href=\"http://webpages.charter.net/cfmoxey/index.htm\" target=\"_top\">my homepage</a> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <!-- End of navigation panel --> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"bracketsans\"> "+crlf);
    document.write("      &nbsp; you are using Netscape 4.77 or earlier; this browser <br /> "+crlf);
    document.write("      &nbsp; does not provide some of the more recent webpage <br /> "+crlf);
    document.write("      &nbsp; capabilities<br /> "+crlf);
    document.write("      [ <a href=\"javascript:ShowUpgradeWindow()\">click here to find upgrade links for different browsers</a> ] "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("</table> "+crlf);
  } else {
    // for IE, Netscape 6+, etc, write the iframe HTML
    document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"350\" "+crlf);
    document.write("       id=\"IFRow\" "+crlf);
    document.write("       summary=\"Site navigation links\"> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td class=\"shortrow\"> "+crlf);
    document.write("      <img src=\"./gifs/transparent.gif\" alt=\"\" align=\"middle\" width=\"100\" height=\"10\" /> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("  <tr> "+crlf);
    document.write("    <td> "+crlf);
    document.write("      <iframe src=\"navigation_text.html\" "+crlf);
    document.write("              name=\"navigation_iframe\" "+crlf);
    document.write("              id=\"navigation_iframe\" "+crlf);
    document.write("              frameborder=\"1\" "+crlf);
    document.write("              marginwidth=\"20\" "+crlf);
    document.write("              height=\"350\" "+crlf);
    document.write("              width=\"350\" "+crlf);
    document.write("              align=\"middle\" "+crlf);
    document.write("              scrolling=\"auto\"> "+crlf);
    document.write("        <span class=\"bracketsans\"> "+crlf);
    document.write("          This is the navigation panel for phasmatodea.org | home <br /> "+crlf);
    document.write("          Your browser does not support inline frames, but you can still <br /> "+crlf);
    document.write("          view the plain text page content using the link on the bottom bar <br /><br /> "+crlf);
    document.write("          [ <a href=\"javascript:ShowUpgradeWindow()\">links to browser upgrade sites</a> ] "+crlf);
    document.write("        </span> "+crlf);
    document.write("      </iframe> "+crlf);
    document.write("    </td> "+crlf);
    document.write("  </tr> "+crlf);
    document.write("</table> "+crlf);
    }
  }

