<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
    'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
#c// ###################################################################
#c// Album Theme by David Ljung Madison
#c// Design by Dave Simmer of DaveWeb.com, modified by Dave Madison
#c// -- Auto generated by simmer_theme v3.12
#c// -- From: http://MarginalHacks.com/Hacks/album/
#c// ###################################################################
#c//
<:

  # Path setting - this is the path to the images
  $PATH = Theme_URL();
  $CSS = "<link rel='stylesheet' type='text/css' href='".$PATH."/Style.css' />";
  $CSS .= "\n		<link rel='stylesheet' type='text/css' href='album.css' />";

	$BODY="";
	$START_TITLE = "<span class='title'>";
	$START_MAIN = "<span class='main'>";
	$START_CREDIT = "<span class='credit'>";
	$END_FONT = "</span>";

	$SLIDESHOW = Option('slideshow');
  # Icons/graphics
  @Locked =	("$PATH/Locked.gif", 8, 11);
  @RSS =	("$PATH/RSS.png", 16, 16);
  $Icon =	{
		'_' => ["$PATH/Icon.gif",103,36],
		};
  $Back =	{
		'_' => ["$PATH/Back.gif",125,36],
		};
  $Next =	{
		'_' => ["$PATH/Next.gif",44,36],
		};
  $Prev =	{
		'_' => ["$PATH/Prev.gif",44,36],
		};
  $More =	{
		'_' => ["$PATH/More.gif",216,36],
		};
sub Bar {
  my ($colspan) = @_;
  return unless @Bar_M;
:>
			<tr>
				<td colspan='<:=$colspan:>' height="<:=$bar_H:>">
					<table cellpadding='0' cellspacing='0' width='100%'>
						<tr>
<: foreach my $bar ( \@Bar_L, \@Bar_ML, \@Bar_M, \@Bar_MR, \@Bar_R ) {
     next unless @$bar;
     my $width = $bar->[1] =~ /100%/ ? "" : " width='$bar->[1]'";
     print "\t\t\t\t\t\t\t<td $width>";
     print Image_Array(@$bar);
     print "</td>\n";
} :>
						</tr>
					</table>
				</td>
			</tr>
<:
}


  # Thumbnail border
  @Bord_LT =	("$PATH/Bord_LT.gif", 14, 33);
  @Bord_RT =	("$PATH/Bord_RT.gif", 12, 33);
  @Bord_LB =	("$PATH/Bord_LB.gif", 14, 27);
  @Bord_RB =	("$PATH/Bord_RB.gif", 12, 27);
  @Bord_L =	("$PATH/Bord_L.gif", 14, 6);
  @Bord_R =	("$PATH/Bord_R.gif", 12, 8);
  @Bord_TL =	("$PATH/Bord_TL.gif", 41, 13);
  @Bord_TR =	("$PATH/Bord_TR.gif", 36, 13);
  @Bord_BL =	("$PATH/Bord_BL.gif", 38, 11);
  @Bord_BR =	("$PATH/Bord_BR.gif", 44, 11);
  @Bord_T =	("$PATH/Bord_T.gif", 8, 13);
  @Bord_B =	("$PATH/Bord_B.gif", 6, 11);

  @Border = (\@Bord_TL,\@Bord_T,\@Bord_TR,\@Bord_RT,\@Bord_R,\@Bord_RB,\@Bord_BR,\@Bord_B,\@Bord_BL,\@Bord_LB,\@Bord_L,\@Bord_LT) unless @Border;
:>//
#c//
#c// ###################################################################
#c// Everything beyond here is the same for every DaveWeb theme..
#c// ###################################################################
<:
  # Shorthand for column info specified by -columns
  $Dir_Thumbs = Option('dir_thumbs');
  $Cols = Option('columns');
  $Col_Perc = int(100/$Cols)."%";

:>//
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=<:=Option('charset'):>" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<: Meta() :>
		<title><:= Trans('Album:') :> <:= Path('album_name') :></title>
    <:= $CSS :>
	</head>

	<body <:=$BODY:> <:Body_Tag():>>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td colspan="<:=($Cols-1):>" height="10"><:=Image_Array("$PATH/Null.gif",11,10):></td>
			</tr>
			<tr>
				<td colspan="<:=($Cols-1):>">
					<:=$START_TITLE:>
<: if ($Icon) {
          print Image_Ref($Icon,"align='middle'");
					print "\n<br />&nbsp;&nbsp;&nbsp;&nbsp;\n";
   } else {
					print "<b>".Trans('Album:')."</b>\n";
   } _:>
					<:= Parent_Albums(':'); :>
					<:=$END_FONT:></td>
				<td valign='top' width="25%">
					<div align="right">
						<:
							$back=Back();
							if ($back && $back ne "''" && $back ne "'0'") {
								print "$START_TITLE";
								print "<a href=$back>";
								print $Back ? Image_Ref($Back,"align='middle'") : Trans('Up');
								print "</a>\n";
								print "$END_FONT";
							}
							my $rss = Option('extra/rss2.alp:feedFilename') || Option('extra/rss.alp:feedFilename');
							print "<a href='$rss'>".Image_Array(@RSS)."</a>\n" if $rss && $RSS[0];
						:>
					</div>
				</td>
			</tr>
<: if ($Dir_Thumbs && isHeader()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">
					<br />
					<center>
						<:=$START_MAIN:>
						  <:pHeader():>
						<:=$END_FONT:>
					</center>
				</td>
			</tr>
<: } _:>
<: Bar($Cols) :>
			<tr>
				<td colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,10):></td>
			</tr>

