#c// option: -known_images
#c// option: -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_URL();

  # Font/color settings for the document
  $INTER_ROW_HEIGHT = "5";
  $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>";
 
  # Thumbnail border
  @ThBord_L =   ("$PATH/ThBord_L.gif", 11, 0);
  @ThBord_R =   ("$PATH/ThBord_R.gif", 13, 0);
  @ThBord_TL =  ("$PATH/ThBord_TL.gif", 11, 11);
  @ThBord_TR =  ("$PATH/ThBord_TR.gif", 13, 11);
  @ThBord_BL =  ("$PATH/ThBord_BL.gif", 11, 13);
  @ThBord_BR =  ("$PATH/ThBord_BR.gif", 13, 13);
  @ThBord_T =   ("$PATH/ThBord_T.gif", 0, 11);
  @ThBord_B =   ("$PATH/ThBord_B.gif", 0, 13);
  @Border = (\@ThBord_TL,\@ThBord_T,\@ThBord_TR,\@ThBord_RT,\@ThBord_R,\@ThBord_RB,\@ThBord_BR,\@ThBord_B,\@ThBord_BL,\@ThBord_LB,\@ThBord_L,\@ThBord_LT);
:>//
<html>

  <head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    <: Meta() :>
    <title>Album: <: Path('album_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>:
          <:= Parent_Albums(":") :>
          </font>
        </td>
        <td width="25%">
<: my $back = Back();
   if ($back && $back ne "''" && $back ne "'0'") { _:>
          <div align="right">
            <a href=<:=Back():> class='title'>Up</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 (my $alb = First('dirs')) { _:>
    <table border="<:=$BORDER_WIDTH:>" width='95%' align='center' cellspacing='0' cellpadding='0'>
    <tr><td>

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

#c//
#c// Loop on all the albums
<:    while ($alb) {
        print "<font $TITLE_FONT>&nbsp;&nbsp;";
        print Get($alb,'href','dir');
        print Pretty(Name($alb),1);
        print "</a>";
        print Caption($alb),"<br />\n";
        print "</font>\n";
        $alb = Next($alb);
      } _:>

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

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


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

#c// The images
<: if (my $img = First('pics')) { _:>
    <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="5" width="100%">

  <: while ($img) {
       my $left = ((Get($img,'num')+1) % 2) ? 1 : 0;
       my $align = $left ? "left" : "right";
       my $thumbalign = $left ? "right" : "left";
       my $valign = $left ? "top" : "bottom";
_:>//
        <td rowspan="2" valign="<:=$valign:>" width="25%">
          <div align="<:=$thumbalign:>">
            <: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :>
          </div>
        </td>
<:     if (!$left) { _:>//
      </tr><tr>
<:     } _:>//
        <td valign="<:=$valign:>" align="<:=$align:>">
          <font <:=$MAIN_FONT:>>
            <:=Get($img,'href','image'):>
            <:=Pretty(Name($img),1,1):></a>
          </font>
          <font <:=$STORY_FONT:>>
            <:=Caption($img):>
          </font>
        </td>

<:     if (New_Row($img,2) && Next($img)) { _:>//
#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
<:     $img = Next($img); :>//
<:   } :>//

      </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>
