<h1>Album: <?php echo $this->data['album']->name ?></h1>
<?php if($this->data['album']->subalbumof != 0): ?>
<p>
	<a href='/album.php?which=<?php echo $this->data['album']->subalbumof ?>'>Return to parent album</a>
</p>
<?php endif; ?>

<?php if($this->data['subalbums'] && !$this->data['thumbs']): ?>
<div id='sub_album_list_big'>
<?php else: ?>
<div id='sub_album_list'>
<?php endif; ?>
<?php foreach($this->data['subalbums'] as $subalbum): ?>
	<div class='album'>
		<a href="/album.php?which=<?php echo $subalbum['id'] ?>">
			<img src="/site/graphics/photosandvideos/album_icon.gif" />
		</a>
		<br />
		<a href="/album.php?which=<?php echo $subalbum['id'] ?>"><?php echo $subalbum->name ?></a>
	</div>
<?php endforeach; ?>
</div>

<?php if(!empty($this->data['thumbs'])): ?>
<div id='current_picture'>
	<img src='/site/data/photosandvideos/albums/<?php echo $this->data['album']->imagefolder.'/'.$this->data['first_photo'] ?>' id='main_photo'/>
	<p class='small'>
		<span id='photo_name'><?php echo str_replace('small_','',$this->data['first_photo']) ?></span>
		//
		<a href='javascript:LargerPhoto()'>view larger photo</a>
	</p>
</div>

<div id='thumbnails'>
<?php foreach($this->data['thumbs'] as $thumb): ?>
	<a href='javascript:ChangePicture("/site/data/photosandvideos/albums/<?php echo $this->data['album']->imagefolder ?>/<?php echo str_replace('thumb_','small_',$thumb) ?>","<?php echo str_replace('thumb_','',$thumb) ?>")'>
		<img src='/site/data/photosandvideos/albums/<?php echo $this->data['album']->imagefolder ?>/<?php echo $thumb ?>' />
	</a>
<?php endforeach; ?>
</div>

<p class='photo_count'>Album contains <?php echo $this->data['num_photos'] ?> photos.</p>

<?php elseif(!$this->data['subalbums']): ?>
<p>Sorry!  There are currently no photos in this album.</p>
<?php endif; ?>