var weburl = getWeburl(); //页面跳转 function getCurrentPage(colid) { var current = 1; if (document.all.pageto) { current = document.all.pageto.value*1; current = current > document.all.maxPage.value*1? document.all.maxPage.value*1 : current; } var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; /* var selectop = document.all.pageindex; if (selectop && selectop.options[current-1]) { selectop.options[current-1].selected = true; } */ window.location = weburl+"column.jsp?id="+colid+"¤t="+current+namecon; } //跳转指定页 function getNumPage(colid, n) { var current = n > 1 ? n : 1; var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; window.location = weburl+"column.jsp?id="+colid+"¤t="+current+namecon; } //首页 function funFirst(colid) { if (document.all.pageindex) { //document.all.pageindex.options[0].selected=true; } var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; window.location=weburl+"column.jsp?id="+colid+"¤t=1"+namecon; } //末页 function funEnd(end,colid) { if (document.all.pageindex) { //document.all.pageindex.options[end].selected=true; } var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; window.location=weburl+"column.jsp?id="+colid+"¤t="+end+namecon; } //上一页 function funPre(colid) { var current = 1; if (document.all.pageindex) { current = document.all.pageindex.value*1-1; } var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; current = current<1?1:current; /* var selectop = document.all.pageindex; if (selectop && selectop.options[current-1]) { selectop.options[current-1].selected = true; } */ window.location=weburl+"column.jsp?id="+colid+"¤t="+current+namecon; } //下一页 function funNext(colid) { var current = 1; if (document.all.pageindex) { current = document.all.pageindex.value*1+1; current = current > document.all.maxPage.value*1? document.all.maxPage.value*1 : current; } var artname = document.all.artname.value; artname = encodeURIComponent(artname); var namecon = artname?("&artname="+artname):""; /* var selectop = document.all.pageindex; if (selectop && selectop.options[current-1]) { selectop.options[current-1].selected = true; } */ window.location=weburl+"column.jsp?id="+colid+"¤t="+current+namecon; } function changeSearchKey(obj) { var artnametopobj = document.all.artnametop; if (artnametopobj) { artnametopobj.value = obj.value; } var artnameobj = document.all.artname; if (artnameobj) { artnameobj.value = obj.value; } } function checkNum(o) { if(o.value.length==1){ o.value=o.value.replace(/[^1-9]/g,'') }else{ o.value=o.value.replace(/\D/g,'') } if (!o.value) { o.value = ""; } if (o.value*1 > document.all.maxPage.value*1) { o.value = document.all.maxPage.value; } } function getWeburl() { var weburl = "./"; var thisLink = document.location.href.replace("http://", "").replace("https://", "").split("/"); if (thisLink && thisLink.length >= 4) { // 非主站根目录 if(thisLink[1] == "col" && !isNaN(thisLink[2])){ // 第二个位置为col且第三个位置为数字:平行于主站 weburl = "/"; } else if (thisLink[2] == "col" && !isNaN(thisLink[3])) { // 第三个位置为col且第四个位置为数字:从属于主站 weburl = "/" + thisLink[1] + "/"; } else { } } return weburl; }