<% 
				  if not isempty(request("page")) then
	      CurrentPage=cint(request("page"))
	else
	     CurrentPage=1
	end if
						if xl=0 then
							sql="select * from 內容 where 大類="& dl &" order by 序號 desc,id desc"
						else
							sql="select * from 內容 where 大類="& dl &" and 小類="& xl &" order by 序號 desc,id desc"
						end if
						rs.open sql,conn,1,1
	if rs.recordcount=0 then
		response.write "
此欄目正在建設中..."
	elseif rs.recordcount=1 then 
		id=rs("id")
		response.Redirect("jianxin/"&id&"-1.htm")
	else
		MaxperPage=13
		TotalPut=rs.recordcount
		if CurrentPage <1 then
	  		CurrentPage=1
	 	end if
	 	if (CurrentPage-1)*MaxperPage>TotalPut then
	     	if (TotalPut mod MaxperPage)=0 then
		     	CurrentPage=TotalPut\MaxperPage
		 	else
		     	CurrentPage=TotalPut\MaxperPage+1
		 	end if
	  	end if
	  	if CurrentPage=1 then
			showcontent
			showpages totalput,MaxPerPage,"service.asp" 
	 	else
	    	if (CurrentPage-1)*MaxperPage
 
			
			<% do while not rs.eof and i< MaxperPage
			     dim rss
				 set rss=server.CreateObject("adodb.recordset")
				 rss.open "select 小類 from 小類 where id="&rs("小類"),conn,1,1
				 if rss.eof and rss.bof then
				 response.Write""
				 else
				 xlm=rss("小類")
				 end if
				 rss.close
			%>
				-  [<%= xlm %>] -1.htm"><%= rs("標題") %>  【<%= month(rs("日期")) %>.<%= day(rs("日期")) %>】
 
				  <% i=i+1
					if i>=MaxperPage then exit do
					 rs.movenext
					 loop
					 %>
			
		 
        
			  <%
							   end sub 
		
		function showpages(totalnumber,maxperpage,filename)
		    dim n
			if TotalPut mod MaxperPage=0 then
			   n=TotalPut\MaxperPage
			else
			    n=TotalPut\MaxperPage+1
			end if
			 response.write "
"
				end function %>