<!--#include file="Head.asp"-->
<div align="center">
  <table width="950" border="0" cellspacing="0" cellpadding="0" class="Outside">
    <tr>
      <td width="3" ></td>
      <td width="240" height="500" valign="top"  bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center"><table width="215" border="0" align="center" cellpadding="1" cellspacing="0">
            <tr>
              <td width="215" height="38" background="../Images/VoteMenu.jpg"><div style="margin-left:90px;"><b><a href="VoteRotal.asp" target="_blank"><font color="#FFFFFF">新闻导航</font></a></b></div></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td >&nbsp;</td>
        </tr>
        <tr>
          <td align="center" ></td>
        </tr>
        <tr>
          <td>
		  <div style="margin-left:20px;">
			  <%
			  Datafrom="ameav_NewsSort"
			  ListView="News"
			  ListSort(0)
			  %>
			</div>
		  </td>
        </tr>
        <tr>
          <td height="30" >&nbsp;</td>
        </tr>
      </table>
<!--#include file="tabmenu.asp"-->
	  </td>
      <td width="1"   bgcolor="#000000"></td>
      <td width="675" valign="top" class="AllCenter"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="30" height="25" align="center" ></td>
          <td  class="Location"><a href="../index.asp">首页</a><img src="../Images/Arrow_02.gif" width="13" height="12" align="absmiddle"><a href='NewsList.asp'>参赛新闻</a></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="30" height="12"></td>
          <td></td>
          <td width="30"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><%=WebContent()%></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="30"></td>
          <td></td>
          <td></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<%
function WebContent()
dim ID,content,numbers,pagenum,maxpage,requestpage,thispage
  ID=Request("ID")
  if ID="" or (not isnumeric(ID)) then
    response.write "<div align='center'>数据读取异常错误</div>"
    exit function
  end if
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from Ameav_News where ViewFlag  and ID="&ID
  rs.open sql,conn,1,3
	if not rs.eof then
	dim Sitenum
	Sitenum=1000
	numbers=len(rs("content"))  '总字节数
	pagenum=Sitenum            '每页显示的数量
	maxpage=-int(-numbers/pagenum)'总页数
	requestpage=clng(request("p"))'接收页码
	if requestpage="" or requestpage=0 then'获取默认页码
	requestpage=1
	end if
	if requestpage>maxpage then  '当前页的页码大于最大页码时，使当前页码等于最大页码
	requestpage=maxpage
	end if
	if not requestpage=1 then  '当前页码不等于1时，向下移动相应的字节数
	content=mid(rs("content"),(requestpage-1)*pagenum+1,Sitenum)
	else
	content=left(rs("content"),Sitenum) '当页码等于1时，截取相应文本
	end if
	if isempty(requestpage) then  
             thispage=1  
            else  
             thispage=cint(requestpage)  
     end if  
    response.write"<table width='650' border='0' cellspacing='0' cellpadding='0'>"
    response.write "<tr><td align='center' colspan='2' height=40><font style='font-size:14px;font-weight: bold;color: #ff0000'>"&rs("NewsName")&"</font></td></tr>"
    response.write "<tr><td align='center' colspan='2'>新闻来源："&rs("Source")&"&nbsp;&nbsp;&nbsp;&nbsp;点击数："&rs("ClickNumber")&"&nbsp;&nbsp;&nbsp;&nbsp;更新时间："&rs("AddTime")&"&nbsp;&nbsp;&nbsp;&nbsp;<a style='cursor:hand'  onclick='window.external.AddFavorite(location.href,document.title);' >收藏此页</a></td></tr>"
	response.write "<tr><td colspan='2'><hr width='100%' size='1' noshade='noshade' color='#FF0000'></td></tr>"
    if ViewNoRight(rs("GroupID"),rs("Exclusive")) then
	  response.write "<tr><td colspan='2'>"
	  %>
     <%=Replace(content,chr(13),"<br>")%>
	 <% response.write "</td></tr>"
	  rs("ClickNumber")=rs("ClickNumber")+1
	else
	  response.write "<tr><td colspan='2'><div align='center'><img src='../Images/NoRight.jpg'></div></td></tr>"
	end if
    response.write "<tr><td height='25' align='right' >"
	response.write "总页数：<font color=red>"&maxpage&"</font>&nbsp;&nbsp;第&nbsp;" 
	  for i=1 to maxpage
         if thispage=i then  
          response.write ""&i&""  
         else 
      response.write "<a href='?p="&i&"&ID="&ID&"&SortID="&Request("SortID")&"'>"&i&"</a>&nbsp;"
	   end if
	   next
   	response.write "&nbsp;页&nbsp;</td><td width='10%'><a href='#TOP'><img src='../Images/Button_top_01.gif' align='absbottom' border='0'></a></td></tr>" 
	rs.update	
  else 
    response.write "<tr><td>暂无相关信息</td></tr>"
  end if
  response.write "<tr><td colspan='2'><hr width='100%' size='1' noshade='noshade' color='#FF0000'></td></tr><tr><td colspan='2'>"
  rs.close
  Dim IDmax,IDmin
  	  IDmax=ID+1
	set rs = server.createobject("adodb.recordset")
	sql="select * from Ameav_News where ViewFlag  and ID="&IDmax
	rs.open sql,conn,1,1
	if not rs.eof then
		 Response.Write "上一篇：<a href='?id="&Idmax&"&SortID="&rs("SortID")&"'>"&rs("NewsName")&"</a><br>"
	else
		Response.Write "上一篇：暂无新闻<br>"
	end if
	rs.close
	IDmin=ID-1
	set rs = server.createobject("adodb.recordset")
	sql="select * from Ameav_News where ViewFlag  and ID="&IDmin
	rs.open sql,conn,1,1
	if not rs.eof then
		 Response.Write "下一篇：<a href='?id="&IDmin&"&SortID="&rs("SortID")&"'>"&rs("NewsName")&"</a>"
	else
		Response.Write "下一篇：暂无新闻"
	end if
	rs.close
  response.write "<tr><td colspan='2' align='right'> <a onClick='history.go(0)'>【刷新页面】</a><a style='cursor:hand'  onclick='window.external.AddFavorite(location.href,document.title);' >【加入收藏】</a><A href='javascript:window.print();'>【打印此文】</A> <a onClick='window.self.close()'>【关闭窗口】</a></td></tr>"
  response.write"</td></tr></table>"

  set rs=nothing
  end function
%>
<!--#include file="Foot.asp"-->