#c// Are there more albums below this one?
<:
  my $alb = First('dirs');
  if ($alb) { _:>
			<tr>
				<td colspan="<:=$Cols:>">

	<table width='100%' align='center' cellspacing='3'>
		<tr>
<:    if (!$Dir_Thumbs) { :>
        <td width='50%'>
        <:=$START_TITLE:>
		      <:= $More ? Image_Ref($More) : "<b>".Trans('More albums:')."</b>" :>
		      <br />
				<:=$END_FONT:>
		    <:=$START_MAIN:>
<:    } elsif ($More) { :>
			<td height='50' align='center' width='<:=$Col_Perc:>' valign='top'>
				<:=Image_Ref($More):>
			</td>
<:    } :>
#c//
#c// Loop on all the albums
<:  my @save;
    while ($alb) {
      if ($Dir_Thumbs) {
_:>
			<td align='center' width='<:=$Col_Perc:>' valign='bottom'>
					<: PickOverlay($alb, 'thumb') if @Overlays :>
					<: Border($alb, 'thumb','dir', @Border) if Get($alb,'thumb','x') :>
          <: push(@save,$alb); :>
			</td>
<:      if (New_Row($alb,$Cols,$More?1:0) || !Next($alb)) { _:>
		</tr><tr>
<:        foreach my $save ( @save ) { _:>
      <:= "<td></td>\n" unless !$More || Get($save,'num') :>
			<td align='center' width='<:=$Col_Perc:>' valign='top'>
				<:=$START_MAIN:>
				 	<:= Image_Array( (-e Get($save,'path').'/.htaccess') ? @Locked : @NotLocked) :>
					<span class='dirname'>
					<:=Get($save,'href','dir'):>
					<:=Pretty(Name($save),1,1):></a>
					</span>
					<: my $cap = Caption($save);
					   my $num_pics = Get($save,'num_pics_str');
					   my $num_dirs = Get($save,'num_dirs_str');
					   if ($cap || $num_pics || $num_dirs) { _:>
						<span class='dircap'>
						<br />
						<font size='-2'>
						<:=$cap if $cap:>
						<:="<br />" if $cap && ($num_pics || $num_dirs):>
						<:=$num_dirs:>
						<:=", " if $num_pics && $num_dirs:>
						<:=$num_pics:>
						</font>
						</span>
          <: } :>
				<:=$END_FONT:>
			</td>
<:
          } # end foreach $save
          undef @save;
          if (New_Row($alb,$Cols,$More?1:0)) { _:>
		</tr><tr>
<:
          } # end new row
        } # end printing of $save
      # end if $Dir_Thumbs
      } else {
				 	print Image_Array( (-e Get($alb,'path').'/.htaccess') ? @Locked : @NotLocked);
					print "<span class='dirname'>\n";
					print Get($alb,'href','dir');
					print Pretty(Name($alb),1,1), "</a>";
					print "</span>\n";
					my $cap = Caption($alb);
					my $num_pics = Get($alb,'num_pics_str');
					my $num_dirs = Get($alb,'num_dirs_str');
					if ($cap || $num_pics || $num_dirs) { _:>
						<span class='dircap'>
						&nbsp;
						<font size='-2'>
						<:=$cap if $cap:>
						<:=": " if $cap && ($num_pics || $num_dirs):>
						<:=$num_dirs:>
						<:=", " if $num_pics && $num_dirs:>
						<:=$num_pics:>
						</font>
						</span>
          <: }
				print "<br />\n";
      } # end not $Dir_Thumbs
      $alb = Next($alb);
    } # End child album loop
_:>

<:    if (!$Dir_Thumbs) { :>
        <:=$END_FONT:>
      </td>
      <td>
				<center>
					<:=$START_MAIN:>
					  <:pHeader():>
					<:=$END_FONT:>
				</center>
      </td>
<:    }
:>//
		</tr>
	</table>

				</td>
			</tr>

#c// Bar after child albums
<: Bar($Cols) :>

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

#c//
#c// The images
<:
  my $img = First('pics');
  if ($img) { _:>//
			<tr>
<:  my @save;
    while ($img) {
_:>
				<td align='center' valign='bottom' width='<:=$Col_Perc:>'>
					<: PickOverlay($img, 'thumb') if @Overlays :>
					<: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :>
          <: push(@save,$img); :>
			  </td>

<:    if (New_Row($img,$Cols) || !Next($img)) { _:>
		</tr><tr>
<:      foreach my $save ( @save ) { _:>
				<td align='center' valign='top' width='<:=$Col_Perc:>'>
				  <:=$START_MAIN:>
					<span class='thumbname'>
					<:=Get($save,'href','image'):>
					<:=Pretty(Name($save),1,1):></a>
					</span>
					<: if (my $cap = Caption($save)) { _:>
						<span class='thumbcap'>
						<br />
						<font size='-2'>
						<:=$cap:>
						</font>
						</span>
					<: } :>
					<:=$END_FONT:>
				</td>
<:
        }
        undef @save;
        if (New_Row($img,$Cols)) { _:>
			</tr>
			<tr>
				<td height="20" colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,20):></td>
			</tr>
			<tr>
<:
        }
      }
      $img = Next($img);
    } # End child album loop
_:>

			</tr>
			<tr>
				<td height="20" colspan="<:=$Cols:>"><:=Image_Array("$PATH/Null.gif",20,20):></td>
			</tr>

<: Bar($Cols) :>

<:}:>//

<: if (isFooter()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">
					<br />
					<center>
						<:pFooter():>
					</center>
				</td>
			</tr>

<: Bar($Cols) :>

<: } _:>

			<tr>
				<td colspan="<:=$Cols:>">
					<div align="center">
						<:=$START_CREDIT:><: Credit() :> on <:=scalar localtime:><:=$END_FONT:></div>
				</td>
			</tr>
		</table>
		<p></p>
	</body>

</html>
