<!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>
<script type="text/javascript" src="http://cbjs.baidu.com/js/m.js"></script>
<meta name="Generator" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{if $page_title}{$page_title} - {/if}{if $show_city_title} {$shop_info.SHOP_TITLE}{if $city_title} - {$city_title}{$LANG.SITE}{/if}{/if} - {function name='app_conf' value='SHOP_SEO_TITLE'}</title>
<meta name="keywords" content="{if $page_keyword}{$page_keyword}{/if}{$shop_info.SHOP_KEYWORD}" />
<meta property="wb:webmaster" content="86ab420fdc0214fa" />
<meta name="description" content="{if $page_description}{$page_description}{/if}{$shop_info.SHOP_DESCRIPTION}" />
<?php
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/style.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/weebox.css";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.bgiframe.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.weebox.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.pngfix.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/lazyload.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/op.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/op.js";
if(app_conf("APP_MSG_SENDER_OPEN")==1)
{
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/msg_sender.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/msg_sender.js";
}
if($this->_var['APP_INDEX']=='tuan')
{
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/tuan.css";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/tuan.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/tuan.js";
}
else
{
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/main.css";
}
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$pagecss"}" />

<script type="text/javascript">
var APP_ROOT = '{$APP_ROOT}';
var CART_URL = '{url x="shop" r="cart"}';
var CART_CHECK_URL = '{url x="shop" r="cart#check"}';
var LOADER_IMG = '{$TMPL}/images/lazy_loading.gif';
var ERROR_IMG = '{$TMPL}/images/image_err.gif';
{if app_conf("APP_MSG_SENDER_OPEN") eq 1}
var send_span = {function name="app_conf" v="SEND_SPAN"}000;
{/if}
</script>
<script type="text/javascript" src="{$APP_ROOT}/public/runtime/app/lang.js"></script>
<script type="text/javascript" src="{function name="parse_script" v="$pagejs" c="$cpagejs"}"></script>

</head>

<body>
{if $vote}
<a id="vote" href="{url x="shop" r="vote"}" target="_blank"></a>
{/if}
<div id="dropdown">	
	<a href="javascript:void(0);" ctl="fcate" act="index" action="{$APP_ROOT}/youhui.php" id="search_fcate">{$LANG.SEARCH_TYPE_YOUHUI}</a>
	<a href="javascript:void(0);" ctl="ycate" act="index" action="{$APP_ROOT}/youhui.php" id="search_ycate">搜代金</a>
	<a href="javascript:void(0);" ctl="tuan" act="index" action="{$APP_ROOT}/youhui.php" id="search_tuan">搜团购</a>
	<a href="javascript:void(0);" ctl="store" act="index" action="{$APP_ROOT}/youhui.php" id="search_store">搜商家</a>
	<a href="javascript:void(0);" ctl="event" act="index" action="{$APP_ROOT}/youhui.php" id="search_event">搜活动</a>
	<a href="javascript:void(0);" ctl="ss" act="pick" action="{$APP_ROOT}/shop.php" id="search_ss" >{$LANG.SEARCH_TYPE_GOODS}</a>
	<a href="javascript:void(0);" ctl="topic" act="search" action="{$APP_ROOT}/shop.php" id="search_topic">{$LANG.SEARCH_TYPE_TOPIC}</a>
