// FileName:     maintenance.js
// Author:       Carl F Moxey
// Contents:     Routines to perform basic site maintenance, 
//               such as browser detection, page redirection
// DateCreated:  2002-09-13
// LastUpdated:  2003-04-27


var crlf = "\r\n";

//
// HTML peculiarities ....
//

function WriteCenterTag(wo) {
  if (Netscape4) {
    switch (wo) {
      case "anfang" :
        document.write("  <center>"+crlf);
        break;
      case "ende" :
        document.write("  </center>"+crlf);
        break;
    }
  }
}

//
// Allows the Pterinoxylus image to display correctly in Netscape4
//

function ShowPterinoxylus() {
  if (Netscape4) {
    document.write("              <td rowspan=\"3\" width=\"249\" valign=\"top\"> ");
    document.write("                <img src=\"./jpegs/pterinoxylus_crassus_01.jpeg\" alt=\"Pterinoxylus crassus Kirby\" width=\"243\" height=\"448\" /> ");
    document.write("              </td> ");
  } else {
    document.write("              <td rowspan=\"3\" width=\"249\"> ");
    document.write("                <table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" height=\"450\" ");
    document.write("                       id=\"RPPanel4\" ");
    document.write("                       summary=\"Right picture panel, column 4 - illustration of Pterinoxylus crassus Kirby\"> ");
    document.write("                  <tr> ");
    document.write("                    <td> ");
    document.write("                      <img src=\"./jpegs/pterinoxylus_crassus_01.jpeg\" alt=\"Pterinoxylus crassus Kirby\" width=\"243\" height=\"448\" /> ");
    document.write("                    </td> ");
    document.write("                  </tr> ");
    document.write("                </table> ");
    document.write("              </td> ");
  }
}

//
// Referring source
//

function WriteReferrer() {
      document.write("<img src=\"/cgi-bin/axs/ax.pl?trans.gif&amp;ref=");
      document.write(document.referrer);
      document.write("\" height=\"1\" width=\"1\" />");
}

//
// Page redirection ...
//

function RedirectPage(target) {
    window.location.href = "\"" + target + "\"";
}

//
// Open informational windows ...
//

var mpWidth
var mpHeight
mediumPane = null
smallPane = null
leftPosition = 0
topPosition = 0

if (screen) {
    leftPosition = 50;
    topPosition = 160;
}

//
// ... show medium-sized window
//

function ShowMediumPane(adresse) {
  if (Netscape4) {
    mpWidth = 600;
    mpHeight = 435;
  } else {
    mpWidth = 550;
    mpHeight = 420;
  }
  mediumPane = window.open(adresse, "mediumPane", "width="+mpWidth+",height="+mpHeight+",left="+(leftPosition+20)+",top="+(topPosition+25)+",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}

function ShowInfoBox(adresse) {
  if (Netscape4) {
    mpWidth = 600;
    mpHeight = 435;
  } else {
    mpWidth = 550;
    mpHeight = 420;
  }
  infoBox = window.open(adresse, "infoBox", "width="+mpWidth+",height="+mpHeight+",left="+(leftPosition+20)+",top="+(topPosition+25)+",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
  if (window.focus) {
    infoBox.focus()
  }
  return false;
}
//
// ... show small-sized window
//

function ShowSmallPane(adresse) {
    smallPane = window.open(adresse, "smallPane", "width=550,height=250,left="+leftPosition+",top="+topPosition+",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}

function ShowSmallInfoBox(adresse) {
    smallInfoBox = window.open(adresse, "smallInfoBox", "width=550,height=250,left="+leftPosition+",top="+topPosition+",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
  if (window.focus) {
    smallInfoBox.focus()
  }
  return false;
}
//
// ... show a window for an illustration
//

function ShowPicturePane(abbildung, breite, hoehe) {
    picturePane = window.open(abbildung, "picturePane", "width="+breite+",height="+hoehe+",left="+leftPosition+",top="+topPosition+",menubar=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}

//
// ... close the window ...
//

function CloseMe(id) {
    if (id && !id.closed) {
        window.close();
    }
}

//
//  ...
//

