<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="searchResult.aspx.cs" Inherits="Maticsoft.Web.searchResult" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="Css/page.css" rel="stylesheet" type="text/css" />

    <script src="js/Common.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
     function showNews(papername)
	{

	var strUrl="getReault.aspx?paperName="+escape(papername)+"&bdate="+escape(document.getElementById("HiddenField_bdate").value)+"&edate="+
	escape(document.getElementById("HiddenField_edate").value)+"&news="+escape(document.getElementById("HiddenField_news").value);	
	
		Ajaxs.GET(strUrl,showtypeexist);	
	}
	function showtypeexist(req)
	{
	
	var url=req.responseText;
	
		document.getElementById("news").innerHTML= url.split("||")[0];
		document.getElementById("HiddenField_pageSize").value=url.split("||")[1];
		document.getElementById("HiddenField_page").value="1";
		document.getElementById("TOTALCOUNTELE").innerHTML="约有" + url.split("||")[2] + "项符合 的查询结果";
		document.getElementById("pages").innerHTML=url.split("||")[3] ;
		}
		
		function pageList(num)
		{
		var pages = parseInt(document.getElementById("HiddenField_pageSize").value);
	var start = num - 5;
	var end = num +5;
	//对页码显示范围进行分析
	if(start < 1)
	{
		end = end - start + 1;
		if(end > pages)
			end = pages;
		start = 1;
	}
	if(end > pages)
	{
		start = start - (end - pages);
		if(start < 1)
			start = 1;
		end = pages;
	}
	var pagestr="";
	pagestr += "<a href='#' onclick='pageList(\"1\")'>首页</a>&nbsp;&nbsp;&nbsp;";
	if(num>1){
	pagestr += "<a href='#' onclick='pageList(\""+(parseInt(num)-1)+"\")'>上一页</a>&nbsp;&nbsp;&nbsp;";
	}
	for(var i=start;i<=end;i++)
	{
		if(i == num)
			pagestr += "<font color='red'>"+i+"</font>&nbsp;&nbsp;&nbsp;";
		else
			pagestr += "<a href='#' onclick='pageList(\""+i+"\")'>["+i+"]</a>&nbsp;&nbsp;&nbsp;";
	}
	if(num<parseInt(document.getElementById("HiddenField_pageSize").value)){
	pagestr += "<a href='#' onclick='pageList(\""+(parseInt(num)+1)+"\")'>下一页</a>&nbsp;&nbsp;&nbsp;";
	}
	
	pagestr += "<a href='#' onclick='pageList(\""+document.getElementById("HiddenField_pageSize").value+"\")'>尾页</a>&nbsp;&nbsp;&nbsp;";
	document.getElementById("pages").innerHTML=pagestr;
	
		if(document.getElementById("page"+num)!=null){
		document.getElementById("page"+num).style.display="";
		}
		if(document.getElementById("HiddenField_page")!=null)
		{
		document.getElementById("page"+document.getElementById("HiddenField_page").value).style.display="none";
		}
		document.getElementById("HiddenField_page").value=num;
		if(num==1)
		{
		    document.getElementById("page1").style.display="";
		}
		if(num==document.getElementById("HiddenField_pageSize").value)
		{
		document.getElementById("page"+num).style.display="";
		}
		
		}
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="margin-top: 15px" cellspacing="0" cellpadding="0" width="980" border="0">
            <tbody>
                <tr>
                    <td id="CLASSELE" style="text-align: left" valign="top" width="200">
                        <div class="tt10">
                            搜索结果</div>
                        <div runat="server" id="paperName">
                        </div>
                    </td>
                    <td class="tt11" width="20">
                        &nbsp;
                    </td>
                    <td class="tt12" valign="top" width="810">
                        <div class="tt10">
                            <table cellspacing="0" cellpadding="0" width="94%" border="0">
                                <tbody>
                                    <tr>
                                        <td id="TOTALCOUNTELE" style="text-align: right" align="right" runat="server">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div>
                            <table cellspacing="0" cellpadding="0" border="0">
                                <tbody>
                                    <tr>
                                        <td class="tt13" id="TONGYINELE">
                                            <div id="news" runat="server" >
                                            </div>
                                            <div id="pages" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div id="DETAILELE">
                        </div>
                        <div>
                            <table cellspacing="0" cellpadding="0" border="0">
                                <tbody>
                                    <tr>
                                        <td class="tt13" id="TONGYIELE">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="tt10b">
                            <table cellspacing="0" cellpadding="0" width="94%" border="0">
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                        <form name="searchFormTwo" onsubmit="twoSearchOne('0');return false;" action="" method="post">
                        </A>
                        </form>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <asp:HiddenField ID="HiddenField_bdate" runat="server" />
    <asp:HiddenField ID="HiddenField_edate" runat="server" />
    <asp:HiddenField ID="HiddenField_news" runat="server" />
    <asp:HiddenField ID="HiddenField_page" runat="server" />
    <asp:HiddenField ID="HiddenField_pageSize" runat="server" />
    </form>
</body>
</html>
