<%@ Control Language="c#" AutoEventWireup="true" Codebehind="Search.ascx.cs" Inherits="XpShop.WebUI.Modules.Search" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%@ Register TagPrefix="uc1" TagName="HomeTop_LeftNavTop2Level" Src="HomeTop_LeftNavTop2Level.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="SmallCart.ascx" %>
<div id="search">
    <div class="xp-w clear">
        <uc1:HomeTop_LeftNavTop2Level id="HomeTop_LeftNavTop2Level" runat="server"></uc1:HomeTop_LeftNavTop2Level>
        <div class="searching">
            <form method="get" id="searchform" action="/<%=ShopFolder %>search.<%=config.html%>" style="margin:0px">
            <input type="text" id="keyword1" name="keyword" class="search_input" value="<%=GetAD(96)%>" />
            <input type="submit" id="btnsearch" class="search_buttom" value="<%=GetResourceString("Search")%>" />
            </form>
            <%--<input type="button" id="btnAdvSearch" class="search_buttom" value="<%=GetResourceString("Search_Advance")%>" />--%>
        </div>
        <div class="search_hot"><span style="font-weight:bold;">热门搜索:</span><div id="searchkey" style="display:none;"><%=GetAD(72)%></div><%-- <a href="<%=webSite %>auction/products-0-1-2-0-1.html">拍卖</a> | <a href="<%=webSite %>tg/products-0-1-2-0-1.html">团购</a> | <a href="<%=webSite %>gifts.aspx">积分兑换礼品</a>--%></div>        
	    <div class="search_cart">
	        <div class="l"></div>
	        <div class="m"><a href="<%=webSite %>cart.<%=config.html%>" style="text-decoration:none;">购物车<span name="sQuantity" id="sQuantity" style="color:#2173fb; padding:0px 2px;">0</span>件 </a></div>
	        <div class="r"><a href="<%=webSite %>cart.<%=config.html%>"></a></div>
	    </div>
	</div>
</div>
<script type="text/javascript">
var keyword = '<%=Request.QueryString["keyword"]%>';
$(document).ready(function() {
	if(keyword != '')
	{
		$("#keyword1").val(keyword);
	}
	var sk = $('#searchkey').text().split('|');
	var skLinks = "";
	$.each(sk,function(i,n){
	    skLinks += "<a href='<%=webSite %>search-" + escape(n) + ".<%=config.html %>'>" + n + "</a>  ";
	});
	$('#searchkey').replaceWith(skLinks);
	
	$("#keyword1").focus(function(){
		if($("#keyword1").val()=="<%=GetAD(96)%>"){
		    $("#keyword1").val('');
		}
	});
	$("#keyword1").blur(function(){
		if($("#keyword1").attr("value")=="")
		{
			$("#keyword1").val("<%=GetAD(96)%>");
		}
	});
	$('#keyword1').keydown(function(event){
        if(event.keyCode == 13){
            $('#btnsearch').click();
        };
    });
	$("#btnsearch").click(function(){
		//window.location="<%=webSite %>search.aspx?keyword=" +$("#keyword1").val();
	});
	$('#btnAdvSearch').click(function(){window.location.href="<%=webSite %>search.<%=config.html%>";});
	
});
</script>