<?
	include('_db.connection.php');
	
	$folder_result = mysql_query("SELECT mid FROM folders WHERE folder_id = '$fid'", $db);
	$folder = mysql_fetch_object($folder_result);
	
	$member_result = mysql_query("SELECT * FROM members WHERE member_id = '$folder->mid'", $db);
	$member = mysql_fetch_object($member_result);
	
	$image_result = mysql_query("SELECT * FROM images WHERE fid = '$fid'", $db);
	$image_count = mysql_num_rows($image_result);
	
	$file_path = "./usr/" . $member->member_id;

?>


<script language="javascript">
	
	<?php
	$i = 0;
	while($image = mysql_fetch_object($image_result)){
	?>
	spin<? echo $i; ?> = new Image();
		spin<? echo $i; ?>.src = "<? echo $file_path . "/" . $image->filename; ?>";
	<?	
		$i++;
		} 
	?>
		
	var x = "0"
	var s = ""
	
	function spinIt( image ) {
		s = 1;
		spins.src = eval("spin" + image + ".src");
	}
	
	function autoSpin(i) {
		spins.src = eval("spin" + i + ".src");
	}
	
	function countdown()
		{
		if(s != 1) {
			if(x > <? echo $rs->images - 1; ?>) {
				x = 0;
			}
			autoSpin(x);
			x = eval(x + 1);
			timerID = setTimeout("countdown()", 250)
			}
		}
	
</script>

<table cellpadding="0" cellspacing="0" height="100%" width="100%" border="0">

	<tr>
		<td align="center" valign="middle">
			<map name="hotspots">
			<?php
			//$image_result2 = mysql_query("SELECT * FROM images WHERE fid = '$fid'", $db);
			//$image_count2 = mysql_num_rows($image2_result);
			
			$width = 300;
			$divider = round($width / $image_count);
			$third = $divider;
			$first = 0;
			
			for ($i2 = 0; $i2 < $image_count; $i2++){
			?>
			<area shape="rect" coords="<? echo $first; ?>,0,<? echo $third; ?>,<? echo $width; ?>" href="#" onmouseover="spinIt('<? echo $i2; ?>')">	
			<?	
				$first = $first + $divider;
				$third = $third + $divider;
				$i++;
				} 
				
				$image_result2 = mysql_query("SELECT * FROM images WHERE fid = '$fid'", $db);
				$first_image = mysql_fetch_object($image_result2);
				$first_image2 = $first_image->filename;
			?>
			</map>
		</td>
		
	</tr>
	
	<tr>
	
		<td align="center" valign="middle"><img src="<?php print( $file_path ) . "/" . $first_image2; ?>" name="spins" usemap="#hotspots" width="300" border="0"></td>
		
	</tr>
	
	<tr>
	
		<td height="100%" align="center" valign="bottom"><font face="verdana" size="1" color="#ffffff">Powered By <a href="" target="new"><font color="#ffffff"><? echo "myeasypics.c0m"; ?></a></font></td>
	
	</tr>
	
</table>