<%@ Page language="c#" Codebehind="NewsCat.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.NewsCat" %>
<%@ Register TagPrefix="uc1" TagName="NewsCatNav" Src="Modules/NewsCatNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<HEAD>		
		<!--#include file="../../inc/encoding.inc"-->
		<title><%=GetResourceString("News")%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<style>
		#navbar ul li.newsindex{background:url("Template/XpShop_div2/images/navbar_on.jpg") no-repeat;}
		</style>
	</HEAD>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear">
		    <!--位置导航开始-->
		    <div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("news")%></div>
		    <!--位置导航结束-->
			<div id="content_left">
				<!--新闻分类开始-->
					<uc1:NewsCatNav id="NewsCatNav1" runat="server"></uc1:NewsCatNav>
				<!--新闻分类结束-->
			</div>
			<div id="content_right">
			    
			    <!--内容开始-->
				<div class="mframe">
					<div class="tl"></div>
					<div class="tr"></div>
					<div class="tm">
					    <%=GetResourceString("News")%>
					</div>
					<div class="ml"></div>
					<div class="mr"></div>
					<div class="mm">
					    <div id="newslist">
					        <div class="news clear">
					            <!-- 参数为每页显示几条信息-->
								<%BindNewsList(30);%>
								<asp:DataList ID="dlNewsList" Runat="server" RepeatColumns="1">
									<ItemTemplate>
										<img src='<%=webSite %>images/items.gif' /> <a href='<%=webSite %>articles/News-<%#DataBinder.Eval(Container.DataItem, "ArticleID") %>.<%=config.html%>'>
											<%#DataBinder.Eval(Container.DataItem,"Title")%>
										</a>
										<span class='gray' style='font-family:arial;font-size:8pt'>(<%#DataBinder.Eval(Container.DataItem,"AddTime")%>)</span>
									</ItemTemplate>
								</asp:DataList>
					        </div>
					        <div class="page clear">
				             <!-- 翻页开始-->
                            <span>
                                <asp:HyperLink ID="hplPrev" runat="server"></asp:HyperLink>[&nbsp;
                                <asp:Label ID="lbPage" runat="server"></asp:Label>&nbsp;]
                                <asp:HyperLink ID="hplNext" runat="server"></asp:HyperLink>
                            </span>
                            <span style="padding-left:20px;">
                               <asp:Label ID="lblTotalPage" runat="server" visble="false"></asp:Label>
                                <asp:Label ID="lblPagerInfo" runat="server"></asp:Label><b><asp:Label ID="lblCurrentPage"
                                    runat="server" visble="false"></asp:Label></b> &nbsp;<input id="gopage" type="text"
                                        name="gopage" class="inputbg" size="1" onkeyup="isNumber()">
                                         &nbsp;<input type="button" value="Go" class="go" onclick="GoPage()">
                            </span>
			               <!-- 翻页结束-->
			               <script language="JavaScript" type="text/JavaScript">
						     function GoPage() 
				            { 
				                if(trim(document.getElementById("gopage").value)!="" )
                                {
                                    if(document.getElementById("gopage").value!="0")
                                    {
				                        if(document.getElementById('gopage').value > <%=totalPage %>)
				                        {
				                            alert('输入的数字大于总页数');
				                            return false;
				                        }
				                        else
				                        {
					                        javascript:window.location.href="<%=webSite %>articles/NewsCat-<%=Request.QueryString["CatID"]%>-" + document.getElementById("gopage").value + ".<%=config.html%>";
					                    }
								        
					                }
                                    else
                                    {  
                                        alert("输入错误！");
                                        document.getElementById("gopage").value="";
                                         return false;
                                    }
                                }
                                else
                                {
                                    alert("请输入要跳转到的页面");
                                    document.getElementById("gopage").value="";
                                    return false;
                                }
				            }
					        
				            function trim(str)
                            {
                                for(var i = 0; i<str.length && str.charAt(i)==" "; i++);
                                for(var j =str.length; j>0 && str.charAt(j-1)==" "; j--);
                                if(i>j) return "";
                                return str.substring(i,j);
                            }
						    
					         function isNumber()
                            {
                                document.getElementById("gopage").value = document.getElementById("gopage").value.replace(/\D/g,"");
                            }
						    </script>
					        </div>
					    </div> 
					</div>
				    <div class="bl"></div>
				    <div class="br"></div>
				    <div class="bm"></div>
				</div>
				<!--内容结束-->
			</div>
		</div>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
	</body>
</HTML>