#c// ###################################################################
#c// Album Theme by Ed Maste, updated by DaveSource
#c// 2003/06:  XHTML 1.0 & .htaccess: Magnus von Koeller, vonkoeller.de
#c// 2003/06:  CSS: hnilek, hnilek.zsbarr.cz
#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";
  $BODY = "bgcolor='#ffffff' text='#666666' link='blue' alink='blue' vlink='purple'";
  $SEP_BAR = "<div align='center'><img src='$PATH/Null.gif' height='5' width='1' alt='' /><br /><img src='$PATH/Bar.gif' width='95%' height='3' border='0' alt='Separator bar' /><br /><img src='$PATH/Null.gif' height='5' width='1' alt='' /></div>";

  # Shorthand for column info specified by -columns
  $Cols = Get_Opt('columns');
  $Col_Perc = int(100/$Cols)."%";

  # Image arrays are: name, width, height
  sub img_src { print "<img src='$PATH/$_[0]' width='$_[1]' height='$_[2]' $_[3] border='0' alt='' />" 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);
  @locked =     ("locked.jpg", 10, 10);
  @empty =      ("empty.jpg", 10, 10);
:>//
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    <: Meta() :>
    <title>Album: <: pAlbum_Name() :></title>
    <link rel="stylesheet" type="text/css" href="<:=$PATH:>/style.css">
  </head>

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

      <tr>
        <td colspan="<:=($Cols-1):>" align='left'>
          <p class='title'>
            <b>Album</b>:
            <: pJoin_Parent_Albums("::"); :>
          </p>
        </td>
        <td width="25%">
          <div align="right">
            <a href=<:=Back():> class='title'>Up</a>
          </div>
        </td>
      </tr>
    </table>

    <:=$SEP_BAR:>


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

<:    if (Child_Albums()) { _:>
      <td valign="top">
    <p class='title'>
      <b>Folders</b>:<br />

#c//
#c// Loop on all the albums
<:      while (Child_Albums()) {
          if (-e Child_Album_Name() . "/.htaccess" ||
              -e "$PARENT_ALBUMS[-1]/" . Child_Album_Name() . "/.htaccess") {
            img_src(@locked);
          } else {
            img_src(@empty);
          }
          pChild_Album(1); :>
<br />
#c//
#c// End album loop
<:      Next_Child_Album() :>
<:      } :>

        </p>
      </td>
<:    } :>

#c// --SGR
<:   if (isHeader()) { _:>
      <td valign="bottom" width="50%">
        <div align="center">
          <p class='main'>
            <:pHeader():>
          </p>
        </div>
      </td>
<:   } _:>
#c// ++SGR

    </tr></table>

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


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

#c// The images

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

      <tr>
  <: while (Images()) { _:>//
        <td valign="top" width="<:=$Col_Perc:>">
          <div align="center">
            <span style='white-space:nowrap;'><:img_src(@ThBord_TL):><:img_src(@ThBord_T):><:img_src(@ThBord_TR):></span><br />
            <span style='white-space:nowrap;'><:img_src(@ThBord_L):><a href=<:=Image_URL():>><:pImage_Thumb_Src():></a><:img_src(@ThBord_R):></span><br />
            <span style='white-space:nowrap;'><:img_src(@ThBord_BL):><:img_src(@ThBord_B):><:img_src(@ThBord_BR):></span><br />
            <span class='main'>
              <a href=<:=Image_URL():>>
              <:=Image_Name():></a></span>
          </div>
        </td>

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

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

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


    <div align="center">
    <p class='credit'><: Credit() :> on <:=scalar localtime:></p>
    </div>
    <p></p>

  </body>

</html>
