<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="keywords" content="<?php echo $head[keywords];?>" />
<meta name="description" content="<?php echo $head[description];?>" />
<base href="<?php echo $DIRCMS['site_url'];?>" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link href="template/<?php echo $DIRCMS['tpl_name'];?>/css/share.css" type="text/css" rel="stylesheet" />
<link href="template/<?php echo $DIRCMS['tpl_name'];?>/css/tg.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="images/js/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="template/<?php echo $DIRCMS['tpl_name'];?>/images/site.js"></script>
<script language="javascript" type="text/javascript" src="template/<?php echo $DIRCMS['tpl_name'];?>/images/timeCountDown.js"></script>
<title><?php echo $head[title];?></title>
</head>

<body>
	<!-- 头部开始 -->
	<?php include template('head');?>
	<!-- 头部结束 -->
	<!-- 正文开始 -->
	<div class="ads_960"><script language="javascript" src="<?php echo $DIRCMS[site_url];?>ads.js.php?id=8"></script></div>
	<div class="position"><?php echo $dir_postion;?></div>
	<div class="tg_top">
		<div class="tg_top_left">

			<?php $dir_page="";$_DATA=get_tag_data($catid,'0','8',0,0,'1','id DESC',0,'1');foreach($_DATA as $no => $r)if(is_array($r)){?>
			<div class="tg_top_left_content">
				<div class="tg_top_title">
				<a href="<?php echo $r['url'];?>" title="<?php echo $r['title'];?>" target="_blank"><?php echo $r['title'];?></a> <input type="button" onclick="window.open('<?php echo $DIRCMS['site_url'];?><?php echo $r['url'];?>#bm');" class="yl_btn" value="立即报名" />
				</div>
				<div class="tg_top_pic">
					<div class="tg_top_pic_left">
						<div class="tg_top_pic_left_zk">
							<div class="tg_top_pic_left_zk_price">&yen;<span id="youhuijia<?php echo $no;?>">loading...</span></div>
							<div class="tg_top_pic_left_zk_zk"><?php echo $r['zhekou'];?>折</div>
						</div>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
						  <tr>
							<td>原价</td>
							<td>折扣</td>
							<td>节省</td>
						  </tr>
						  <tr>
							<th>&yen;<span id="yuanjia<?php echo $no;?>"><?php echo $r['yuanjia'];?></span></th>
							<th><span id="zhekou<?php echo $no;?>"><?php echo $r['zhekou'];?>折</span></th>
							<th style="color:#ff6600">&yen;<span id="jiesheng<?php echo $no;?>">loading...</span></font></th>
						  </tr>
						</table>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
						  <tr>
							<td>距离本次团购结束还有：</td>
						  </tr>
						  <tr>
							<td><font class="djs" id="day<?php echo $no;?>">0</font>天<font class="djs" id="hour<?php echo $no;?>">00</font>小时<font class="djs" id="mini<?php echo $no;?>">00</font>分<font class="djs" id="sec<?php echo $no;?>">00</font> 秒</td>
						  </tr>
						</table>
						<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-bottom:0px">
						  <tr>
							<td><font class="renshu"><?php echo getSign($r['id']);?></font> 人已参加</td>
						  </tr>
						  <tr>
							<td><font class="zt" id="status<?php echo $no;?>">团购进行中</font></td>
						  </tr>
						  <tr>
						  	<td>
<font class="hui">
报名时间：<?php echo date('m月d日 H时i分',strtotime($r['kaishi']));?>
<br />
截止时间：<?php echo date('m月d日 H时i分',strtotime($r['jiezhi']));?>
</font>
							</td>
						  </tr>
						</table>
					</div>
					<script language="javascript">
						var yuanjia=parseFloat($('#yuanjia<?php echo $no;?>').html());
						var zhekou=parseFloat($('#zhekou<?php echo $no;?>').html());
						var youhuijia=parseFloat(yuanjia-yuanjia*zhekou/100).toFixed(2);
						var jiesheng=parseFloat(yuanjia*zhekou/100).toFixed(2);
						var now=new Date();
						var timestr=add_zero(now.getYear()).toString()+add_zero(now.getMonth()+1).toString()+add_zero(now.getDate()).toString()+add_zero(now.getHours()).toString()+add_zero(now.getMinutes()).toString()+add_zero(now.getSeconds()).toString();
						//var
						
						$('#youhuijia<?php echo $no;?>').html(youhuijia);
						$('#jiesheng<?php echo $no;?>').html(jiesheng);
						var zxx = {
							$: function(id){
								return document.getElementById(id);    
							},
							futureDate: Date.UTC(<?php echo date('Y',strtotime($r['jiezhi']));?>, <?php echo date('m',(strtotime($r['jiezhi'])-3600*24));?>, <?php echo date('d',strtotime($r['jiezhi']));?>, <?php echo date('H',strtotime($r['jiezhi']));?>),
							obj: function(){
								return {
									sec: zxx.$("sec<?php echo $no;?>"),
									mini: zxx.$("mini<?php echo $no;?>"),
									hour: zxx.$("hour<?php echo $no;?>"),
									day: zxx.$("day<?php echo $no;?>")
								}
							}
						};
						fnTimeCountDown(zxx.futureDate, zxx.obj());
						if(parseInt(timestr)><?php echo date('YmdHis',strtotime($r['jiezhi']));?>)
						{
							$('#status<?php echo $no;?>').html('<font color="#ff6600"><b>团购已过期</b></font>');
						}
					</script>
					<div class="tg_top_pic_right">
						<img src="<?php echo $r['thumb'];?>" />
						<div class="tg_top_pic_right_desc">						
						<?php echo sub_string($r['description'],220,'...');?>
						</div>
						<div class="tg_top_pic_right_share">
						分享到： 
						<script type="text/javascript" src="template/<?php echo $DIRCMS['tpl_name'];?>/images/share.js"></script>
						</div>
					</div>
				</div>
			</div>
			<?php } $dir_page=$_DATA['pagestring'];unset($_DATA); ?>
		</div>
		<div class="tg_top_right">
			<div class="tg_top_right_wrap" style="margin-top:0px">
				<Div class="tg_top_right_title">今日推荐团购</Div>
				<?php $dir_page="";$_DATA=get_tag_data($catid,'5','1',0,0,'1','id DESC',0,'0');foreach($_DATA as $no => $r)if(is_array($r)){?>
				<div class="tg_top_right_content">
					<a href="<?php echo $r['url'];?>" title="<?php echo $r['title'];?>" target="_blank"><img src="<?php echo $r['thumb'];?>" width="215" height="150" /></a>
					<br />
					<a href="<?php echo $r['url'];?>" title="<?php echo $r['title'];?>" target="_blank" class="tg_top_right_a_bt">参与这个团购</a>
				</div>
				<?php } $dir_page=$_DATA['pagestring'];unset($_DATA); ?>
			</div>
			<div class="tg_top_right_wrap">
				<Div class="tg_top_right_title">赞助商链接</Div>
				<div class="tg_top_right_content">
					<ul>
						<script type="text/javascript"><!--
google_ad_client = "pub-9442525253295629";
/* 200x200, 创建于 09-7-4 */
google_ad_slot = "9441498570";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>					</ul>
				</div>
			</div>
		</div>	
	</div>
	<!-- 正文结束 -->
	<!-- 底部开始 -->
	<?php include template('footer');?>
	<!-- 底部结束 -->
</body>
</html>