 <% 
	data_path="../" 
	numid="51"
	dir="../err.asp" 
  %>
 <!--#include file="../conn/conn.asp"-->
<%
 Set rs=Server.CreateObject("adodb.recordSet")
 rs.Open ("select * from Websen_news where newsid between 745 and 745 order by dateandtime asc"),conn,1,1
  ContentText=replace(rs("content"),"<P>","")
  ContentText=replace(ContentText,"</P>","<BR><BR>")
  
  Sub Pagination(Operation)
	  if instr(1,ContentText,"<TABLE",1)<>0 and instr(1,ContentText,"&lt;!--page",1)<>0 then
		TContent=split(ContentText,"&lt;!--page--&gt;")
		for y=0 to ubound(TContent)
		  if Operation="ModifyHtml" then
		    'Call ModifyHtml(ubound(TContent)+1,TContent(y),y+1)
		  else
		   ' Call CreateHtml(ubound(TContent)+1,TContent(y),y+1)
		  end if
		next
	  elseif instr(1,ContentText,"<TABLE",1)<>0 and instr(1,ContentText,"&lt;!--page--&gt;",1)=0 then
		if Operation="ModifyHtml" then
		'  Call ModifyHtml("1",ContentText,1)
		else
		 ' Call CreateHtml("1",ContentText,1)
		end if
	  elseif instr(1,ContentText,"<TABLE",1)=0 and instr(1,ContentText,"&lt;!--page--&gt;",1)<>0 then
		TContent=split(ContentText,"&lt;!--page--&gt;")
		for y=0 to ubound(TContent)
		  if Operation="ModifyHtml" then
		   ' Call ModifyHtml(ubound(TContent)+1,TContent(y),y+1)
		  else
		   ' Call CreateHtml(ubound(TContent)+1,TContent(y),y+1)
		  end if
		next
	  else
	    if instr(1,ContentText,"<BR>",1)<>0 then		
	      
	      WordNumber=2500
	      PageCount=len(ContentText)/WordNumber
          PageCount2=int(len(ContentText)/WordNumber)
	      if PageCount>PageCount2 then PageCount=PageCount2+1
		  content=ContentText
	      dim PageNum
		  PageNum="0"
          for y=1 to PageCount
            PageContent=left(content,WordNumber)
		    if right(PageContent,4)<>"<BR>" then
              PNum=instr(WordNumber,content,"<BR>",1)
		      PageContent=left(content,PNum+3)
		      if PNum>3 then PageNum = PageNum&","&PNum+3
		      content=mid(content,PNum+4,len(content))
		    else
              content=mid(content,WordNumber+1,len(content))
		    end if
	      next
		  PageNum=PageNum&",100000"
		  PageNum=split(PageNum,",")
	      ContentTemp=ContentText
	      for i=1 to ubound(PageNum)
		    PageContent=left(ContentTemp,PageNum(i))
		    if action="ModifyHtml" then
		      Call ModifyHtml(ubound(PageNum),PageContent,i)
		    else
		      Call CreateHtml(ubound(PageNum),PageContent,i)
		    end if
		    ContentTemp=mid(ContentTemp,PageNum(i)+1,len(ContentText))
	      next

	    else
		  content=mid(content,WordNumber+1,len(content))
		  if Operation="ModifyHtml" then
		    'Call ModifyHtml(PageCount,PageContent,y)
		  else
		   ' Call CreateHtml(PageCount,PageContent,y)
	      end if
		end if
	  end if
  end Sub  
  
  %>
 
 
 
 <div  ><div align="center" style="width:578px;"><% call Pagination("ModifyHtml")%></div></div>