<%
Const btn_first="<font face=""webdings"">9</font>"  '定义第一页按钮显示样式
Const btn_prev="<font face=""webdings"">7</font>"  '定义前一页按钮显示样式
Const btn_next="<font face=""webdings"">8</font>"  '定义下一页按钮显示样式
Const btn_last="<font face=""webdings"">:</font>"  '定义最后一页按钮显示样式

function jk_pagecute(maxpage,thepages,viewpage,pageurl,pp,font_color)
  if int(thepages)=0 then
    jk_pagecute="<font color=" & font_color & "> "&btn_first&" <b>1</b> "&btn_last&" </font>"
    exit function
  end if
  dim pi,ppp,pl,pr
  pi=1
  ppp=pp\2
  if pp mod 2 = 0 then ppp=ppp-1
  pl=viewpage-ppp
  pr=pl+pp-1
  if pl<1 then
    pr=pr-pl+1
    pl=1
    if pr>thepages then pr=thepages
  end if
  if pr>int(thepages) then
    pl=pl+thepages-pr
    pr=thepages
    if pl<1 then pl=1
  end if
  if int(viewpage)=1 then
     jk_pagecute=jk_pagecute&" <font color=" & font_color & "> "&btn_first&" </font> "
  else
     jk_pagecute=jk_pagecute&" <a href='"& pageurl &"' title='第一页'>"&btn_first&"</a> "
  end if
  if int(viewpage)>1 then
	 jk_pagecute=jk_pagecute&" <a href='"& pageurl &"page="&viewpage-1&"' title='上一页'>"&btn_prev&"</a> "
  end if
  for pi=pl to pr
    if cint(viewpage)=cint(pi) then
      jk_pagecute=jk_pagecute&" <font color=" & font_color & " face=黑体><b>" & pi & "</b></font> "
    else
      jk_pagecute=jk_pagecute&" <a href='"& pageurl &"page="& pi &"' title='第 " & pi & " 页' clases=0 style=""font-family:黑体""><b>" & pi & "</b></a> "
    end if
  next
    if cint(viewpage)<cint(thepages) then 	  
	  jk_pagecute=jk_pagecute&" <a href='"& pageurl &"page="&viewpage+1&"' clases=0 title='后一页'>"&btn_next&"</a> "
    end if
	if cint(viewpage)=cint(thepages) then
      jk_pagecute=jk_pagecute&" <font color=" & font_color & "> "&btn_last&" </font> "
	else
	  jk_pagecute=jk_pagecute&" <a href='"& pageurl &"page="& thepages &"' title='最后一页'>"&btn_last&"</a> "
	end if
end function

function pagecute_fun(viewpage,thepages,pagecuteurl)
  dim pf0,pf1,pf2,pf3,pf4,pf5
  pf0="已是第一页"
  pf1="第一页"
  pf2="上一页"
  pf3="下一页"
  pf4="最后一页"
  pf5="已是最后一页"
  pagecute_fun=VbCrLf & "<table border=0 cellspacing=0 cellpadding=0><tr><form action='"&pagecuteurl&"' method=post><td>"
  if cint(viewpage)=1 then
    pagecute_fun=pagecute_fun&vbcrlf&"<font class=gray>"&pf0&"</font>&nbsp;"
  else
    pagecute_fun=pagecute_fun&vbcrlf&"<a href='"&pagecuteurl&"page=1' alt='"&pf1&"'>"&pf1&"</a>┋<a href='"&pagecuteurl&"page="&cint(viewpage)-1&"' alt='"&pf2&"' clases=0>"&pf2&"</a>&nbsp;"
  end if
  if cint(viewpage)=cint(thepages) or cint(thepages)=0 then
    pagecute_fun=pagecute_fun&vbcrlf&"<font class=gray>"&pf5&"</font>"
  else
    pagecute_fun=pagecute_fun&vbcrlf&"<a href='"&pagecuteurl&"page="&cint(viewpage)+1&"' alt='"&pf3&"' clases=0>"&pf3&"</a>┋<a href='"&pagecuteurl&"page="&cint(thepages)&"' alt='"&pf4&"'>"&pf4&"</a>"
  end if
  if cint(thepages)<>1 then
    pagecute_fun=pagecute_fun&vbcrlf&"&nbsp;<input type=text name=page value='"&viewpage&"' size=2>&nbsp;<input type=submit class=btn value='GO'>"
  end if
  pagecute_fun=pagecute_fun&vbcrlf&"</td></form></tr></table>"
end function
%>