var baseurl = "http://jxcc.jxnews.com.cn/system/count/"; var maxpage = 0; var schannelId= "0047004001000000000"; var firsturl = "http://jxcc.jxnews.com.cn/research/fx/index.shtml"; maxpage = maxpage+1; schannelId = "0000000000000000000"+ schannelId ; schannelId = schannelId.substring(schannelId.length-19); if(window.attachEvent) { window.attachEvent("onload",selectPage) } else { window.addEventListener("load", selectPage) } function selectPage(){ if(maxpage*1>1){ var pagehtmlcontent ="
"; pagehtmlcontent +=""; pagehtmlcontent +=""; pagehtmlcontent +=""; pagehtmlcontent +=" "; pagehtmlcontent +="第/頁 到第  頁 "; pagehtmlcontent +="確定"; pagehtmlcontent +=""; document.getElementById("pagetemple").innerHTML=pagehtmlcontent; var currenturl = window.location.href; var allurl = currenturl .match("([0-9]+)_([0-9]+)"); if(allurl==null||allurl=="null"){ // maxpage = document.getElementById("maxpage").value; //當前頁數 document .getElementById("currentpage").value=maxpage ; //第一頁時隱藏上一頁 document .getElementById("uppage").style.display="none"; }else{ var chanelandpage = allurl[0].split("_"); var currentpage = chanelandpage[1]; //schannelId = chanelandpage[0]; //尾頁時隱藏下一頁 if(currentpage*1 == 1){ document .getElementById("downpage").style.display="none"; } //當前頁數 document.getElementById("currentpage").value=chanelandpage[1]*1; } document.getElementById("currentid").innerHTML=maxpage*1-document.getElementById("currentpage").value*1+1; document.getElementById("allid").innerHTML=maxpage; } }; function nextpage(value){ //上一頁 var pagenum = document.getElementById("currentpage").value; if(value == 1){ //那最后一段 var uppagelast= pagenum ; uppagelast = uppagelast*1+1; if(uppagelast==maxpage){ window.location.href=firsturl; }else{ uppagelast= "000000000"+ uppagelast; uppagelast= uppagelast.substring(uppagelast.length-9); baseurl= baseurl+"/"+schannelId.substring(0,7)+"/"+schannelId.substring(7,19)+"/"+uppagelast.substring(0,3)+"/"+uppagelast.substring(3,6)+"/c"+schannelId+"_"+uppagelast+".shtml"; window.location.href=baseurl; } }else { var uppagelast= pagenum ; uppagelast = uppagelast*1-1; uppagelast= "000000000"+ uppagelast; uppagelast= uppagelast.substring(uppagelast.length-9); baseurl= baseurl+"/"+schannelId.substring(0,7)+"/"+schannelId.substring(7,19)+"/"+uppagelast.substring(0,3)+"/"+uppagelast.substring(3,6)+"/c"+schannelId+"_"+uppagelast+".shtml"; window.location.href=baseurl; } } function changepage(){ var jumpnum = document .getElementById("jumppageId").value; var downpagelase = maxpage; var downpagelasecenter = maxpage ; var r = /^\+?[1-9][0-9]*$/; if(!r.test(jumpnum)){ alert("跳轉頁數必須為正整數"); return; }else if(jumpnum.trim()==""||jumpnum.trim()<=0||(jumpnum.trim()*1-1)>=(downpagelase*1)){ alert("輸入的頁數必須大于0小于最大頁數"); return; }else if(jumpnum.trim() == 1){ window.location.href=firsturl; }else{ downpagelase = downpagelase*1-jumpnum.trim()+1; downpagelase = "000000000"+ downpagelase ; downpagelase = downpagelase .substring(downpagelase.length-9); baseurl= baseurl+"/"+schannelId.substring(0,7)+"/"+schannelId.substring(7,19)+"/"+downpagelase.substring(0,3)+"/"+downpagelase.substring(3,6)+"/c"+schannelId+"_"+downpagelase+".shtml"; window.location.href=baseurl; } } 小悟空游戏