<%@ Control Language="C#" ClassName="Search" %>

<script runat="server">

</script>
<div class="top_s">
<div class="right">          <form method="get" name="fileKeyForm" id="fileKeyForm" action="download.aspx" target="_blank" id="form1"
                        style="margin: 0px">文件提取: <input name="Key"  type="text" class="input" size="20">
                        <input type="submit" class="input" value="提取"  onClick="return chkFileKey();"/>
                        </form>
</div><form action="blog_Search.aspx" id="blog_Search" name="blog_Search" method="get" style="margin: 0px" target="_blank">
  <select name="Type" id="Type" onChange="SetAction(this.value);" class="input">
                            <option value=1 selected>标题</option>
                            <option value=2>作者</option>
                            <option value=3>内容</option>
                            <option value=4>标签</option>
                        </select><input name="keyWord" id="key" type="text" class="input" size="20"><input name="TagName" id="TagName" type=hidden />
<input type="image" src="img/searchbut.gif" style="margin-top:2px" 
 onclick="return chkSearch();" /></form>
<script>
                               function chkSearch()
                               {
 var key=document.getElementById('keyWord');
 if(key.value.trim()=='')
 {
  alert('请输入搜索内容！');
  return false;
 }
 var type=document.getElementById('Type');
 SetAction(type.value);
  
    document.getElementById('TagName').value=key.value;
  
   return true;
}
                               function chkFileKey()
                               {
                               var v=document.getElementById('key');  //getElementById('Key');
                            
                               if(v.value==''||v.value.length<8)
                               {
 
                               alert('提取码格式不正确：S　','');
 
                                return false;
                                }
                                return true;
                              //  document.getElementById('form1').submit();
                               }
                               function SetAction(v)
                               {
                               if(v=="4")
                               {
                                $('blog_Search').action='TagTopList.aspx';
                               }else
                                $('blog_Search').action='blog_Search.aspx';
                               
                               
                               
                               }
                               function $(s){return document.getElementById(s);}
                               function SetValue()
                               {
                              $('TagName').value= $('key').value;
                               }
            </script>
</div>