<?php if ($mod==""){
	header('location:../../404.php');
}else{
?>
<!-- 
*******************************************************
	Include Header Template
******************************************************* 
-->
<?php include_once "po-content/$folder/header.php"; ?>


<!-- 
*******************************************************
	Main Content Template
******************************************************* 
-->
	<div id="content" class="container">
		<div id="main" class="row-fluid">
			<header class="entry-header">
				<h1 class="entry-title"><span>Galeri</span></h1>
			</header><!-- .entry-header -->
			<div class="row-fluid">
				<?php
				$tablegal = new PoTable('gallery');
				$gallerys = $tablegal->findAllRand();
				foreach($gallerys as $gallery){
					$idalb = $gallery->id_album;
					$tablecalb = new PoTable('album');
					$currentCalb = $tablecalb->findBy(id_album, $idalb);
					$currentCalb = $currentCalb->current();
					if ($currentCalb->active == 'Y'){
					?>
					<div class="kontengal4 span3">
						<article class="galleries">
							<a href="po-content/po-upload/<?php echo $gallery->picture; ?>" title="<?php echo $gallery->title; ?>" rel="prettyPhoto"><img width="570" height="360" src="po-content/po-upload/medium-<?php echo $gallery->picture; ?>" alt="<?php echo $gallery->title; ?>" /></a>
							<h3 class="gal-title"><a href="#" title="<?php echo $gallery->title; ?>" rel="bookmark"><?php echo $currentCalb->title; ?> - <?php echo $gallery->title; ?></a></h3>
						</article>
					</div>
					<?php
					}
				}
				?>
				</div>
			<div class="clearfix"></div>
		</div><!-- #main -->
	</div><!-- #content -->


<!-- 
*******************************************************
	Include Footer Template
******************************************************* 
-->
<?php include_once "po-content/$folder/footer.php"; ?>
<?php } ?>