<!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=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<?php include(DDROOTPATH.'/cache/title/'.$pagetag.'_title.php');?>
<link href="template/<?=MOBAN?>/css/tuangoufanli.css" rel="stylesheet" type="text/css" />
<LINK rel=stylesheet type=text/css href="template/<?=MOBAN?>/css/common.css">
<script language="javascript" type="text/javascript" src="template/<?=MOBAN?>/js/jquery.js"></script>
<script language="javascript" type="text/javascript" > 
window.onscroll=function(){
	var top=jQuery(document).scrollTop();
	if(top>450){
		jQuery("#fudong").css("display","");
	}else{
		jQuery("#fudong").css("display","none");
	}
}
 
jQuery(document).ready(
function($){
	jQuery("#allshop").data("flag","close");
});
function showAllShop(obj)
{
	if(jQuery("#allshop").data("flag")=="close"){
		var hang_num=7;
		jQuery("#allshop").animate({"height":hang_num*34},500);
		jQuery("#allshop").data("flag","open");
		$(obj).attr("src","template/<?=MOBAN?>/images/more1_2.jpg");
	}else{
		jQuery("#allshop").animate({"height":64},500);
		jQuery("#allshop").data("flag","close");
		$(obj).attr("src","template/<?=MOBAN?>/images/more1_1.jpg");
	}
}
function change_bg1(id){
	//alert(id);
	jQuery("#"+id).css({ background: "#e2eaff" });
}
function change_bg2(id){
	//alert(id);
	jQuery("#"+id).css({ background: "#ffffff" });
}
function open_city(id,evt){
    jQuery(".tuangouflsy_pf").show();
	jQuery("#select2").hide();
	var b = window.event?window.event:arguments.callee.caller.arguments[0]
    b.cancelBubble = true;
    changeCity("A");
 
}
function close_city(){
	jQuery(".tuangouflsy_pf").hide();
	jQuery("#select2").show();
	var b = window.event?window.event:arguments.callee.caller.arguments[0]
    b.cancelBubble = true;
}
function show_sx(id){
	jQuery("#"+id).show();
	var b = window.event?window.event:arguments.callee.caller.arguments[0]
	b.cancelBubble = true;
}
function hide_sx(id){
	jQuery("#"+id).hide();
	var b = window.event?window.event:arguments.callee.caller.arguments[0]
	b.cancelBubble = true;
}
 
document.onclick=function(){
	document.getElementById("div").style.display="none";
	}
function clickDiv(div){
   div.style.display="block";
   var b = window.event?window.event:arguments.callee.caller.arguments[0];
   b.cancelBubble = true;
}
function add_boder(obj){
	$(obj).addClass("border");
}
function move_border(obj){
	$(obj).removeClass("border");
}
function closeBanner(){
	$("#tgBanner").remove();
	$.cookie('tgbanshow', 0, {expires:120});
}
 
//add google-analytics start
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22337149-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//add google-analytics end
function doMemConf(){
	$.zxxbox.ajax("index.php?a=conftg&m=User",null,{width:601,height:535});
	//add google-analytics configdo menu start
	_gaq.push(['_setAccount', 'UA-22337149-3']);
	_gaq.push(['_trackPageview', '/virtual/follow/configdo']);
	//add google-analytics configdo menu end
}
function doGa(caseId){
	_gaq.push(['_setAccount', 'UA-22337149-3']);
	_gaq.push(['_trackPageview', '/virtual/follow/configgo'+caseId]);
}

function changeCity(id){
	$("div[id^=city_span_]").each(function(){
		$(this).css("display","none");
	});
	$("a[id^=city_a_]").each(function(){
		$(this).removeClass("sekuai");
	});
	$("#city_a_"+id).addClass("sekuai");
	$("#city_span_"+id).css("display","inline");
}
function countDown(maxtime, fn) {
    var timer = setInterval(function() {
        if (maxtime >= 0) {
		    d=parseInt(maxtime/3600/24);
            h=parseInt((maxtime/3600)%24);
            m=parseInt((maxtime/60)%60);
            s=parseInt(maxtime%60);
            msg = d + "天" + h + "小时" + m + "分" + s + "秒结束";
            fn(msg);
            --maxtime;
        } else {
            clearInterval(timer);
            fn("时间到，结束!");
        }
    },1000);
}
</script>
</head>
<body class="tuangouflsy_top" style="position:relative;" name="top" id="top">
<div class="float_right_feiie" id="fudong" style="display:none">
 <div class="float_right"><a href="#top" style="cursor:pointer; display:block;"><img src="template/<?=MOBAN?>/images/sanjiao1_03.jpg" style="margin-bottom:5px;"/>返回顶部</a></div>
