// JavaScript Functions used in the Toybox Challenge site

// used at the bottom of every page
function footer()
{
document.writeln("<hr>");
document.writeln("Last Updated : " + document.lastModified);
document.writeln("Copyright 2002 Kent Archie");
} // footer

// print the nav and title table
// the level value tells how many levels up
// to the place where the links are
function navup(level)
{
   var prepath="";
   for(i=0; i<level; i++) {
   	prepath += "../";
   }
   document.writeln('<table align="center" border cellspacing="5" cellpadding="3">');
   document.writeln('<tr>');
   navcontents(level,"");
   document.writeln('</tr>\n</table>\n<hr>');
} // navup

// print the nav and title table in  the footer
// the level value tells how many levels up
// to the place where the links are
function navdown(level)
{
   var prepath="";
   for(i=0; i<level; i++) {
   	prepath += "../";
   }
   document.writeln('<hr>');
   document.writeln('<table align="center"><tr>');
   document.writeln('<td><a href="' + prepath + 'index.html">Home</a>|</td>');
   document.writeln('<td><a href="' + prepath + 'projects/index.html">Projects</a>|</td>');
   document.writeln('<td><a href="' + prepath + 'notes/supplies.html">Supplies</a>|</td>');
   document.writeln('<td><a href="' + prepath + 'notes/links.html">Links</a>|</td>');
   document.writeln('<td><a href="' + prepath + 'notes/bcard.html">Me</a>|</td>');
   document.writeln('</tr>\n</table>\n</center>');
} // navdown

function showimg(ref,path,img,alt)
{
      var info = 'width="200" height="100" border="0" align="top"';
      ref = path + ref;
      if(img != "")
         document.writeln('<td class="cell"><img src="' + path + img+'"' + info + ' alt="' + alt + '"></td>\n');
       else
         document.writeln('<td class="cell"><a class="nav" href="' + ref + '">' + alt + '</a></td>\n');
}

function navcontents(level,sep)
{
   var prepath="";
   for(i=0; i<level; i++) {
   	prepath += "../";
   }
     showimg("",prepath,"images/tbclogo.gif","Toybox Challenge logo");
     showimg("index.html",prepath,"","Home");
     showimg("projects/index.html",prepath,"","Projects");
     showimg("notes/supplies.html",prepath,"","Supplies");
     showimg("notes/links.html",prepath,"","Links");
     showimg("notes/bcard.html",prepath,"","Me");
} // navcontents
