document.writeln('<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#339933" VLINK="#339933" ALINK="#339933">');
document.writeln('<CENTER>');
document.writeln('<TABLE BGCOLOR="#990000" BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=750>');
document.writeln('<TR>');
document.writeln('   <TD ALIGN=CENTER VALIGN=MIDDLE><IMG BORDER=0 WIDTH=750 HEIGHT=100 SRC="graphics/header.gif"></TD>');
document.writeln('</TR>');
document.writeln('<TR>');
document.writeln('   <TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR="#000000"><IMG BORDER=0 WIDTH=750 HEIGHT=6 SRC="graphics/cleardot.gif"></TD>');
document.writeln('</TR>');
document.writeln('<TR>');
document.writeln('   <TD ALIGN=CENTER VALIGN=MIDDLE>');
document.writeln('      <TABLE BORDER=0 CELLPADDING=7 CELLSPACING=2 WIDTH=750>');
document.writeln('      <TR BGCOLOR="#222222">');
document.writeln('         <TD ALIGN=CENTER VALIGN=MIDDLE><A');
document.writeln('            HREF="index.htm"><IMG BORDER=0 WIDTH=140 HEIGHT=30 SRC="graphics/home.gif"></A><IMG BORDER=0 WIDTH=8 HEIGHT=30 SRC="graphics/cleardot.gif"><A');
document.writeln('            HREF="info.htm"><IMG BORDER=0 WIDTH=140 HEIGHT=30 SRC="graphics/info.gif"></A><IMG BORDER=0 WIDTH=8 HEIGHT=30 SRC="graphics/cleardot.gif"><A');
document.writeln('            HREF="other.htm"><IMG BORDER=0 WIDTH=140 HEIGHT=30 SRC="graphics/other.gif"></A><IMG BORDER=0 WIDTH=8 HEIGHT=30 SRC="graphics/cleardot.gif"><A');
document.writeln('            HREF="archives.htm"><IMG BORDER=0 WIDTH=140 HEIGHT=30 SRC="graphics/archives.gif"></A><IMG BORDER=0 WIDTH=8 HEIGHT=30 SRC="graphics/cleardot.gif"><A');
document.writeln('            HREF="links.htm"><IMG BORDER=0 WIDTH=140 HEIGHT=30 SRC="graphics/links.gif"></A></TD>');
document.writeln('      </TR>');
document.writeln('      <TR BGCOLOR="#222222">');
document.writeln('         <TD ALIGN=CENTER VALIGN=TOP>');
document.writeln('            <FONT FACE="ARIAL" COLOR="#339933" SIZE=3><B><U>' + photosTitle + '</U></B><BR>&nbsp;</FONT>');
document.writeln('            <FONT FACE="ARIAL" COLOR="#CCCCCC" SIZE=2>&nbsp;<BR>Click on a picture to see a larger image.<BR>&nbsp;</FONT>');
document.writeln('            <TABLE BGCOLOR="#222222" BORDER=0 CELLPADDING=0 CELLSPACING=10>');

columnCount = 0;
columnMax   = 6;
row1Cell    = new Array(columnMax);
row2Cell    = new Array(columnMax);

for (i=0; i<photosDisplayed; i++) {
   photoInfo = photo[i].split("|");

   photoID   = photoInfo[0];
   photoType = photoInfo[1];

   photoYear = photoID.substring(0,4);

   if (photoType=="W") {
      thumbW = 105;
      thumbH = 35;
   } else if (photoType=="L") {
      thumbW = 105;
      thumbH = 70;
   } else {
      thumbW = 70;
      thumbH = 105;
   }

   row1Cell[columnCount] = '               <TD ALIGN=CENTER VALIGN=BOTTOM WIDTH=110><A HREF="javascript:showPhoto(' + i + ');"><IMG BORDER=0 WIDTH=' + thumbW + ' HEIGHT=' + thumbH + ' SRC="other/' + photoYear + '/thumbs/' + photoID + '.jpg"></A></TD>';
   row2Cell[columnCount] = '               <TD ALIGN=CENTER VALIGN=TOP    WIDTH=110><FONT FACE="ARIAL" SIZE=1>&nbsp;</FONT></TD>';

   columnCount++;

   if (columnCount==columnMax) {
      document.writeln('            <TR>');
      for (j=0; j<columnMax; j++) {
         document.writeln(row1Cell[j]);
      }
      document.writeln('            </TR>');
      document.writeln('            <TR>');
      for (j=0; j<columnMax; j++) {
         document.writeln(row2Cell[j]);
      }
      document.writeln('            </TR>');
      columnCount = 0;
   }
}

if (columnCount>0 && columnCount<columnMax) {
   for (i=columnCount; i<columnMax; i++) {
      row1Cell[i] = '               <TD ALIGN=CENTER VALIGN=BOTTOM WIDTH=110><IMG BORDER=0 WIDTH=105 HEIGHT=70 SRC="graphics/cleardot.gif"></TD>';
      row2Cell[i] = '               <TD ALIGN=CENTER VALIGN=TOP    WIDTH=110><FONT FACE="ARIAL" SIZE=1>&nbsp;</FONT></TD>';
   }
   document.writeln('            <TR>');
   for (j=0; j<columnMax; j++) {
      document.writeln(row1Cell[j]);
   }
   document.writeln('            </TR>');
   document.writeln('            <TR>');
   for (j=0; j<columnMax; j++) {
      document.writeln(row2Cell[j]);
   }
   document.writeln('            </TR>');
}

document.writeln('            </TABLE>');
document.writeln('         </TD>');
document.writeln('      </TR>');
document.writeln('      <TR BGCOLOR="#222222">');
document.writeln('         <TD ALIGN=CENTER VALIGN=MIDDLE><FONT FACE="ARIAL" COLOR="#CCCCCC" SIZE=3><B>These pages and photographs &copy; Simon Clarke</B></FONT></TD>');
document.writeln('      </TR>');
document.writeln('      </TABLE>');
document.writeln('   </TD>');
document.writeln('</TR>');
document.writeln('</TABLE>');
document.writeln('</CENTER>');
document.writeln('</BODY>');

