{
document.write("共"+countPage+"页 ");
//设置上一页代码
if(countPage>1&¤tPage!=0&¤tPage!=1)
document.write("首页 上一页 ");
else if(countPage>1&¤tPage!=0&¤tPage==1)
document.write("首页 上一页 ");
else
document.write("首页 上一页 ");
//循环
var num = 5;
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i"+(i+1)+" ");
else if(i==0)
document.write(""+(i+1)+" ");
else
document.write(""+(i+1)+" ");
}
//设置下一页代码
if(countPage>1&¤tPage!=(countPage-1))
document.write("下一页 尾页 ");
else
document.write("下一页 尾页 ");
//跳转页面
document.write("转到第页"+" ");
}
function toPage(){
var _num = document.getElementById("num").value;
if(isNaN(_num)){
alert("请输入数字");
return false;
}
var str = "index"+"_"+(_num-1)+"."+"html";
var url = location.href.substring(0,location.href.lastIndexOf("/")+1);
if(_num<=1||_num==null)
location.href = url+"index"+"."+"html";
else if(_num>countPage)
alert("本频道最多"+countPage+"页");
else
location.href = url+str;
}