<? require_once "application_top.php"; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Bihar Blood Bank</title>

<? include ("include/header.php"); ?>

<link rel="stylesheet" type="text/css" href="resources/fancy.css" />
	
	<script type="text/javascript" src="js/jquery-1.2.3.pack.js"></script>
	<script type="text/javascript" src="js/jquery.fancybox-1.0.0.js"></script>
	
	<script type="text/javascript">
	
		$(function(){
		
			$(".photo-link").fancybox({ 'zoomSpeedIn': 500, 'zoomSpeedOut': 500, 'overlayShow': true }); 
		
		});
	
	</script>

	<table id="containerTable">
	<tr>
		<td width="220">
		<? require "left.php";?>
		</td>
		
		<td width="500px;">
		<h1>Gallery</h1>
		<?=$msg;?>
		<br/>
		
		<div id="page-wrap">
	
	<?php
		
		/* settings */
		$image_dir = 'images/gallery/';
		$per_column = 4;
		$count = 1;
		
		/* step one:  read directory, make array of files */
		if ($handle = opendir($image_dir)) {
			while (false !== ($file = readdir($handle))) 
			{
				if ($file != '.' && $file != '..') 
				{
					//commented following lines to not to use thumbnails -- also commented on line 61 -- hemantjadhav.com
					//if(strstr($file,'-thumb'))
					//{
						$files[] = $file;
					//}
				}
			}
			closedir($handle);
		}
		
		/* step two: loop through, format gallery */
		if(count($files))
		{
			foreach($files as $file)
			{
				$count++;
				echo '<a class="photo-link" rel="one-big-group" href="',$image_dir,str_replace('-thumb','',$file),'"><img src="',$image_dir,$file,'" width="100" height="100" /></a>';
				if($count % $per_column == 0) { echo '<div class="clear"></div>'; }
			}
		}
		else
		{
			echo '<p>There are no images in this gallery.</p>';
		}
		
	?>
	
	</div>

		</td>
		
		<td width="220" align="right">
		<? require "right.php";?>
		</td>
	</tr>
	</table>
	
<? include ("include/footer.php"); ?>