<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>

<%@ page import = "cn.com.dekn.cms.util.*" %>

<%

//网站群节点ID
String NODE_ID = StrUtil.getNotNullStringValue(request.getParameter("NODE_ID"),"root");

//网站群节点参数
String CLUSTER_URL_PARAM = "";
if(null != request.getParameter("cluster_node_id")){
	CLUSTER_URL_PARAM = "cluster_node_id=" + request.getParameter("cluster_node_id");
}



/***********************************
* 显示特性参数初始化
***********************************/
//搜索结果显示页
String SEARCH_RESULT_PAGE = StrUtil.getNotNullStringValue(request.getParameter("SEARCH_RESULT_PAGE"),"SearchResult.jsp");


//查询提示标题
String TEXT_TITLE = StrUtil.getNotNullStringValue(request.getParameter("TEXT_TITLE"),"搜索结果");

//搜索关键字
String KEY_WORD = StrUtil.getNotNullStringValue(request.getParameter("KEY_WORD"),"");

//索引库ID
String DB_ID = StrUtil.getNotNullStringValue(request.getParameter("DB_ID"),"sys_article");

//分页大小
int PAGE_SIZE = StrUtil.getNotNullIntValue(request.getParameter("PAGE_SIZE"),10);





/***********************************
* CSS样式 参数初始化
***********************************/
//CSS样式
String CSS = StrUtil.getNotNullStringValue(request.getParameter("CSS"),"");

%>
	
	
<style type="text/css">
.STYLE2 {
	font-size: 14px;
	color: #0000FF;
}
.STYLE7 {color: #FF0000}
.STYLE8 {font-size: 14px; font-weight: bold; }
.STYLE9 {font-size: 14pt}
.STYLE11 {font-size: 14px; color: #0066CC; }
</style>
	
	
<script>
//页面初始化
function pageInit(){
	selectInit("DB_ID","${param.db_id}");
	selectInit("DB_ID2","${param.db_id}");
}


function beginSearch(type){

	if(type == 1){
		location.href='?key_word=' + document.cms4jForm.KEY_WORD.value + '&db_id=' + document.cms4jForm.DB_ID.value;
	}else if(type == 2){
		location.href='?key_word=' + document.cms4jForm.KEY_WORD2.value + '&db_id=' + document.cms4jForm.DB_ID2.value;
	}

}
</script>	
	
	<cms4j:site_search key_word="<%=KEY_WORD%>" db_id="<%=DB_ID%>" node_id="<%=NODE_ID%>" page_size="<%=PAGE_SIZE%>">
      <form action="#" method="post" name="cms4jForm" id="cms4jForm">
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><table width="100%"  border="0" cellpadding="4" cellspacing="0" bgcolor="#efefef">
                <tr>
                  <td width="30%" height="30"><p class="STYLE8"><%=TEXT_TITLE%></p></td>
                  <td width="70%" height="30" align="right" class="STYLE8">共搜索到 <span class="STYLE7">${search_result_count}</span> 个结果　　用时 <span class="STYLE7">${search_time}</span> 秒 </td>
                </tr>
                <tr height="4">
                  <td height="4" colspan="2"></td>
                </tr>
              </table>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="table_border_bg">
                  <tr class="table_border_cell_bg">
                    <td width="15%" height="32" class="STYLE8">关键字:</td>
                    <td width="28%" class="STYLE8"><input name="KEY_WORD" type="text" id="KEY_WORD" onKeyPress="if(event.keyCode == 13){beginSearch(1)}" value="<%=request.getParameter("key_word")%>"></td>
                    <td width="22%" align="right" class="STYLE8">&nbsp;</td>
                    <td width="23%" class="STYLE8"><input name="DB_ID" type="hidden" id="DB_ID" value="sys_article" /></td>
                    <td width="12%" align="right" class="STYLE8"><span class="table_oper_tr STYLE9">
                      <input name="Submit2" type="button" class="form_button" value="重新搜索" onClick="beginSearch(1)">
                    </span></td>
                  </tr>
                </table>
              <hr>
			  
                <cms4j:site_search_result>
                  <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
                    <tr>
                      <td align="left" ><span class="font_big STYLE2"><strong><a href="ShowArticle.jsp?id=<%=site_search_result_vo.getId()%>" target="_blank"><font color="#0000FF"><%=site_search_result_vo.getTitle()%></font></a> </strong></span><span class="STYLE11"><%=site_search_result_vo.getIndexTime()%></span></span><br>
                          <span class="page_class_content"><%=site_search_result_vo.getContent()%></td>
                    </tr>
                    <tr>
                      <td height="10" ></td>
                    </tr>
                  </table>
                </cms4j:site_search_result>
				
                <hr>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="table_border_bg">
                  <tr >
                    <td height="22" align="center" class="page_nav">
					
					<!--BEGIN: 翻页(条件控制)-->
                        <jsp:include page="../../symbol/page/page_2.jsp">
							<jsp:param name="COLOR_CURR_PAGE" value="#ffffff"></jsp:param>
							<jsp:param name="COLOR_OTHER_PAGE" value="#ffffff"></jsp:param>
							<jsp:param name="COLOR_NEXT_PREV_PAGE" value="#ffffff"></jsp:param>
						</jsp:include>  
                    <!--END: 翻页-->
						
                    </td>
                  </tr>
                  <tr class="table_border_cell_bg">
                    <td height="6" class="list_left_title"></td>
                  </tr>
                </table>
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="table_border_bg">
                  <tr class="table_border_cell_bg">
                    <td width="15%" height="22" class="STYLE8">关键字:</td>
                    <td width="28%" class="STYLE8"><input name="KEY_WORD2" type="text" id="KEY_WORD2" value="<%=request.getParameter("key_word")%>" onKeyPress="if(event.keyCode == 13){beginSearch(2)}"></td>
                    <td width="22%" align="right" class="STYLE8">&nbsp;</td>
                    <td width="23%" class="STYLE8"><input name="DB_ID2" type="hidden" id="DB_ID2" value="sys_article" /></td>
                    <td width="12%" align="right"><span class="table_oper_tr">
                      <input name="Submit22" type="button" class="form_button" value="重新搜索" onClick="beginSearch(2)">
                    </span></td>
                  </tr>
              </table></td>
          </tr>
        </table>
      </form>
    </cms4j:site_search>
