<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/core.js"></script>
<script type="text/javascript" src="js/highlight.js"></script>
<script type="text/javascript" src="js/countdown.js"></script>
<?
$feature_sql="select * from auction_details where status='Active' and selling_method!='ads' and selling_method!='want_it_now' and picture1!='' order by rand() limit 0,5 ";
	$feature_res=mysql_query($feature_sql);
	$tot_count=mysql_num_rows($feature_res);
	$count=0;
	if($tot_count > 0)
	{
	 ?>
	
	<table width="980" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_l.gif></td>
<td class="tdhead_main" width="98%" height="24" valign="middle">&nbsp;<B>Special Items</b></td>
<td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_r.gif></td></tr>
	</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" width=980 class="ft_right">
    <?
$i=1;
		while($feature_row=mysql_fetch_array($feature_res))
	{
	$string_1=$feature_row[detailed_descrip];
	?>
	<td valign=middle align="center">
	<table align="center" valign="middle" cellpadding=5 cellspacing=2 style="background:url(templates/<? echo "$tfold" ?>/img_files/prod.gif) no-repeat center;">
	<tr><td valign="top" width="180" height="270" align="center" valign="middle">

	<?
	               $img=$feature_row['picture1'];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>80)	
				   {
				   $nh=80;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>100)
				  {
				  $nw=100;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
$w=round($w);	
	?>
<script type="text/javascript">
<!-- hide from non JavaScript Browsers
Image<?=$i?>= new Image;
Image<?=$i?>.src = "uploads/<? echo $feature_row['picture1']; ?>"
// End Hiding -->
</script>
	<table height="49" border="0" cellpadding=0 cellspacing=0>
		<tr>
		<td height="12" ></td>
		</tr>
		<tr>
		<td align="center" style="padding-right:5px;padding-left:5px;padding-top:5px;padding-bottom:5px;">
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
	<? echo $feature_row['producttitle'];?></a>
</td></tr><tr><td align="center">
		
		<table border="0" cellpadding="0" cellspacing="0" width=65 height=65 bordercolor="#000000">
		<tr valign="top">
		<td align="center" bgcolor="#ffffff">

	<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
	 <img src="uploads/<? echo $feature_row['picture1']; ?>" width=<?= $w; ?> height=<?=$h?> border=0>
	</a>

<?
$expiry_date = $feature_row['expire_date'];
        $date1 = strtotime(now);
		$date22=strtotime($expiry_date);

      $date1 = date("Y,m,j,G,i,s",$date1);
      $date2 = date("Y,m,j,G,i,s",$date22); 
      $exdate = date("YmjGis",$date22);

$futuredate = date("M j, Y G:i:s",$date22); 
$min_bid_amount=$feature_row['min_bid_amount'];
$bidincrement=$feature_row['bidincrement'];

$bid_sql2="select * from site_bids where productid=".$feature_row['productid']." order by bidding_amount desc";
$bid_res2=mysql_query($bid_sql2);
$bid_row2=mysql_fetch_array($bid_res2);
$user_bid_amt=$bid_row2[bidding_amount];

$user_bid_amt = $user_bid_amt + $bidincrement;


$user_bid_id=$bid_row2['user_id'];
if($user_bid_amt==$bidincrement)
{
$user_bid_amt = $min_bid_amount;
}
$query="select * from auction_details where productid=".$feature_row['productid'];
$table=mysql_query($query);
$row=mysql_fetch_array($table);
$sale_price=$row['currency'];

$highest_bidder_sql="select * from member_details where user_id=".$user_bid_id;
$highest_bidder_res=mysql_query($highest_bidder_sql);
$highest_bidder_res=mysql_fetch_array($highest_bidder_res);
$user_bid_name=$highest_bidder_res[user_name];

if($user_bid_name=="")
{
$user_bid_name = "None";
}
?>
<?
$bidnow=$_SESSION[userid];
?>
<div id="futu<?=$i?>" style="display:none;"><?=$futuredate?></div>
<SCRIPT LANGUAGE='javascript'>countdown(<?=$date1?>,<?=$i?>,0)</SCRIPT>
	</td>
		</tr>
		</table>
		</td>
		</tr>
		<tr>
		<? 
 		$expire_date = $feature_row['expire_date']; 
    require 'ends.php';
?>	<td valign=top align="center">
	<br>
	     


<div id="Bid<?=$i?>">
<B>--|--|--|--</b>
</div>
<div style="border:0px; padding:0px; font-weight:bold; color:RED; font-size:12px;">
<span style="border:0px; padding:0px; font-weight:bold; color:teal; font-size:12px;" id="Amt<?=$i?>">
<? echo Trim($sale_price); ?><? echo Trim($user_bid_amt); ?></span>
</div><BR>
<div style="font-weight:bold;" id="Usr<?=$i?>"><?=$user_bid_name?>
</div><BR>

<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$i?>','','templates/<?=$tfold?>/img_files/login.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow.png border="0"></a>
<? } ?>
<?if(!empty($_SESSION[userid])) { ?>
<a name= "link1" href="#" onclick="bidnow(<?=$feature_row['productid']?>,<?=$bidnow?>)" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow.png border="0"></a>
<? } ?>


<SCRIPT LANGUAGE='javascript'>setTimeout("GetUpdate(<? echo $feature_row['productid']; ?>,<?=$i?>,<?=$user_bid_amt?>,<?=$exdate?>)",15000);</SCRIPT>

</td>
		</tr>
		</table>	</td></tr>
	</table></td>
<?
$i++;
?>
	<?
	}
	?>
</table>
	<table width="980" cellpadding="0" cellspacing="0" >
<tr>
<td width="98%" height="5" valign="middle"><img src=templates/<?=$tfold?>/img_files/t_bot.gif border="0"></b></td>
</tr>
	</table>
	<?
	}
	?>
