<%@ Page language="c#" Codebehind="NewsCat.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.NewsCat" %>
<%@ Register TagPrefix="uc1" TagName="NewsCatNav" Src="Modules/NewsCatNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Bulletin" Src="Modules/Bulletin.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LoginForm" Src="Modules/LoginForm.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTop2Level" Src="Modules/LeftNavTop2Level.ascx" %>
<%@ Register TagPrefix="uc1" TagName="CommendProduct" Src="Modules/CommendProduct.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SpecialProduct" Src="Modules/SpecialProduct.ascx" %>
<%@ Register TagPrefix="uc1" TagName="HotProduct" Src="Modules/HotProduct.ascx" %>
<%@ Register TagPrefix="uc1" TagName="NewProduct" Src="Modules/NewProduct.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Link" Src="Modules/Link.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/XpShopFreeDemo_8_1/images/navbar_on.jpg") no-repeat;}
        #navbar ul li.newsindex a:link,#navbar ul li.newsindex a:visited,#navbar ul li.newsindex a:hover{color:#ffffff; font-weight:bold; text-decoration:none;}
		</style>
	</HEAD>
	<body>
		<div id="container">
			<uc1:Header id="Header1" runat="server"></uc1:Header>
		    <!--位置导航开始-->
			<div class="path"><a href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a> > <%=GetResourceString("news")%></div>
			<!--位置导航结束-->
			<div id="content">
				<div id="content_left_side">
					<!--新闻分类开始-->
						<uc1:NewsCatNav id="NewsCatNav1" runat="server"></uc1:NewsCatNav>
					<!--新闻分类结束-->
				</div>
				<div id="content_middle_side">
				    <!--内容开始-->
					<div class="mframe">
						<div class="tl"></div>
						<div class="tr"></div>
						<div class="tm"><div class="on"><%=GetResourceString("News")%></div></div>
						<div class="ml"></div>
						<div class="mr"></div>
						<div class="mm">
						    <div id="newslist">
						        <div class="news clear">
						            <!-- 参数为每页显示几条信息-->
									<%BindNewsList(10);%>
									<asp:DataList ID="dlNewsList" Runat="server" RepeatColumns="1">
										<ItemTemplate>
											<img src='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>images/items.gif' /> <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>NewsShow.aspx?NewsID=<%# DataBinder.Eval(Container.DataItem, "ArticleID") %><%}else{%>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="return 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('<%=GetResourceString("Error1")%>');
					                            return false;
					                        }
					                        else
					                        {
						                        javascript:window.location.href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>NewsCat.aspx?CatID=<%=Request.QueryString["CatID"]%>&Page=" + document.getElementById("gopage").value;
						                    }
    								        
						                }
                                        else
                                        {  
                                            alert("<%=GetResourceString("InputError")%>");
                                            document.getElementById("gopage").value="";
                                             return false;
                                        }
                                    }
                                    else
                                    {
                                        alert("<%=GetResourceString("Entertojumptothepage")%>");
                                        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 style="clear:both;"></div>
			</div>
			<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
			<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		</div>
	</body>
</HTML>