<: $CHILD_ALBUM_COLS = 4; :>//
<: $IMAGE_COLS = Option("columns"); :>//
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
    'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> 
      Album: <:= Path('album_name') :>
    </title>
    <: Meta() :>
  </head>
  <body bgcolor='black' text=#ffffff link=#ff00ff vlink=#ff00ff>
  <table width='95%'>
    <tr>
      <td align='left'>
        <h2> <:= Parent_Albums(':') :> </h2>
      </td>
      <td align='right'>
        <h1><a href=<:=Back():>>Up</a></h1>
      </td>
    </tr>
  </table>
  <hr />

<: if (isHeader()) { _:>
        <:pHeader():>         
        <br>
<: } _:>

#c  # Are there more albums below this one?
<:  if (my $dir = First('dirs')) { _:>
  <table cellspacing='10' width='95%'>
    <tr>
      <td width='25%' valign='top'>
<font size='+2'><i>More albums:</i></font>
      </td>

#c    # Loop on all the albums
<:    while ($dir) { _:>
        <td width='25%' valign='top'>
          <: my $img = Image($dir,'thumb');
             print "$img<br />" if $img :>
          <font size='+1'>
            <:= Get($dir,'href','dir').Name($dir)."</a>" :>
          </font>
        </td>

#c      # And start a new row every fourth one
<:      if (!((Get($dir,'num')+2) % $CHILD_ALBUM_COLS) && Next($dir)) { _:>
          </tr><tr>
<:      } :>

#c    # End album loop
<:    $dir = Next($dir); :>
<:    } :>
    </tr>
  </table>
<hr />

#c  # End if albums
<:  } :>

#c  # Are there any images?  (There might only be CHILD_ALBUMS!)
<:  if (my $pic = First('pics')) { _:>
  <table cellspacing='10' width='95%'>
    <tr>

#c    # Loop on the images
<: while($pic) { _:>
        <td width='25%' valign='top'>
          <: if (my $img=Image($pic,'thumb')) { _:>
            <:=Get($pic,'href','image'):><:=$img:></a>
            <br />
          <: } _:>
          <:=Get($pic,'href','image'):><:=Name($pic):></a>
          <: if (my $cap = Caption($pic)) { _:>
          <br />
          <font size='-2'>
            <:= $cap :>
          </font>
          <: } _:>
        </td>

<:      if (!((Get($pic,'num')+1) % Option('columns')) && Next($pic)) { _:>
          </tr><tr>
<:      } :>

#c    # End while images
<:      $pic = Next($pic) :>
<:    } :>
    </tr>
  </table>

#c  # End if images
<hr />
<:  } :>

<: if (isFooter()) { _:>
        <center>              
          <:pFooter():>         
        </center>
        <p><hr><p>
<: } _:>

    <font size='-1'>
      <: Credit() :> on <:=scalar localtime:>
    </font>
  </body>
</html>