</div>
<!-- header start -->
<?php
include("header.tpl.php");
?>
<?php
include("nav.tpl.php");
?>
<div style="height:12px; overflow:hidden"></div>
  <div class="tuangoufl_mingzhan">
	<div class="tuangoufl_mingzhan_biaotifd"><img src="template/<?=MOBAN?>/images/tuangoufl_jia_07.png"/></div>
	<div class="tuangoufl_mingzhan_content" id="allshop">
	  <ul>
		<li><span>&nbsp;</span></li>
        <?php foreach($malls as $row){?>
		<li><a <?php if($_GET['mallid']==$row['id']){?> style="font-weight:bold"<?php }?> href="<?=param('mallid',$row['id'])?>"><?=$row['name']?></a> | 返利<span class="textcolor1"><?=$row['fan']?></span></li>
        <?php }?>
	  </ul>
	  <div style="clear:both;"></div>
	</div>
	<div class="tuangoufl_mingzhan_more"><img src="template/<?=MOBAN?>/images/more1_1.jpg" onclick="showAllShop(this);" style="cursor:pointer;"/></div>
</div>
<!-- daohang start -->
<div class="tuangouflsy_daohang">
	<div class="tuangouflsy_daohang_left">
	  <ul>		
      <?php foreach($tuan_cat_arr as $k=>$v){?>
        <?php if($k==$tuan_cat_id){?>
		<li class="sekuai2"><span class="tuangouflsy_daohang_span1"><?=$v?></span></li>
        <?php }else{?>
		<li><a href="<?=param('catid',$k)?>"><?=$v?></a></li>
        <?php }?>
       <?php }?>
      </ul>
	</div>
	<div class="tuangouflsy_daohang_anniu"><!--<a href="http://<?=URL?>/tg.php" target="_blank"><img src="template/<?=MOBAN?>/images/tuangoufl_jia_11.jpg" /></a>--></div>
    <div class="tuangouflsy_daohang_sousuo">
      <span class="tuangouflsy_daohang_sousuo_span1">
		      </span>
    </div>	
	<div style="clear:both"></div>
</div>
<!-- daohang end -->
<!-- search condition start -->
<div class="tuangouflsy_daohang_paixu" style="clear:both" >
    <span class="tuangouflsy_daohang_paixu_span1"><?php if($keyword!=''){?>包含 “<span class="textcolor1"><?=$keyword?></span>” 的团购<?php }?>一共有 <strong><?=$total_num?></strong> 件团购商品</span>
    <span class="tuangouflsy_daohang_paixu_span2">
		<span class="tuangouflsy_daohang_paixu_span1" style="margin-right:5px;">排序:</span>
        <?php $j=2;?>
		<?php foreach($sort_arr as $k=>$v){$j++?>
        <?php if($k==$sort){?>
		<span class="tuangouflsy_daohang_paixu_span<?=$j?>" style="color:#ffffff; font-weight:bold"><?=$v?></span>
        <?php }else{?>
        <span class="tuangouflsy_daohang_paixu_span<?=$j?>"><a href="tg.php?city_id=<?=$city_id?>&catid=<?=$catid?>&keyword=<?=$keyword?>&sort=<?=$k?>&by=<?=$by?>"><?=$v?></a></span>
        <?php }?>
        <?php }?>
		    </span>
