#c// ###################################################################
#c// Album Theme by David Ljung Madison based on
#c// generic SimmerTheme by Dave Simmer of DaveWeb.com
#c// -- Auto generated by http://MarginalHacks.com/Hacks/album/simmer_theme
#c// ###################################################################
#c//
<:
  # Image arrays are: name, width, height
  sub img_src { print "<img src='$PATH/$_[0]' width='$_[1]' height='$_[2]' $_[3] border='0'>" if ($_[1]); }

  # Path setting - this is the path to the images
  $PATH = Theme_Path();

  # Font/color settings for the document
  $TITLE_FONT = "size='5' color='#ffffff' face='Times New Roman,Georgia,Times'";
  $MAIN_FONT = "face='Times New Roman,Georgia,Times'";
  $CREDIT_FONT = "face='Verdana' color='#ffffff'";
  $BODY = "background='$PATH/bkgrnd.gif' link='#aaaaaa' alink='#aaaaaa' vlink='#aaaaaa' text='#FFFFFF'";

  # Icons/graphics
  @Bar_L =	("Bar_L.gif", 27, 20);
  @Bar_M =	("Bar_M.gif", "90%", 20);
  @Bar_R =	("Bar_R.gif", 27, 20);
  @Icon =	("Icon.gif", 111, 24);
  @Back =	("Back.gif", 103, 24);
  @Next =	("Next.gif", 24, 42);
  @Prev =	("Prev.gif", 24, 42);
  @More =	("More.gif", 103, 24);

  # Thumbnail border
  $X = Image_Page() ? Image_Width() : Get_Opt('x');
  $Y = Image_Page() ? Image_Height() : Get_Opt('y');
  @ThBord_LT =	("ThBord_LT.gif", 27, 20);
  @ThBord_RT =	("ThBord_RT.gif", 27, 20);
  @ThBord_LB =	("ThBord_LB.gif", 27, 20);
  @ThBord_RB =	("ThBord_RB.gif", 27, 20);
  @ThBord_L =	("ThBord_L.gif", 27, $Y-20-20);
  @ThBord_R =	("ThBord_R.gif", 27, $Y-20-20);
  @ThBord_TL =	("ThBord_TL.gif", 45, 27);
  @ThBord_TR =	("ThBord_TR.gif", 45, 27);
  @ThBord_BL =	("ThBord_BL.gif", 45, 27);
  @ThBord_BR =	("ThBord_BR.gif", 45, 27);
  @ThBord_T =	("ThBord_T.gif", $X+27+27-45-45, 27);
  @ThBord_B =	("ThBord_B.gif", $X+27+27-45-45, 27);
:>//
#c//
#c// ###################################################################
#c// Everything beyond here is the same for the generic DaveWeb theme..
#c// ###################################################################
<:
  # Shorthand for column info specified by -columns
  $Cols = Get_Opt('columns');
  $Col_Perc = int(100/$Cols)."%";
:>//
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
		<: Meta() :>
		<title>Album: <: pAlbum_Name() :></title>
	</head>

	<body <:=$BODY:>>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr height="10">
				<td colspan="<:=($Cols-1):>" height="10"><img src="<:=$PATH:>/Null.gif" width="11" height="10" border="0"></td>
			</tr>
			<tr>
				<td colspan="<:=($Cols-1):>">
					<:img_src(@Icon,"align='absmiddle'"):>
					<br>
					<font <:=$TITLE_FONT:>>
					&nbsp;&nbsp;&nbsp;&nbsp;<: pJoin_Parent_Albums(":"); :>
					</font></td>
				<td valign='top' width="25%">
					<div align="right">
						<a href='<:=Back():>'><:@Back ? img_src(@Back,"align='absmiddle'") : print "<h2>Back</h2>"; :></font></a></div>
				</td>
			</tr>
<: if (isHeader()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">
					<br>
					<center>
						<:pHeader():>
					</center>
				</td>
			</tr>
<: } _:>
			<tr height="<:=$bar_H:>">
				<td colspan="<:=$Cols:>" height="<:=$bar_H:>">
					<div align="center">
						<nobr><:img_src(@Bar_L); img_src(@Bar_M); img_src(@Bar_R);:></nobr>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan="<:=$Cols:>"><img src="<:=$PATH:>/Null.gif" width="20" height="10" border="0"></td>
			</tr>

