<style>
<!--
.page_ {
float:left;
clear:both;
}
.page_ a{
font-size:13px;
color:#000;
}
.page_ div{
font-size:13px;
color:#000;
width:auto;
height:15px;
line-height:15px;
text-align:center;
float:left;
margin-right:10px;
}
.page_ .page_select_no{
width:15px;
height:15px;
border:1px solid #000;
cursor:pointer;
}
.page_ .page_select{
width:15px;
height:15px;
border:1px solid #286094;
background-color:#417EB7;
color:#fff;
cursor:pointer;
}
-->
</style>
<script>
var listNum=3;
var PageNum=3;
j=document.getElementsByClassName("lili").length;
if(j>PageNum){
PagesLen = Math.ceil(j/listNum);
upPage(0);
}
function upPage(p){
var obj = document.getElementsByClassName("lili");
nowPage=p;
for (var i=0;i<j;i++){
obj[i].style.display="none";
}
for (var i=p*listNum;i<(p+1)*listNum;i++){
if(obj[i])obj[i].style.display="block";
}
var strS = "<div onclick=\"upPage(0)\" style=\"cursor:pointer;\">首页</div>";
var PageNum_2 = PageNum%2==0?Math.ceil(PageNum/2)+1:Math.ceil(PageNum/2);
var PageNum_3 = PageNum%2==0?Math.ceil(PageNum/2):Math.ceil(PageNum/2)+1;
var strC = "",startPage,endPage;
if (PageNum >= PagesLen) {
startPage = 0;
endPage = PagesLen-1;
} else if (nowPage < PageNum_2){
startPage = 0;
endPage = PagesLen-1>PageNum?PageNum:PagesLen-1;
} else {
startPage = nowPage+PageNum_3>=PagesLen?PagesLen-PageNum-1: nowPage-PageNum_2+1;
var t = startPage+PageNum;endPage=t>PagesLen?PagesLen-1:t;
}
for (var i=startPage;i<=endPage;i++){
if (i==nowPage) strC += "<div class=\"page_select\" onclick=\"upPage("+i+")\">"+(i+1)+"</div>";
else strC += "<div class=\"page_select_no\" onclick=\"upPage("+i+")\">"+(i+1)+"</div>";
}
strE = "<div onclick=\"upPage("+(PagesLen-1)+")\" style=\"cursor:pointer;\">尾页</div>";
strE2 = "<div >"+(nowPage+1)+"/"+PagesLen+"页"+" 共"+j+"条</div>";
document.getElementById("changpage").innerHTML = strS+strC+strE+strE2;
}
</script>
<div id="line1" class="regy_bus_res">
<!--{foreach name=goods_list from=$goods_list item=goods}-->
<div class="line_list1 bus_res_list">
</div>
<!--{/foreach}-->
<div id="changpage" class="page_"></div>
</div>