﻿function Pages(requestpage,MaxPage,RecordCount,SumMoney,PageName){
// Pages(当前页,总页数,主题总数,金额总和,传递的参数)
var p,ii;
if((requestpage-1)%10==0) 
	p=(requestpage-1)/10;
else
	p=parseInt((requestpage-1)/10);
//document.write(p);

if(requestpage==1)
   document.write('<font face=webdings color="#000000">9</font> ');
else
   document.write('<a href=?'+PageName+'=1 title=首页><font face=webdings color="#000000">9</font></a>');

if(p*10>0)
   document.write('<a href=?'+PageName+'='+p*10+' title=上十页><font face=webdings color="#000000">7</font></a> ');

for(ii=p*10+1;ii<=p*10+10;ii++)
 {
  if(ii==requestpage)
	 document.write ('<font color="red">'+ii+'</font>  ');
  else
     document.write ('<a href=?'+PageName+'='+ii+'><font color="#000000">'+ii+'</font></a>  ');
  if(ii==MaxPage)
    break;
 }
 document.write('</b>');

if(ii<MaxPage)
document.write('<a href=?'+PageName+'='+ii+' title=下十页><font face=webdings color="#000000">8</font></a>   ');
if(requestpage==MaxPage)
	document.write('<font face=webdings color="#000000">:</font>   ');
else
	document.write('<a href=?'+PageName+'='+MaxPage+' title=尾页><font face=webdings color="#000000">:</font></a>   ');

document.write('&nbsp;&nbsp;<font style="font-size: 12px;">页次：'+requestpage+'/'+MaxPage+'页 &nbsp;&nbsp;共'+RecordCount+'条记录');
document.write('<input type="hidden"　Id="MaxPage" name="MaxPage" value='+MaxPage+'>');
document.write('&nbsp;&nbsp;<input name="PageSize" size="4" class="Text_Page" type="text" id="PageSize" class="Text" onkeydown="if(event.keyCode==13){Go();return false;this.select()}" />&nbsp;<span class="Go"><input type="button" onclick="Go()" value="Go"></span>');
}

function Go()
{
var Page=document.form1.PageSize.value;
var MaxPage=document.form1.MaxPage.value;

if(Page==""){alert('没有找到您所输入的数字!'); return false;}
if(isNaN(Page)){alert('您输入的不是数字！'); return false;}
Page=parseInt(Page);     
    if(Page<=0||Page>MaxPage){alert('必须输入1-'+MaxPage+'之间的整数!!!');}   
//if(Page <= 0 || Page >= MaxPage)
//{
//alert('页码格式不正确,页码的范围应在1-'+MaxPage+'之间！您输入的值是：'+ Page +'');
//}
else
 {
 this.location='?&Page='+Page;
 }
}