#c// Are there more albums below this one?
<:  if (Child_Albums()) { _:>
			<tr>
				<td colspan="<:=$Cols:>">

	<table width='100%' align='center' cellspacing='3'>
		<tr>
<:    if (@More) { :>
			<td height='50' align='center' width='<:=$Col_Perc:>' valign='top'>
				<:img_src(@More):>
			</td>
<:    } else { :>
			<td height='50' align='center' width='<:=$Col_Perc:>' valign='top'>
				<h2>More albums:</h2>
			</td>
<:    } :>
#c//
#c// Loop on all the albums
<:    while (Child_Albums()) { _:>
			<td height='50' align='center' width='<:=$Col_Perc:>' valign='top'>
				<font <:=$TITLE_FONT:>><: pChild_Album() :></font>
			</td>
#c//
#c// And start a new row every fourth one
<:      if (!((Child_Album_Cnt()+1) % $Cols) && Child_Albums_Left()) { _:>
		</tr><tr>
<:      } :>
#c//
#c// End album loop
<:    Next_Child_Album() :>
<:    } :>

		</tr>
	</table>

				</td>
			</tr>

#c// Bar after child albums
			<tr height="<:=$bar_H:>">
				<td colspan="<:=$Cols:>" height="<:=$bar_H:>">
					<div align="center">
						<nobr><:img_src(@Bar_L); img_src(@Bar_M); img_src(@Bar_R);:></nobr>
					</div>
				</td>
			</tr>

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

			<tr>
#c//
#c// The images
<: if (Images()) {
while (Images()) { _:>//
				<td align='center' valign='top' width='<:=$Col_Perc:>'>
<: if (@ThBord_LB) { _:>
#c// The thumbnail is a complicated table for handling all the corners...
					<table border='0' cellpadding='0' cellspacing='0'>
						<tr>
							<td colspan='3'><:img_src(@ThBord_TL):><:img_src(@ThBord_T):><:img_src(@ThBord_TR):></td>
						</tr> <tr>
							<td><:img_src(@ThBord_LT):></td>
							<td rowspan='3'><a href=<:=Image_URL():>><img src=<:=Image_Thumb():> alt=<:=Image_Alt():> width='<:=Get_Opt('x'):>' height="<:=Get_Opt('y'):>" border="0"></a></td>
							<td><:img_src(@ThBord_RT):></td>
						</tr> <tr>
							<td><:img_src(@ThBord_L):></td>
							<td><:img_src(@ThBord_R):></td>
						</tr> <tr>
							<td><:img_src(@ThBord_LB):></td>
							<td><:img_src(@ThBord_RB):></td>
						</tr> <tr>
							<td colspan='3'><:img_src(@ThBord_BL):><:img_src(@ThBord_B):><:img_src(@ThBord_BR):></td>
						</tr>
					</table>
<: } else { _:>
					<nobr><:img_src(@ThBord_TL):><:img_src(@ThBord_T):><:img_src(@ThBord_TR):></nobr><br />
					<nobr><:img_src(@ThBord_L):><a href=<:=Image_URL():>><:pImage_Thumb_Src():></a><:img_src(@ThBord_R):></nobr><br />
					<nobr><:img_src(@ThBord_BL):><:img_src(@ThBord_B):><:img_src(@ThBord_BR):></nobr><br />
<: } _:>

					<font <:=$MAIN_FONT:>>
					<a href=<:=Image_URL():>>
					<:=Image_Name():></a>
						<br>
						<font size=-2>
						<:pImage_Caption():>
						</font>
					</font>
				</td>

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

			<tr height="20">
				<td height="20" colspan="<:=$Cols:>"><img src="<:=$PATH:>/Null.gif" width="20" height="20" border="0"></td>
			</tr>

			<tr height="<:=$bar_H:>">
				<td colspan="<:=$Cols:>" height="<:=$bar_H:>">
					<div align="center">
						<nobr><:img_src(@Bar_L); img_src(@Bar_M); img_src(@Bar_R);:></nobr>
					</div>
				</td>
			</tr>

<:}:>//

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

			<tr height="<:=$bar_H:>">
				<td colspan="<:=$Cols:>" height="<:=$bar_H:>">
					<div align="center">
						<nobr><:img_src(@Bar_L); img_src(@Bar_M); img_src(@Bar_R);:></nobr>
					</div>
				</td>
			</tr>
<: } _:>

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

</html>
