<%@ Control Language="C#" %>
<%@ Import Namespace="Hishop.SystemServices" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Components" Assembly="Hishop.Web.Components" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Tags" Assembly="Hishop.Web.Tags" %>

    <!--ËÑË÷À¸½áÊø-->
                <table width="960" border="0" align="center" cellpadding="0" cellspacing="0" class="marginCenter">
                  <tr>
                    <td width="70" class="pad2"><Hishop:ThemesImage ID="ThemesImage1" src="images/search.gif" runat="server"></td>
                    <td width="90" align="left" id="tdClass"><Hishop:Private_Search_Class ID="Search_Class" runat="server" /></td>
                    <td width="300" class="index_search"><Hishop:Private_Search_Keywords ID="Search_Keywords" CssClass="input1" runat="server" /></td>
                    <td width="70"><input type="button" onclick="search()" class="search-btn" /><input id="url" type="hidden" value="<%= Globals.GetSiteUrls().UrlData.FormatUrl("SearchResult")%>" /></td>
                    <td><Hishop:SiteUrl UrlName="ProductSearch" runat="server"><Hishop:ThemesImage ID="ThemesImage2" src="images/btn_sea02.gif" runat="server"></Hishop:SiteUrl></td>
                  </tr>
                </table>
  
  <script type="text/javascript">
      function search() {
          var item = $("#drop_Private_Search_Class").val();
          var key = $("#txt_Private_Search_Keywords").val();
          if (key == undefined)
              key = "";
                        
          
          var url = $("#url").val() + "?keywords=" + key + "&categoryId=" + item;
          window.location.href = encodeURI(url);  
      }

      $(document).ready(function() {
          $('#txt_Private_Search_Keywords').keydown(function(e) {
              if (e.keyCode == 13) {
                  search();
              }
          })

//          var urlLocationStr = document.location.href;
//          var Keyword = /keywords=/;
//          Keyword.exec(urlLocationStr);
//          var keywordString = RegExp.rightContext;

//          keywordString = keywordString.substr(0, keywordString.indexOf("&"));
//          $('#txt_Private_Search_Keywords').val(decodeURI(keywordString));
      });
  </script>