</div>
<!-- search condition end -->
<!-- header end -->
<!-- items start -->
<?php if($goods){?>
<?php foreach($goods as $k=>$v){?>
<div class="tuangouflsy_chanpin">
	  <div class="tuangouflsy_chanpin_top">
		<span class="tuangouflsy_chanpin_span1"><span class="tuangouflsy_chanpin_span3"><?=$cat_arr[$k]?></span>【<?=$cur_city?>】</span>
		<span class="tuangouflsy_chanpin_span2" style="font-size:14px">
			<a href="<?=param('catid',$k)?>"  name="img_1"><?=$cat_arr[$k]?> >></a>
		</span>
		<div style="clear:both;"></div>
	  </div>
      </div>
	  <div class="tuangouflsy_chanpin_content">
      <?php $n=0;$i=0;?>
      <?php foreach($v as $row){$n++;?>
		<dl onmouseover="javascript:add_boder(this)" onmouseout="javascript:move_border(this)" <?php if($n%3==0){?> class="wu"<?php }?>>
			  <dt>
				<p class="jiacu"><a href="mall<?=$url_head_id?><?=$row['mallid']?><?=$url_end?>">【<?=$row['name']?>】返利<?=$row['fan']?></a>
				<a href="tgview<?=$url_head_id?><?=$row['id']?><?=$url_end?>" style="color:#373737" target="_blank" title="<?=$row['title']?>"><?=$row['htitle']?></a>
				</p>
			  </dt>
			  <dd><a href="tgview<?=$url_head_id?><?=$row['id']?><?=$url_end?>" style="color:#373737" target="_blank">
				<img src="<?=$row['image']?>" onerror="this.onerror=function(){this.src='template/<?=MOBAN?>/images/default.jpg';}" width="283px" height="173px" alt="<?=$row['title']?>" />				</a>
			<?php if($row['endTime']-time()<0){?>
            <span class="tuangouflsy_chanpin_maiguanl"></span>
            <?php }elseif(time()-$row['startTime']<8400){?>
            <span class="tuangouflsy_chanpin_maiguanl2"></span>
            <?php }?>
            </dd>
			  <dt>
				<p><span class="chanpin_content_jiage"> <span class="chanpin_content_span1">￥</span> <span class="chanpin_content_span3"><?=subnum($row['price'])?></span></span>
                <span class="chanpin_content_fanli">最高返<span class="textcolor3"><?=$row['fan']?></span></span>
				  <span class="chanpin_content_diqu"><?=$row['bought']?>人已买</span>				</p>
				<div style="clear:both"></div>
				<p class="bj"> <span class="chanpin_content_span4">原价：<span class="chanpin_content_span6">￥<?=$row['value']?></span> <span class="textcolor4">(<?=$row['rebate']?>折)</span><br />
				  <span id="time<?=$row['id']?>">倒计时</span></span> <span class="chanpin_content_span5"><a href="tgview<?=$url_head_id?><?=$row['id']?><?=$url_end?>" target="_blank"><img src="template/<?=MOBAN?>/images/anniu_03.jpg" /></a></span> </p>
			  </dt>
              <script>
			  countDown(<?=$row['endTime']-time()?>,
      function(msg) {
        document.getElementById('time<?=$row['id']?>').innerHTML = msg;
      });
			  </script>
			  </dl>
            <?php }?>

	  <div style="clear:both"></div>
	</div>
	<div style="clear:both"></div>
    <?php if($pagesize<3){?>
    <div style="width:960px; margin:auto">
	<div class="tuangouflsy_chanpin_more"> 
		<span class="tuangouflsy_chanpin_more_span1">
		还有<span class="textcolor1">更多</span><?=$cat_arr[$k]?>类团购&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=param('catid',$k)?>" >点击更多&nbsp;<img src="template/<?=MOBAN?>/images/sanjia_03.jpg" id="img_more_1" /></a>
		</span>
	</div>
    </div>
    <?php }?>
    <?php }?>
    <?php }else{?>
    <div style="height:60px; padding-top:40px">
    对不起，没有您想要查询的团购项目
    </div>
    <?php }?>
    <div class="megas512">
	<?php 
	if($total>$pagesize){
		pageft($total,$pagesize,1,0,0,10,$page_tuan_list);echo $pagenav;
	}
	?>
     </div>
	<!-- items end -->
<!-- footer start -->
<div style="overflow:hidden; width:940px; margin:auto"><hr/></div>
<?php include('template/'.MOBAN.'/footer.tpl.php');?>
<!-- footer end -->
</body>
</html>
