// picture.js

var level;

function header(html_level)
  {
  if (html_level == 2) level="../../";
  if (html_level == 3) level="../../../";
  if (html_level == 4) level="../../../../";
  if (html_level == 5) level="../../../../../";

  document.write ('<Body bgcolor="E4CB95" background="' + level + 'images/texture3.jpg" ');
  document.write ('      Link="ddcc99" VLink="ddcc99" alink="ddcc99"> ');

  document.write (' <Script>status = " Full sized image"; </Script>');
  document.write (' <table rows=1 cols=2 Width=600>');

  document.write ('  <tr><td colspan=1 rowspan=1 width=360>');
  document.write ('  <img src="' + level + 'images/Mountain9.jpg">');
  document.write (' <font color="665500" face="Plimpton, Verdana, Helvetica, sans-serif" size=4>');

  document.close();

  return true;
  }
 
function footer(picID)
  {
  var picture;
  // picture = document.title.substring(0, document.title.length - 5) + ".jpg"; 
  picture = document.title.substring(0, 2) + ".jpg"; 

  document.write (' </font></td> ');

  document.write ('  <td colspan=1 rowspan=1 >');
  document.write ('  <img src=' + picture + '   align=right ' );
  document.write ('    alt="' + picID + '" valign=top></td></tr>');

  document.write (' </td></tr> </table></body></html> ');

  document.close();
  
  return true;
  }


function TriNav()
  {
  // This function handles triple navigation

  document.write ('<a href="javascript:back()" ');
  document.write ('   onMouseOver="status=linkBack(); return true;">');
  document.write ('   <img src="' + level + 'images/TriNavBack.gif"></a>');

  document.write ('<a href="javascript:out()" ');
  document.write ('   onMouseOver="status=linkOut(); return true;">');
  document.write ('   <img src="' + level + 'images/TriNavOut.gif"></a>');

  document.write ('<a href="javascript:next()" ');
  document.write ('   onMouseOver="status=linkNext(); return true;">');
  document.write ('   <img src="' + level + 'images/TriNavNext.gif"></a>');

  document.close();

  return true;
  }

function parent()
  {
  // When S is 3rd character of a file title then the file is in a subdirectory

  char234 = document.title.substring(2,3);
  char2 = char234.substring(0,1);          // This is the third character of the title - S means subdirectory

  if (char2 == 'S')  return("../") ;         // Return path prefix to parent directory

  return("") ; 
  }

function current()
  {
  // Return current image number

  documentNumber = document.title.substring(0,2);

  for (i = 0; i < imageCount(); i++)
    {
    // alert("Doc # " + documentNumber + "     URL " + url[i].substring(0,2) );

    if (documentNumber == url[i].substring(0,2))
      {
      //     alert ("The URL is: " + url[i]);
      return(i);      
      }
    } 
   alert ("Cannot find: " + documentNumber + ".html");
    return(0);
  }

function position()
  {
  return("Full size " + imageGroup() + " image no. " + (current() + 1) + " of " + imageCount() );
  }

function back()
  {
  location.replace(parent() + url[(imageCount() + current() - 1) % imageCount()]);
  //  document.location = url[(imageCount() + current() - 1) % imageCount()];
  return;      
  }

function linkBack()
  {
  return("Display previous " + imageGroup() + " image, No. " + ((current() + imageCount() - 1) % (imageCount()) + 1) );
  }

function linkOut()
  {
  return("Return to " + imageGroup() + " cluster");
  }

function next()
  {
  location.replace(parent() + url[(current() + 1) % imageCount()]);
  //  document.location = url[(current() + 1) % imageCount()];
  return;      
  }

function linkNext()
  {
  return("Display next " + imageGroup() + " image, No. " + ((current() + 1) % (imageCount()) + 1) );
  }

function out()
  {
  history.back();
  return true;
  }

function cw()
  {
  // Absolute Main Menu Navigation Bar
  document.write('<p>');
  document.write('<Table Border Cellpadding=2>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/images/absolute_help.html"><font color=C4531B face="Verdana,Arial" size=1>Absolute Navigation</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/index.html"><font color=665500 face="Verdana,Arial" size=1>Index</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/activity/activity.html"><font color=665500 face="Verdana,Arial" size=1>Activities</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/camper/camper.html"><font color=665500 face="Verdana,Arial" size=1>Campers</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/description/description.html"><font color=665500 face="Verdana,Arial" size=1>Sign Up</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/grounds/grounds.html"><font color=665500 face="Verdana,Arial" size=1>Grounds</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/history/history.html"><font color=665500 face="Verdana,Arial" size=1>History</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/map/map.html"><font color=665500 face="Verdana,Arial" size=1>Maps</a></td>');
  document.write('<td Align=Left><a href="http://www.echocamp.org/staff/staff.html"><font color=665500 face="Verdana,Arial" size=1>Staff</a></td>');
  document.write('</Table><p>');

  // Copyright notice
  document.write(" <font color=665500 face='Verdana,Arial' size=1><p> ");
  document.write(" www.EchoCamp.org, the fantastic Berkeley Echo Lake Camp website, ");
  document.write(" is copyright &copy 2000 - 2008 by Bayard Geis. <p>");
  // document.write(' <a href="mailto:Bayard@EchoCamp.org?subject=EchoCamp.org Web site"> ');
  document.write(' <img src="' + level + 'images/BD_email.jpg"> ');
  document.write(" </font> ");

  document.close();

  return true;
  }
