<div class="oem_top">
  <div class="oem_topcon">
    <div class="oe_top_left">
	  
	  <!--{if $login.status == '0'}-->
	  <div class="oe_not_login">
	    <span>欢迎访问<!--{$config.sitename}--></span>&nbsp;&nbsp;
	    <a href="<!--{routeurl module='passport' action='reguser'}-->">免费注册</a>&nbsp;&nbsp;
	    <a href="<!--{routeurl module='passport' action='loginuser'}-->">会员登录</a>
	    
	  </div>
	  <!--{else}-->
      <div class="oe_top_user">
	    欢迎：[<!--{$login.user.username}-->]
      </div>
	  <!--//oe_top_user End-->
      <div class="oe_top_out"><a href="<!--{routeurl module='passport' action='logout'}-->">退出登录</a></div>
      <div class="oe_top_sysnum" style="display:none;"><a href="javascript:;">消息</a><i>0</i></div>
    
      <div class="oe_top_ucenter">
        <a href="javascript:;" id="btn_tips_usercenter">会员中心</a>
        <i class="oem_jiao"></i>
		<div class="oe_ucentercart hidden" id="tips_usercenter">
		  <!--{if $config.oeinterface.flag == "1" && $login.user.shopid == "0"}-->
		  <!--{if empty($login.user.oeopenid)}-->
		  <a href="<!--{$urlpath}-->index.php?m=user&c=profile&a=bind" style="color:#ff6600;">绑定帐号</a>
		  <!--{/if}-->
		  <!--{/if}-->
          <a href="<!--{$urlpath}-->index.php?m=user">会员中心</a>
          <a href="<!--{$urlpath}-->index.php?m=user&c=profile&a=edit">我的设置</a>
		  <a href="<!--{$urlpath}-->index.php?m=user&c=shopcomment">我的点评</a> 
		  <a href="<!--{$urlpath}-->index.php?m=user&c=shopbespoke">我的预约</a> 
		  <a href="<!--{$urlpath}-->index.php?m=user&c=coupon">优惠券</a> 
		</div>
		<script type="text/javascript">
		$(function(){
			$("#btn_tips_usercenter").bind("click", function(){
				$tips_usercenter_obj = $("#tips_usercenter");
				if ($tips_usercenter_obj.css("display") == "none") {
					$tips_usercenter_obj.show();
				}
				else {
					$tips_usercenter_obj.hide();
				}
			});
		});
		</script>
      </div>
	  <!--//oe_top_ucenter End-->
	  <div class="clear"></div>
	  <!--{/if}-->


    </div>
	<!--//oe_top_left End-->

    
	<div class="oe_top_right">

      <div class="oe_top_sc">
	    <span><a href="<!--{$urlpath}-->index.php?m=user&c=collectshop">我的收藏</a></span>
      </div>
	  
	  <!--{if $login.status == '1'}-->
	  <!--{if $login.shop.shopid > 0}-->
      <div class="oe_mallcenter">
	    <a href="javascript:;" id="btn_tips_shopcenter">我是商家</a>
		<i class="oem_jiao"></i>
		<div class="oe_ucenterlist hidden" id="tips_shopcenter">
		  <a href="<!--{$urlpath}-->index.php?m=shop">商家中心</a> 
		  <a href="<!--{$urlpath}-->index.php?m=shop&c=rz">店铺认证</a> 
		  <a href="<!--{$urlpath}-->index.php?m=shop&c=diy">店铺装修</a> 
		  <a href="<!--{$urlpath}-->index.php?m=shop&c=shopbespoke">店铺预约</a> 
		  <a href="<!--{$urlpath}-->index.php?m=shop&c=vip">店铺升级</a>
		  <a href="<!--{$urlpath}-->index.php?m=shop&c=recharge">在线充值</a>
		</div>
      </div>
	  <!--//oe_mallcenter End-->
	  <!--{/if}-->
	  <!--{else}-->
      <div class="oe_mallcenter">
	    <a href="javascript:;" id="btn_tips_shopcenter">我是商家</a>
		<i class="oem_jiao"></i>
		<div class="oe_ucenterlist hidden" id="tips_shopcenter">
		  <a href="<!--{routeurl module='passport' action='regmerchant'}-->">我要入驻</a> 
		  <a href="<!--{routeurl module='passport' action='loginmerchant'}-->">商家登录</a>
		</div>
      </div>
	  <!--//oe_mallcenter End-->
	  <!--{/if}-->
	  <script type="text/javascript">
		$(function(){
			$("#btn_tips_shopcenter").bind("click", function(){
				$tips_shopcenter_obj = $("#tips_shopcenter");
				if ($tips_shopcenter_obj.css("display") == "none") {
					$tips_shopcenter_obj.show();
				}
				else {
					$tips_shopcenter_obj.hide();
				}
			});
		});
	  </script>
    
    </div>
	<!--//oe_top_right End-->
    <div class="clear"></div>
  </div>