</div>	
	<div class="header">
		<div class="top_nav">
			<div class="wrap">
				<div class="f_l">
				{$LANG.WELCOME}{function name="app_conf" value="SHOP_TITLE"}&nbsp;				
				</div>
				<div class="f_r">
					<span id="user_head_tip">
					{insert name="load_user_tip"}
					</span>
					<a href="javascript:void(0)" onclick="submit_sms();">{$LANG.SMS_SUBSCRIBE}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					<a href="javascript:void(0)" onclick="unsubmit_sms();">{$LANG.SMS_UNSUBSCRIBE}</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					{if app_conf("MAIL_ON") eq 1}
					<a href="{url x="tuan" r="subscribe#mail"}">邮件订阅</a>&nbsp;&nbsp;|&nbsp;&nbsp;					
					{/if}
					<span class="cart_ico"><a href="{url x="shop" r="cart"}">{$LANG.SHOP_CART} <span class="cart_count" id="cart_count">{insert name='load_cart_count'}</span> 件</a></span>
				</div>
			</div>
		</div><!--end top_nav-->
		<div class="blank1"></div>
		<div class="wrap logo_row">
			<div class="logo f_l">
			<a class="link" href="{$APP_ROOT}/">
				<?php
					$this->_var['logo_image'] = app_conf("SHOP_LOGO");
				?>
				{function name="load_page_png" v=$logo_image}
			</a>
			</div>
			<div class="f_l" style="padding-top:20px; margin-left:10px;">
				{if count($deal_city_list) gt 1}         			 
					 <a href="{url x="shop" r="city"}" class="switch_city">{$deal_city.name}</a>
					 <br />
					<div style="color:#999;"> 我要切换城市</div>
 				{/if}
			</div>
			<script type="text/javascript">
				$(document).ready(function(){
					{if $MODULE_NAME eq 'mall' or $MODULE_NAME eq 'cate' or $MODULE_NAME eq 'goods'}
					$("#search_ss").click();
					{elseif $MODULE_NAME eq 'topic' or $MODULE_NAME eq 'discover' or $MODULE_NAME eq 'group' or $MODULE_NAME eq 'daren'}
					$("#search_topic").click();
					{elseif $APP_INDEX eq 'tuan'}
					$("#search_tuan").click();
					{elseif $MODULE_NAME eq 'index' and $ACTION_NAME eq 'daijin_index'}
					$("#search_ycate").click();
					{else}
					$("#search_{$MODULE_NAME}").click();
					{/if}
					
				});
			</script>
						
			<form id="header_search_box" action="{$APP_ROOT}/youhui.php" method="post">
				<div class="search_box f_r">					
					<div class="search_input f_l">						
					<span class="search_type_select" id="select_search_type">
						{$LANG.SEARCH_TYPE_YOUHUI}
					</span>									
					<input type="text" class="search_txt" name="keyword" id="header_kw" value="" />
					<input type="button" class="search_btn" id="search_btn" value="" />
					</div>
					<div class="blank1"></div>
					<div class="keyword_box f_l">
					{foreach from=$hot_kw item=kw_item}
					<a href="{url x="shop" r="discover" p="tag=$kw_item"}">{$kw_item}</a>
					{/foreach}
					</div>
				</div>		
				<input type="hidden" name="act" id="search_act" value="index" />
				<input type="hidden" name="ctl" id="search_ctl" value="fcate" />				
				<input type="hidden" name="is_redirect" value="1" />
			</form>					
		</div><!--end wrap-->
		<div class="main_bar">
			<div class="wrap">				
				<ul class="main_nav">
					{foreach from=$nav_list item=nav_item}
						<li {if $nav_item.current eq 1}class="current"{/if}>
							<span class="nav_left" ></span>
								<a href="{$nav_item.url}"  target="{if $nav_item.blank eq 1}_blank{/if}">{$nav_item.name}</a>
							<span class="nav_right" ></span>
						</li>
					{/foreach}
				</ul>	
				<span class="merchant_join">
				<a href="{url x="biz" r="join"}" title="我是商家，我要入驻" target="_blank">我是商家，我要入驻</a>	
				</span>	
			</div>
		</div><!--end main_nav-->
	</div>
	
	
	{if $is_index eq 1 and $APP_INDEX eq 'tuan'}
	<script type="text/javascript">
		function set_sort(type)
		{
			var ajaxurl = APP_ROOT+"/tuan.php?ctl=ajax&act=set_sort_idx&type="+type;
			$.ajax({ 
				url: ajaxurl,
				success: function(text){
					location.reload();
				},
				error:function(ajaxobj)
				{
//					if(ajaxobj.responseText!='')
//					alert(ajaxobj.responseText);
				}
			});
		}
	</script>
	<div class="blank"></div>
	<div class="filter_contain cf">
		<div class="cate_row cf">
			<b class="fl">{$LANG.CATE_DEAL}：&nbsp;</b>
			<span class="row fl">
			{foreach from=$bcate_list item=bcate}
			<a href="{$bcate.url}" title="{$bcate.name}" {if $bcate.current eq 1}class="current"{/if}>{$bcate.name}({$bcate.count})</a>			
			{/foreach}
			</span>
		</div>
		<div class="blank1"></div>
		{if $scate_list}		
		<div class="sub_cate_row">
			{foreach from=$scate_list item=scate}		
			<a href="{$scate.url}" title="{$scate.name}" {if $scate.current eq 1}class="current"{/if}>{$scate.name}({$scate.count})</a>
			{/foreach}
		</div>
		{/if}
		
		{if count($bquan_list) gt 1}
		<div class="quan_row cf">
			<b class="fl">{$LANG.AREA_LIST}：&nbsp;</b>
			<span class="row fl">
				{foreach from=$bquan_list item=bquan}
				<a href="{$bquan.url}" title="{$bquan.name}" {if $bquan.current eq 1}class="current"{/if}>{$bquan.name}({$bquan.count})</a>
				{/foreach}
			</span>
		</div>
		{/if}
		<div class="blank1"></div>
		{if $squan_list}		
		<div class="sub_cate_row">
			{foreach from=$squan_list item=squan}		
			<a href="{$squan.url}" title="{$squan.name}" {if $squan.current eq 1}class="current"{/if}>{$squan.name}({$squan.count})</a>
			{/foreach}
		</div>
		{/if}
		{if !$hide_sort}
		<div class="sort_row">
			<b>{$LANG.SORT_TYPE}：</b>
			<a href="javascript:void(0);" onclick="set_sort('begin_time');" class="asc_gray {if $sort_field eq 'begin_time'}current idx_{$sort_type}{/if}">{$LANG.SORT_BEGIN_TIME}</a>
			<a href="javascript:void(0);" onclick="set_sort('current_price');" class="desc_gray {if $sort_field eq 'current_price'}current idx_{$sort_type}{/if}">{$LANG.SORT_CURRENT_PRICE}</a>
			<a href="javascript:void(0);" onclick="set_sort('buy_count');" class="asc_gray {if $sort_field eq 'buy_count'}current idx_{$sort_type}{/if}">{$LANG.SORT_BUY_COUNT}</a>
			<a href="javascript:void(0);" onclick="set_sort('sort');" class="desc_gray {if $sort_field eq 'sort'}current idx_{$sort_type}{/if}">{$LANG.SORT_SORT}</a>
		</div>
		{/if}
	</div>
	{/if}
	
<div class="wrap">
	{if $site_nav}
	<div class="blank"></div>
	<div class="site_nav">
		{foreach from=$site_nav item=nav key=key}
		{if $key gt 0} - {/if}<a href="{$nav.url}" title="{$nav.name}">{function name="msubstr" v=$nav.name}</a>
		{/foreach}
	</div>	
	{/if}
