var newUrl; var page_name=''; var total_page=0; function getPager(url, sum, currnum, length,idTag,page_tag_name) { page_tag_name=page_tag_name+'='; page_name=page_tag_name; newUrl =url; sum=parseInt(sum); currnum=parseInt(currnum); length=parseInt(length); if (length >= sum) { document.getElementById(idTag).innerHTML= ""; return ""; } var showsum = "共"; var showitem = "页"; var showfirstpage = "首页"; var showuppage = "<"; var shownextpage = ">"; var showlastpage = "尾页"; var showjump = "跳转到"; var showselect = "Go"; // var showtotal = "共"; // var showpage = "页"; var pagerinfo = ''; var sbinfo = ''; sbinfo+="
"; var pagenum = 0; if (sum % length == 0) { pagenum = sum / length; pagenum = parseInt(pagenum); } else { pagenum = sum / length-0 + 1; pagenum = parseInt(pagenum); } total_page=pagenum; showfirstpage = "" +1; showlastpage = ""+pagenum; var first = ""; if (url.indexOf("?") != -1) { first = "&"; } else { first = "?"; } var pageUrl = ""; sbinfo+=(showsum + "" + pagenum + "" + showitem + "   "); if (1 == currnum) { sbinfo+=(showuppage + " "); } else { pageUrl = url + first +page_tag_name+ (currnum - 1); sbinfo+=("" + showuppage + " "); } var firstUrl = url + first +page_tag_name+ 1; sbinfo+=("" + showfirstpage + "  "); var tempstr = ""; if (pagenum < 6) { var tag = 0; for (var i = 2; i < pagenum + 1 && i <= pagenum-1; i++) { pageUrl = url + first +page_tag_name+ i; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); if(i>=pagenum-1){ tag = 1; } } } else if (currnum > pagenum - 1) { var tag = 0; sbinfo+=("..."); for (var i = currnum - 4; i < pagenum + 1 && i <= pagenum-1; i++) { pageUrl = url + first +page_tag_name+ i; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); if(i>=pagenum-1){ tag = 1; } } } else if (currnum < 4) { var tag = 0; for (var i = 2; i < currnum + 3 && i <= pagenum-1; i++) { pageUrl = url + first +page_tag_name+ i; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); if(i>=pagenum-1){ tag = 1; } } if(tag == 0){ sbinfo+=("..."); } } else { if(currnum - 2 > 2){ sbinfo+=("..."); }else{ } var tag = 0; for (var i = currnum - 2; i < currnum + 3 && i <= pagenum-1; i++) { pageUrl = url + first +page_tag_name+ i; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=tempstr; if(i>=pagenum-1){ tag = 1; } } if(tag == 0){ sbinfo+=("..."); } } var endUrl = url + first +page_tag_name+ pagenum; sbinfo+=(" " + showlastpage + "   "); if (currnum == pagenum) { sbinfo+=(shownextpage); } else { pageUrl = url + first +page_tag_name+ (currnum + 1); sbinfo+=("" + shownextpage + ""); } var selecturl = url + first; sbinfo+=(showjump + ""+""); sbinfo+=(""); pagerinfo = sbinfo; document.getElementById(idTag).innerHTML=pagerinfo; } function page_put_change(self_obj,value){ var int_value=parseInt(value); if (total_page