</div>
<!--//oem_top End-->


<div class="oem_wlogo">
  <div class="oem_logo">
    <div class="oem_logo_con">
	  <a href="<!--{$urlpath}-->" title="<!--{$config.sitename}-->"><img src="<!--{$urlpath}--><!--{$config.logo}-->" /></a>
	</div>
    <div class="oem_area">
        <span>
        <!--{if !empty($city.cityname)}-->
        <!--{$city.cityname}-->
        <!--{else}-->
        全国
        <!--{/if}-->
        </span>
        <a href="<!--{routeurl module='city'}-->">切换城市</a>
	</div>

	<form id="ser_form" method="post" action="">
    <div class="oem_search">
      <input type="text" id="searchkey" class="oem_topsearch" value="搜，你感兴趣的信息…" /><input class="oe_select" value="选择" type="text" id="btn_sertype" /><input type="button" class="oem_topsearch_button" value="" id="btn_gosearch" />
	  <input type="hidden" name="searchtype" id="searchtype" value="" /><span id="ser_keyword"></span>
      <div class="oe_selects" id="tips_searchtype" style="display:none;">
        <a href="javascript:;" f="seartype" data-value="shop" data-text="商家">商家</a>
        <a href="javascript:;" f="seartype" data-value="activity" data-text="活动">活动</a>
		<a href="javascript:;" f="seartype" data-value="goods" data-text="商品">商品</a>
		<a href="javascript:;" f="seartype" data-value="coupon" data-text="优惠券">优惠券</a>
      </div>
    </div>
	</form>

    <div class="clear"></div>
  </div>
</div>
<!--//oem_wlogo End-->
<script type="text/javascript">
$(function(){

	$("#btn_sertype").bind("click", function(){ //搜索类型
		$tips_searchtype_obj = $("#tips_searchtype");
		if ($tips_searchtype_obj.css("display") == "none") {
			$tips_searchtype_obj.show();
		}
		else {
			$tips_searchtype_obj.hide();
		}
	});

	$("a[f='seartype']").bind("click", function(){ //选择类型
		$sertype = $(this).attr("data-value");
		$("#searchtype").val($sertype);
		$("#btn_sertype").val($(this).attr("data-text"));
		$("#tips_searchtype").hide();
	});


	$("#searchkey").bind("click", function(){
		if ($(this).val() == "搜，你感兴趣的信息…") {
			$(this).val("");
		}
	});

	$("#searchkey").bind("blur", function(){
		if ($(this).val() == "") {
			$(this).val("搜，你感兴趣的信息…");
		}
	});

	$("#btn_gosearch").bind("click", function(){ //提交搜索
		
		$s_serkey = $("#searchkey").val();
		$searchtype = $("#searchtype").val();
		if ($s_serkey != "" && $searchtype != "") {
			if ($s_serkey != "搜，你感兴趣的信息…") {
				$ser_url = "";
				if ($searchtype == "shop") {
					$ser_url = "<!--{routeurl module='shop' action='list'}-->";
				}
				else if ($searchtype == "activity") {
					$ser_url = "<!--{routeurl module='activity' action='list'}-->";
				}
				else if ($searchtype == "goods") {
					$ser_url = "<!--{routeurl module='goods' action='list'}-->";
				}
				else if ($searchtype == "coupon") {
					$ser_url = "<!--{routeurl module='coupon' action='list'}-->";
				}
				if ($ser_url != "") {
					$("#ser_form").attr("action", $ser_url);
					$("#ser_keyword").html("<input type='hidden' name='s_serkey' value='"+$s_serkey+"' />");
					$("#ser_form").submit();
				}
			}
		}
	});

});
</script>