﻿var total=current1;
var url=window.location.href.toLowerCase();
var ra=/list\d{0,2}_/;
var rb=/_\d+\.html/;
var list="list";
var current="";
var max=total/150;
if(max.toString().indexOf(".")!=-1)
{
   var a=new Array();
   a=max.toString().split(".");
   max=a[0];
}
if(url.indexOf("index.html")!=-1 || url.indexOf("_1.html")!=-1 || url.indexOf("list")==-1)
{
   current=1;
}
else
{
   var page=url.match(rb).toString().replace("_","").replace(".html","");
   current=page-(10000-max);
}
var listpage="页次：<span class=\"colorred bold\">" + current + "</span>" + "/<span color=\"bold\">" + max + "</span>页　　<span class=\"bold\">" + total + "</span>条记录　　　<a href=\"index.html\">首页</a>　";
if(current>1)
{
   if (current == 2)
   {
      listpage+="<a href=\"index.html\">上一页</a>　";
   }
   else
   {
      listpage+="<a href=\""+list + "_" + (10000 - max+current-1) + ".html\">上一页</a>　";
   }
}

if(current<=10)
{
   var num_a=10;
   if(max<10)
   {
      num_a=max;
   }
   for(var i=(current==1)?2:1;i<=num_a;i++)
   {
      if(i==current)
      {
         listpage+="<span class=\"colorred bold\">"+i+"</span> ";
      }
      else
      {
         if(i==1)
         {
            listpage+="<a href=\"index.html\">"+i+"</a> ";
         }
         else
         {
            listpage+="<a href=\""+list + "_" + (10000 - max + i) + ".html\">"+i+"</a> ";
         }
      }
   }
}
else
{
   var num_b="";
   if(current>(max-5))
   {
      num_b=max;
   }
   else
   {
      num_b=current+5;
   }
   for (var i = (current - 5); i <= num_b; i++)
   {
      if(i==current)
      {
         listpage+="<span class=\"colorred bold\">"+i+"</span> ";
      }
      else
      {
         listpage+="<a href=\""+list + "_" + (10000 - max + i) + ".html\">"+i+"</a> ";
      }
   }
}
if (current < max)
{
   listpage+="　<a href=\""+list + "_" + (10000 - max+current+1) + ".html\">下一页</a>　";
}
listpage+="<a href=\""+list + "_10000.html\">尾页</a>";
document.write(listpage);









