<?
	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' order by 'image_id'", $db);
	$image_count = mysql_num_rows($image_result);
	
	$w2 = 0;
	$image_w_result = mysql_query("SELECT width FROM images WHERE fid = '$fid' order by width desc", $db);
	$image_count = mysql_num_rows($image_w_result);
	while($image_w = mysql_fetch_object($image_w_result)){
		$w1 = $image_w->width;
		if($w1 > $w2){
			$w2 = $w1;
		}
		
	}
	
	$h2 = 0;
	$image_h_result = mysql_query("SELECT height FROM images WHERE fid = '$fid' order by height desc", $db);
	while($image_h = mysql_fetch_object($image_h_result)){
		$h1 = $image_h->height;
		if($h1 > $h2){
			$h2 = $h1;
		}
	}
	
	$extra_height = 120;
	$extra_width = 20;

?>
<title>360 Spin</title>
<body bgcolor="#eeeeee" onload="window.open('display_spin.php?fid=<? echo $fid; ?>&sid=<? echo $setup->title; ?>', 'image_win', ['HEIGHT=<? echo $h2 + $extra_height; ?>', 'WIDTH=<? echo $w2 + $extra_width; ?>', 'dependent']);<? if($close == 1){ echo "window.close()"; } ?>">
<center>
