<!-- GALLERY -->
<script language='javascript'>
		function imgswitch(newimg){
		large.src="<? echo $setup->url; ?>/is.php?i=" + newimg;
		}
</script>
		<?
			$x = 1;
			$z = 1;
			$image_result = mysql_query("SELECT * FROM images WHERE fid = '$fid' order by height desc", $db);
			$image_count = mysql_num_rows($image_result);
			while($image = mysql_fetch_object($image_result)){
				
				if($x == 1){
		?>
<center>
<table>
	<tr>
		<td><img src="<? echo $setup->url; ?>/images/spacer.gif" width="1" height="<? echo $image->height + 10;?>"></td>
		<td width="460" valign="middle" align="center" style="border: 1px solid #dddddd; padding: 5px;">
		<img src="<? echo $setup->url; ?>/is.php?i=<? echo $image->image_id; ?>" name="large"></td>
		<td width="60" valign="top" align="center" bgcolor="#F7F7F7" style="border: 1px solid #dddddd; padding: 5px;">
			<table>
			<?
			echo "\n";
					if($z == 1){
						echo "\t\t\t\t<tr>\n";
						echo "\t\t\t\t\t<td><a href=\"javascript:imgswitch($image->image_id);\"><img src=\"$setup->url/usr/$mid/hta_$image->filename\" border=\"0\" style=\"border: 1px solid #333333\" width=\"50\" height=\"37\"></td>\n";
						$z = 0;
					}
					else {
						echo "\t\t\t\t\t<td><a href=\"javascript:imgswitch($image->image_id);\"><img src=\"$setup->url/usr/$mid/hta_$image->filename\" border=\"0\" style=\"border: 1px solid #333333\" width=\"50\" height=\"37\"></td>\n\t\t\t\t</tr>\n";
						$z = 1;
					}
				}
				else {
					if($z == 1){
						echo "\t\t\t\t<tr>\n";
						echo "\t\t\t\t\t<td><a href=\"javascript:imgswitch($image->image_id);\"><img src=\"$setup->url/usr/$mid/hta_$image->filename\" border=\"0\" style=\"border: 1px solid #333333\" width=\"50\" height=\"37\"></td>\n";
						$z = 0;
					}
					else {
						echo "\t\t\t\t\t<td><a href=\"javascript:imgswitch($image->image_id);\"><img src=\"$setup->url/usr/$mid/hta_$image->filename\" border=\"0\" style=\"border: 1px solid #333333\" width=\"50\" height=\"37\"></td>\n\t\t\t\t</tr>\n";
						$z = 1;
					}
				}
				$x++;
			}
		?>
			</table>
		</td>
	</tr>
	<tr>
		<td></td>
		<td colspan="2" valign="top" align="right" bgcolor="#F7F7F7" style="border: 1px solid #dddddd; padding: 5px;">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td valign="middle"><img src="<? echo $setup->url; ?>/images/logo.dots.gif"></td>
					<td valign="middle"><font face="verdana" size="1" color="#333333">&nbsp;&nbsp;Image Gallery Hosted By <a href="<? echo $setup->url; ?>" target="_new"><? echo $setup->title; ?></a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</center>