#c// options: -known_images -name_length 0
#c// ###################################################################
#c// Story Theme (based of Maste theme by DaveSource.com)
#c// ###################################################################
#c//
<:
  # Path setting - this is the path to the images
  $PATH = Theme_Path();

  # Font/color settings for the document
  $INTER_ROW_HEIGHT = "10";
  $BORDER_WIDTH = "0";
  $TITLE_FONT = "face='Verdana,Arial,Helvetica' color='black' size='-1'";
  $MAIN_FONT = "face='Verdana,Arial,Helvetica' color='#777777' size='-1'";
  $STORY_FONT = "face='Verdana,Arial,Helvetica' color='#555555' size='-1'";
  $CREDIT_FONT = "face='Verdana,Arial,Helvetica' color='blue' size='-2'";
  $BODY = "bgcolor='#ffffff' text='#777777' link='blue' alink='blue' vlink='purple'";
  $SEP_BAR = "<div align='center'><img src='$PATH/Null.gif' height='5' width='1'><br><img src='$PATH/Bar.gif' width='95%' height='3' border='0'><br><img src='$PATH/Null.gif' height='5' width='1'></div>";
 
  # Image arrays are: name, width, height
  sub img_src { print "<img src='$PATH/$_[0]' width='$_[1]' height='$_[2]' $_[3] border='0'>" if ($_[1]); }

  # Thumbnail border
  $X = Image_Page() ? Image_Width() : Get_Opt('x');
  $Y = Image_Page() ? Image_Height() : Get_Opt('y');
  @ThBord_L =   ("ThBord_L.gif", 11, $Y-0-0);
  @ThBord_R =   ("ThBord_R.gif", 13, $Y-0-0);
  @ThBord_TL =  ("ThBord_TL.gif", 11, 11);
  @ThBord_TR =  ("ThBord_TR.gif", 13, 11);
  @ThBord_BL =  ("ThBord_BL.gif", 11, 13);
  @ThBord_BR =  ("ThBord_BR.gif", 13, 13);
  @ThBord_T =   ("ThBord_T.gif", $X+11+13-11-13, 11);
  @ThBord_B =   ("ThBord_B.gif", $X+11+13-11-13, 13);
:>//
<html>

  <head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <: Meta() :>
    <title>Album: <: pAlbum_Name() :></title>
  </head>

  <body <:=$BODY:>>
    <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="0" align='center' width="95%">

      <tr>
        <td>
          <font <:=$TITLE_FONT:>>
          <b>Album</b>:
          <: pJoin_Parent_Albums(":"); :>
          </font>
        </td>
        <td width="25%">
          <div align="right">
            <a href='../index.html'><font <:=$TITLE_FONT:>>Back</font></a>
          </div>
        </td>
      </tr>

<: if (isHeader()) { _:>
      <tr>
        <td colspan=2>
	   <font <:=$TITLE_FONT:>>
		<center>
		<:pHeader():>
		</center>
	   </font>
        </td>
      </tr>
<: } _:>

    </table>

    <:=$SEP_BAR:>


#c// Are there more albums below this one?
<:  if (Child_Albums()) { _:>
    <table border="<:=$BORDER_WIDTH:>" width='95%' align='center' cellspacing='0' cellpadding='0'>
    <tr><td>

    <font <:=$TITLE_FONT:>><b>Folders</b>:</font>

#c//
#c// Loop on all the albums
<:    while (Child_Albums()) { _:>
          <font <:=$TITLE_FONT:>>&nbsp;&nbsp;<: pChild_Album(1) :></font>
#c//
#c// End album loop
<:      Next_Child_Album() :>
<:    } :>

    </td></tr></table>

#c// Bar after child albums
    <:=$SEP_BAR:>


#c//
#c// End if sub-albums
<:  } :>

#c// The images

<:
  my $album = Album_Filename();
  my $path = $album;  $path =~ s|[^/]+$||;
  $path = "." unless $path;
  $Story = "$ALBUM_PATH/Text.html";
  $Story = "$ALBUM_PATH/Story.html" unless -f $Story;
  $Story = 0 unless -f $Story;
:>//

<: if (Images() || $Story) { :>//
    <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="0" width="100%">

  <: while (Images()) { _:>//
        <td rowspan="2" valign="top" width="<:=$Col_Perc:>">
          <div align="center">
          <nobr><:img_src(@ThBord_TL):><:img_src(@ThBord_T):><:img_src(@ThBord_TR):></nobr><br />
          <nobr><:img_src(@ThBord_L):><a href=<:=Image_URL():>><:pImage_Thumb_Src():></a><:img_src(@ThBord_R):></nobr><br />
          <nobr><:img_src(@ThBord_BL):><:img_src(@ThBord_B):><:img_src(@ThBord_BR):></nobr><br />
          </div>
        </td>

<:     if (Image_Cnt() % 2) { _:>//
        <td valign="top" align="left">
<:     } else { _:>//
      </tr><tr>
        <td valign="bottom" align="right">
<:     } _:>//
          <font <:=$MAIN_FONT:>>
            <a href=<:=Image_URL():>>
            <:=Image_Name():>:</a>
          </font>
          <font <:=$STORY_FONT:>>
            <:pImage_Caption():>
          </font>
        </td>

<:     if (!(Image_Cnt() % 2) && Images_Left()) { _:>//
#c//
#c// Start a new row
      </tr>
      <tr height="<:=$INTER_ROW_HEIGHT:>">
        <td height="<:=$INTER_ROW_HEIGHT:>" colspan=3><img src="<:=$PATH:>/Null.gif" width="20" height="<:=$INTER_ROW_HEIGHT:>" border="0"></td>
      </tr>
      <tr>
<:     } :>//
#c//
#c// End image loop
<:     Next_Image(); :>//
<:   } :>//

      </table>

      <:=$SEP_BAR:>
<:}:>//

#c//
#c// Optional footer
<: if (isFooter()) { _:>
	    <td valign="bottom" width="50%">
	      <font <:=$TITLE_FONT:>>
		<center>
		<:pFooter():>
		</center>
	      </font>
	    </td>
      <:=$SEP_BAR:>
<: } _:>


    <div align="center">
    <font <:=$CREDIT_FONT:>><: Credit() :> on <:=scalar localtime:></font></div>
    <p></p>

  </body>

</html>
