function createPageHTML(divName,_nPageCount, _nCurrIndex, _sPageName, _sPageExt,_nPageSum){ var head = document.getElementsByTagName('head')[0]; var style = document.createElement("link"); style.href = ""; style.rel = "stylesheet"; style.type = "text/css"; head.insertBefore(style,head.childNodes[0]); var con_text = ""; if(_nPageCount == null || _nPageCount<1){ return; } var nCurrIndex = _nCurrIndex; con_text += "
"; if(_nPageCount>1) con_text +="首页
"; else con_text +="首页 "; if(nCurrIndex>1){ if((nCurrIndex-1)>0){ if((nCurrIndex-1)==1) con_text += "
上一页
"; else con_text += "
上一页
"; } } var startpage=0,endpage =0; if(nCurrIndex > 5){ startpage = nCurrIndex-2; if(_nPageCount-nCurrIndex>2){ endpage =nCurrIndex+2; }else{ endpage = _nPageCount; } }else if(_nPageCount<6){ startpage = 1; endpage = _nPageCount; }else{ startpage = 1; endpage = 6; } for(var k=startpage; k<=endpage; k++){ var param = ""; if(k >1 ) param = "_" + k; if(k==nCurrIndex) con_text += "
"+k+"
"; else con_text += "
"+k+"
"; } if(nCurrIndex<_nPageCount){ con_text += "
下一页
"; } con_text += "
"; if(_nPageCount>1) con_text += "末页"; else con_text += "末页"; con_text += "
第 "+nCurrIndex+" 页 转GO 共 "+_nPageSum+" 条 共 "+_nPageCount+" 页
"; document.getElementById(divName).innerHTML = con_text; } function pagination_go(sPageName,sPageExt,nPageCount){ var gopageID = document.getElementById('pagination_input').value; gopageID= gopageID.replace(" ",''); if(gopageID){ if(parseInt(gopageID)<=nPageCount && parseInt(gopageID)>0){ if(gopageID=="1"){ window.location.href = sPageName+"."+sPageExt; }else{ window.location.href = sPageName+"_" + gopageID + "."+sPageExt; } } } return false; }