// Glossary terms
  var glossary_terms = ['primum mobile|prime mover i.e. tenth sphere of heaven, which carried with it in its revolution the lower spheres of the stars and planets',
                        'vinum daemonum|wine of devils - St. Augustine, Confessions I-16-29'];

function dstring(depth)
{
  if (depth == 0)
  {
    dstr = '../';
  }
  else if (depth == 1) 
  {
    dstr = '../../';
  }
  else 
  {
    dstr = '../../../';
  }
  return dstr;

}

// Inserts title of document into HEADER frame
function title(depth, name)
{
  if (parent.HEADER)
  {
     css_fname = dstring(depth) + 'bacon.css';
     newPage  = "<HTML><HEAD><LINK rel=stylesheet type=text/css HREF=" + css_fname + "></LINK></HEAD><BODY>";
     newPage += "<center><p class=title>" + name + "</p></center>";
     newPage += "</BODY></HTML>";
     parent.HEADER.document.write(newPage)
     parent.HEADER.document.close()
  }
}

// Writes contents of note into FOOTER
function footnote(depth, note)
{
  if (parent.FOOTER)
  {
     dstr = dstring(depth);
     css_fname = dstr + 'bacon.css';
     img_fname = dstr + '../images/contents.gif';
     newPage = "<HTML><HEAD><LINK rel=stylesheet type=text/css HREF=" + css_fname + "></LINK></HEAD><BODY>";
     newPage += "<P class=footnote>" + note + "</P>";
     newPage += "</BODY></HTML>";
     parent.FOOTER.document.write(newPage)
     parent.FOOTER.document.close()
  }
  else 
  {
     alert(note);
  }
  return false
}

// Writes relevant glossary entry into FOOTER
function glossary(depth, term)
{
  dstr = dstring(depth);
  css_fname = dstr + 'bacon.css';
  img_fname = dstr + '../images/contents.gif';
  for (i=0; i < glossary_terms.length; i++)
  {
    var gloss_strs = glossary_terms[i].split('|');
    if (gloss_strs[0] == term)
    {
       if (parent.FOOTER)
       {
          newPage = "<HTML><HEAD><LINK rel=stylesheet type=text/css HREF=" + css_fname + "></LINK></HEAD><BODY>";
          newPage += "<P class=footnote>" + gloss_strs[1] + "</P>";
          newPage += "</BODY></HTML>";
          parent.FOOTER.document.write(newPage)
          parent.FOOTER.document.close()
       }
       else alert(gloss_strs[1])
       return false
    }
  }
  alert('No match found!')
  return false
}

function clear_dynmenu()
{
   if (parent.DYNMENU)
   {
      parent.DYNMENU.location = 'blank.htm';
   }
}

function footer(fname)
{
   parent.FOOTER.location = fname;  
   clear_dynmenu();
}