/*
 * This script assumes the existence of the following global variables
 * (usually put in Config.js in each directory):
 * 
 * Menu -- an array of items to appear on the top navigational menu
 * LogoImage -- name of image file to use for logo (not including path)
 * HomeDir -- a string providing the location of images; the value should end with a /
 */

function HeaderMenu(selected, menu)
{
  document.write("<div class='header'>\n");
  document.writeln("<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
  document.write("<tr>");

  document.writeln("<td align='left'><a href='", HomeDir, "index.html'><img border='0' src='", HomeDir, "Images/", LogoImage, "'></a></td>");

  document.write("<td align='right' valign='bottom'>");
  document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");

  for (var i = 0; i < menu.length; i++)
  {
    document.write("<td align='center'>");
    var menuArrow;

    if (menu[i].label == selected)
    {
      document.write("<p class='navigation'><a class='selected' href='");
      menuArrow = "SelectedMenuArrow.png";
    }
    else
    {
      document.write("<p class='navigation'><a class='navigation' href='");
      menuArrow = "MenuArrow.png";
    }
		
    document.write(menu[i].url);
    document.write("'");
    document.write(" title='");
    document.write(menu[i].help);
    document.write("'>");
    document.write("<img src='", HomeDir, "Images/", menuArrow, "' align='absmiddle' border='0'>");
    document.write("&nbsp;", menu[i].label);
    document.write("</a>")
      document.write("</td>");
    if (i < menu.length-1)
      document.write("<td valign='top'><img src='", HomeDir, "Images/DottedPipe.png'></td>");
  }
  document.writeln("</table>");
  document.writeln("</td></tr>");
  document.writeln("</table>");
  document.write("</div>");
}

function Logo()
{
  document.writeln("");
}

function HeaderTitle(title)
{
  if (title != "")
    document.write("<h1 class='title'>", title, "</h1>\n");
}

function Header(title, selected)
{
  if (typeof(Menu) != "undefined")
    HeaderMenu(selected, Menu);
  else
    HeaderMenu("", []);
  if (title.length > 0)
    HeaderTitle(title);
}

function Footer()
{
  document.write("<div class='footer'>\n");
  document.write("<p style='font-size: 7pt; text-align: left; padding-top: 5px'>Copyright &copy; 2003\n");
  document.write("</div>");
}

