#c options: -no_image_pages
#c// ###################################################################
#c// Another theme by Daveola  http://MarginalHacks.com/
#c// ###################################################################
<: $col_perc = int(100/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: <: pAlbum_Name() :>
    </title>
    <: Meta() :>
  </head>
  <body bgcolor='white' link="gray">


#c  # Are there any images?  (There might only be Child_Albums!)
<:  if (Images()) {  $saw_images = 1;  _:>
<script language="JavaScript">

var faux = null;

// Preload info into array:  name1,url1, name2,url2,...
var images = new Array(
<:
  while(Images()) {
    my $name = Image_Name();  $name =~ s/'/\\'/g;
    print "\t".Image_URL().",'$name'";
    Next_Image();
    print "," if (Images_Left());
    print "\n";
  }
_:>//
);


function popUpImage(num) {
  num = num * 2;

  //faux = window.open('','newWin','fullscreen=yes');
  //faux = window.open('','newWin');
  faux = window.open('','newWin','resizable=0','status=0',
		'directories=0','scrollbars=0','toolbar=0');
  var fd = faux.document;

  fd.open();
  fd.write('<html>\n');
  fd.write('  <head>\n');
  fd.write('    <title>' + images[num+1] + '</title>\n');
  fd.write('    <\SCRIPT LANGUAGE="JavaScript">\n');
  fd.write('      function closeWin() {\n');
  fd.write('        window.close();\n');
  fd.write('      }\n');
  fd.write('      if (window.Event) document.captureEvents(Event.ONCLICK);\n');
  fd.write('      document.onclick = closeWin;\n');
  fd.write('      if (window.Event) document.captureEvents(Event.MOUSEUP);\n');
  fd.write('      document.onmouseup = closeWin;\n');
  fd.write('    </\SCRIPT>\n');
  fd.write('  </head>\n');
  fd.write('\n');
  fd.write('  <body bgcolor="#ffffff" style="overflow:hidden" onLoad="window.focus()">\n');
  fd.write('    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">\n');
  fd.write('      <tr>\n');
  fd.write('        <td align="center" valign="middle">\n');
  fd.write('          <a href="javascript:window.close()">\n');
  fd.write("          <img border=0 src='" + images[num] + "'></a>\n");
  fd.write('        </td>\n');
  fd.write('      </tr>\n');
  fd.write('    </table>\n');
  fd.write('  </body>\n');
  fd.write('</html>\n');

  fd.close();
}
// -->
</script>
<:  } _:>// End if images

<center>

  <table width='100%'  bgcolor="#f0f0f0">
    <tr>
      <td align='left'>
        <h2> <: pJoin_Parent_Albums(":"); :> </h2>
      </td>
      <td align='right'>
        <h1><a href=<:=Back():>>Up</a></h1>
	updated <: print `date` :>
      </td>
    </tr>
  </table>

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

#c  # Are there more albums below this one?
<:  if (Child_Albums()) { _:>
  <table width='100%' align='center' cellspacing='3'>
    <tr>
      <td width='<:=$col_perc:>' valign='top'>
<h3>more:</h3>
      </td>

#c    # Loop on all the albums
<:    while (Child_Albums()) { _:>
        <td width='<:=$col_perc:>' valign='top'>
          <font size='+1'>
            <: pChild_Album() :>
          </font>
        </td>

#c      # And start a new row every fourth one
<:      if (!((Child_Album_Cnt()+1) % Option('columns'))) { _:>
</tr><tr>
<:      } :>

#c    # End album loop
<:    Next_Child_Album() :>
<:    } :>
    </tr>
  </table>

#c  # End if albums
<:  } :>

<:  if ($saw_images) {  _:>

  <table cellspacing='10' width='95%'>
    <tr>

#c    # Loop on the images
<:    my $count = 0; _:>
<:    Set_Image_This(0); _:>
<:    while(Images()) { _:>
        <td width='25%' valign='top'>
<:
          print "<a href='javascript:popUpImage($count)'>";
          $count++;
          pImage_Thumb_Src() if (Image_Is_Pic());
          print "<br />\n";
          print Image_Name();
          print "<br />\n";
          print "<font size='-2'>\n";
          pImage_Caption();
          print "</font>\n";
:>
        </td>

<:      if (!(Image_Cnt() % Option('columns')) && Images_Left()) { _:>
          </tr><tr>
<:      } :>

#c    # End while images
<:    Next_Image() :>
<:    } :>
    </tr>
  </table>

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

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

<br>
    <font size=-1>
      <: Credit() :> 
    </font>
  </body>
</html>

