<: 
#c// ####################################################################
#c// Album theme created by Lucian Precup (lucian_precup@yahoo.com).
#c// ####################################################################
#c// 
#c// You can try the following command line options:
#c// album -index index -medium 600x400 -theme /path/to/album/Themes/kde_style -columns 5 -no_crop -geometry=120x90
#c// but any other set of options would yield nice results too.
#c// 

$THEME_CREDIT = "";
$PATH = Theme_URL();
$COLS = Option("columns");
$CELLSPACING = 4;
$COLS_PERC = int(100/$COLS - $CELLSPACING);
:>
<html>
  <head>
    <title>Album: <:=Path('album_name'):></title>
    <: Meta() :>
    <LINK REL='stylesheet' HREF='<:=$PATH:>/kde_style.css' TYPE='text/css'>
</head>
<body>
  <table border='0' width='95%' cellspacing='0' cellpadding='0' align='center'>
    <TR>
      <td COLSPAN='<:=($COLS*2-2):>' align='left' class='color1'>
        <b><:=Parent_Albums(" &gt; "):></b>
      </td>
      <td align='right' class='color1'>
        <a href=<:=Back():>><img src='<:=$PATH:>/icons/up.png' alt='up' border='0' align='BOTTOM'>&nbsp;up</a>
      </td>
    </TR>
<: if (isHeader()) { :>
    <TR>
      <td colspan='<:=($COLS*2-1):>' class='color3' align='center'>
        <:pHeader():>         
      </td>
    </TR>
<: } :>
    <TR>
      <TD COLSPAN='<:=($COLS*2-1):>'> &nbsp; </TD>
    </TR>

<: if (num('dirs') || num('pics')) { :>
    <tr>
    <: for($count=1,$child = First('dirs'); $child; $count++,$child=Next($child)){ :>
        <td class='color2' ALIGN='center' VALIGN='baseline' WIDTH='<:=$COLS_PERC:>%'>
            <:=Get($child,'href','album_page', 'dir'):><img src='<:=$PATH:>/icons/folder.png' HSPACE='7' VSPACE='7' border='0'><br><:=Name($child):></a>
        </td>
<:      if ( !($count % $COLS) && (Next($child) || num('pics') )) { :>
	  <TR>
	    <TD COLSPAN='<:=($COLS*2-1):>'> &nbsp; </TD>
	  </TR>
<:      } else { :>
          <TD WIDTH='<:=$CELLSPACING:>%'>
	    &nbsp;
          </TD>
<:      } :>
    <: } :>

    <: for($image = First('pics'); $image; $count++,$image=Next($image)){ :>
        <td class='color2' ALIGN='center' VALIGN='baseline' WIDTH='<:=$COLS_PERC:>%'>
            <:=Get($image,'href','album_page','image'):>
               <:=Image($image, 'thumb'):><br><:=Name($image):></a>
        </td>
<:      if ( !($count % $COLS) && Next($image)) { :>
	  <TR>
	    <TD COLSPAN='<:=($COLS*2-1):>'> &nbsp; </TD>
	  </TR>
<:      } else { :>
          <TD WIDTH='<:=$CELLSPACING:>%'>
	    &nbsp;
          </TD>
<:      } :>
    <: } :>

    </tr>
    <tr>
      <td colspan='<:=($COLS*2-1):>'> &nbsp; </td>
    </tr>
<: if (isFooter()) { :>
    <tr>
      <td colspan='<:=($COLS*2-1):>' align='center'>
        <:pFooter():>         
      </td>
    </tr>
<: } :>
    <tr>
      <td colspan='<:=($COLS*2-1):>' class='color3'>&nbsp;
        <: if (num('dirs') > 0) {:>        
          <:=(num('dirs')):> sub-albums and 
	<: } :>
        <:=(num('pics')):> files in this album</TD>
    </tr>
  </table>
<:  } :>

<hr>
    <font size='-2'>
      <: Credit() :>. <:=$THEME_CREDIT:> Last updated: <:=scalar localtime:>
    </font>
  </body>
</html>
