<%@ Control Language="c#" AutoEventWireup="true" Codebehind="Search.ascx.cs" Inherits="XpShop.WebUI.Modules.Search" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>

<div id="search">
    <div class="searching clear">
        <form method="get" id="searchform" action="/<%=ShopFolder %>search.aspx" style="margin:0px">
            <span class="clear">
                <input type="text" id="keyword1" name="keyword" class="search_input" value="<%=GetAD(96)%>" />
                <input type="submit" id="btnsearch" class="search_buttom" value="" />
            </span>
        </form>
        <div class="advsearch">
            <a href="<%=webSite %>search.aspx">高级搜索</a><br />
            <a href="<%=webSite %>HelpList.aspx">使用帮助</a>
        </div>
    </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>
<script type="text/javascript">
var keyword = '<%=Server.UrlDecode(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.aspx?keyword=" + escape(n) + "'>" + 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=" +escape($("#keyword1").val());
	});
	$('#btnAdvSearch').click(function(){window.location.href="<%=webSite %>search.html";});
	
});
</script>