<%
function sd(sdnum)
select case	sdnum
	   case 1
	   response.write "<font color=#1941A5><strong>很慢</strong></font>"
	   case 2
	   response.write "<font color=#AFD8F8><strong>较慢</strong></font>"
	   case 3
	   response.write "<font color=#F6BD0F><strong>一般</strong></font>"
	   case 4
	   response.write "<font color=#8BBA00><strong>较快</strong></font>"
	   case 5
	   response.write "<font color=#A66EDD><strong>很快</strong></font>"
end select
end function

function xj(xjnum)
select case	xjnum
	   case 1
	   response.write "<font color=#1941A5><strong>很差</strong></font>"
	   case 2
	   response.write "<font color=#AFD8F8><strong>较差</strong></font>"
	   case 3
	   response.write "<font color=#F6BD0F><strong>一般</strong></font>"
	   case 4
	   response.write "<font color=#8BBA00><strong>较好</strong></font>"
	   case 5
	   response.write "<font color=#A66EDD><strong>很棒</strong></font>"
end select
end function

function fw(fwnum)
select case	fwnum
	   case 1
	   response.write "<font color=#1941A5><strong>很差</strong></font>"
	   case 2
	   response.write "<font color=#AFD8F8><strong>较差</strong></font>"
	   case 3
	   response.write "<font color=#F6BD0F><strong>一般</strong></font>"
	   case 4
	   response.write "<font color=#8BBA00><strong>较好</strong></font>"
	   case 5
	   response.write "<font color=#A66EDD><strong>很好</strong></font>"
end select
end function

function aq(aqnum)
select case	aqnum
	   case 1
	   response.write "<font color=#1941A5><strong>常缺</strong></font>"
	   case 2
	   response.write "<font color=#AFD8F8><strong>短缺</strong></font>"
	   case 3
	   response.write "<font color=#F6BD0F><strong>够用</strong></font>"
	   case 4
	   response.write "<font color=#8BBA00><strong>较多</strong></font>"
	   case 5
	   response.write "<font color=#A66EDD><strong>充足</strong></font>"
end select
end function
%>
<%sub listpages(mycondition)
    if pages<1 then
        exit sub
    end if
    response.write "<div class='pages'>&nbsp;"&(p*10+currentpage)&"/"&Pages&"&nbsp;共<b>"&Records&"</b>条记录</div>"
    if (p*10+currentpage)>1 then
        response.write "<div class='button'><a href='"&request.ServerVariables("script_name")&"?currentpage=1&&p=0"&mycondition&"' title='头页'><img src='images/btn_previouspage.gif'></a></div>" 
    end if
    '===首页
    if p>0 and currentpage=1 then
        response.write  "<div class='button'><a href="&request.ServerVariables("script_name")&"?currentpage=10&p="&p-1&mycondition&" title='上一页'><img src='images/btn_uppage.gif'></a></div>"
    elseif currentpage>1 then
        response.write  "<div class='button'><a href="&request.ServerVariables("script_name")&"?currentpage="&currentpage-1&"&p="&p&mycondition&" title='上一页'><img src='images/btn_uppage.gif'></a></div>"
    end if
    '===上页
    response.write "<ul class='pagetab'>"

    if p>0 then
        response.write    "<li><a href='"&request.ServerVariables("script_name")&"?currentpage=10&p="&p-1&mycondition&"' title='上十页'>上十页</a></li>"
    end if
    '-------------------下面写出当前十个页码
    for i=1 to 10
        if (p*10+i)>pages then exit for
        if currentpage=i then
            response.write "<li class='current'><a "
        else
            response.write "<li><a "
        end if 
        response.write "href='"&request.ServerVariables("script_name")&"?currentpage="&i&"&p="&p&mycondition&"'>"&(p*10+i)&"</a></li>"    
     next
     '--------------------察看下十页的连接
    if (p*10+10)<pages then
        response.write "<a href='"&request.ServerVariables("script_name")&"?currentpage=1&p="&p+1&mycondition&"' title='下十页'>下十页</a>" 
    end if
    '-----------------------------------------------上下页导航
    response.write "</ul>"

    if (p*10+currentpage)<pages and currentpage=10 then
        response.write  "<div class='button'><a href='"&request.ServerVariables("script_name")&"?currentpage=1&p="&p+1&mycondition&"' title='下一页'><img src='images/btn_dowmpage.gif'></a></div>"
    elseif (p*10+currentpage)<pages then
        response.write  "<div class='button'><a href='"&request.ServerVariables("script_name")&"?currentpage="&currentpage+1&"&p="&p&mycondition&"' title='下一页'><img src='images/btn_dowmpage.gif'></a></div>"
    end if
    '===下页

      if (p*10+currentpage)<pages then
        response.write "<div class='button'><a href='"&request.ServerVariables("script_name")&"?currentpage="&((pages-1) mod 10)+1&"&p="&((pages-1)\10)&mycondition&"' title='尾页'><img src='images/btn_dowmpreviouspage.gif'></a></div>"
      end if
      '===尾页

end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
    if myRS.eof and myRS.bof then str="没有纪录"
    if str="" then
        if mysize="" or NOT IsNumeric(mysize) then
            mysize=15
        end if
        myRS.PageSize=mysize
        pages=myRS.pagecount
        records=myRS.recordcount
        On Error Resume Next '取得数字
        currentPage=request("currentPage")
        if currentPage="" then
            currentPage=1
        end if
        currentPage=CInt(currentPage)
        if Err.Number <> 0 Then
            currentPage=1
            Err.Clear
        end if
        if currentPage<1 then
            currentPage=1
        elseIf currentPage>10 then
            currentPage=10
        end if
        '----------------处理p
        p=request("p")
        if p="" then
            p=0
        end if
        p=CLng(p)
        if Err.Number <> 0 Then
            p=0
            Err.Clear
        end if
        if p<0 then
            p=0
        end if
        '--判断是否出了页数范围
        nowPage=p*10+currentPage
        if nowPage>pages then
            p=(pages-1)\10
            currentPage=((pages-1) mod 10)+1
        end if
        myRS.absolutepage=p*10+currentPage
    else
       currentPage=1
       records=0
       pages=1
    end if
end sub
dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%>