var pager_en = "<<first "
+ "<previous next> "
+ " last>> "
+" jumpto "
+" go";
var pager_rus = "<<дома "
+ "<предыдущий следующий> "
+ " последний>> "
+ " повернуть страница"
+ " идти";
var pager_sp = "<<casa "
+ "<anterior próximo&tt; "
+ " últimos>> "
+ " saltar página"
+ " ir";
var lang = jq("#languageversion_rc").text();
switch (lang.tolowercase()) {
case "en":
changedisplaypagerlang(pager_en);
break;
case "ru":
changedisplaypagerlang(pager_rus);
break;
case "sp":
changedisplaypagerlang(pager_sp);
break;
default:
break;
}
var docurl = document.location.href; //当前url
var end = docurl.lastindexof("/");
var path = docurl.substring(0, end); //获取当前文件所在路径
var realdocurl = docurl.substring(end); //获取当前文件url
var lasttoken = realdocurl.lastindexof("_");
var lastsuffix = realdocurl.lastindexof(".shtml");
var relativeurl = lasttoken > 0 ? realdocurl.substring(0, lasttoken) : realdocurl.substring(0, lastsuffix); //获取当前文件url名称
var baseurl = path + relativeurl; //分页基url
if (location.href.lastindexof(".shtml") < 0) {
baseurl = baseurl + "/" + pagename;
}
var indexurl = lasttoken > 0 ? path + relativeurl + '.shtml' : path + realdocurl; //首页url
document.getelementbyid("index").href = indexurl; //设置首页的url连接
var pager_p = document.getelementbyid('pager_p');
if (maxpage == 1) {
pager_p.style.display = "none";
}
else {
pager_p.style.display = "block";
}
var curpage = 1;
var showpages = 100;
var isindex = false;
if (end > 0) {
if ((path+realdocurl) != indexurl && lasttoken > 0 && lastsuffix > 0 && lastsuffix > lasttoken) {
curpage = realdocurl.substring(lasttoken + 1, lastsuffix);
curpage = maxpage - curpage + 1;
} else {
isindex = true;
}
}
if (isnan(curpage)) {
curpage = 1;
}
//页码显示当前页所在位置 c/m
var index = "" + curpage + "/" + (maxpage > showpages ? showpages : maxpage) + "";
document.getelementbyid("pagingindex").innerhtml = index; //输出信息区域
function go(page) {
try {
//var page = document.getelementbyid("pagenav").value;
var url = '';
if (page > 0 && page <= showpages) {
page = maxpage - page + 1;
if (page <= 0 || page == maxpage) {
url = indexurl; ;
} else {
url = baseurl + '_' + page + '.shtml';
}
document.location.href = url;
return true;
} else if (page == maxpage) {
if (maxpage > showpages) {
url = baseurl + '_' + (maxpage - showpages + 1) + '.shtml';
} else {
url = baseurl + '_1.shtml';
}
document.location.href = url;
return true;
} else {
return false;
}
} catch (e) {
alert("sorry:" + e);
}
return false;
}
function changedisplaypagerlang(lang) {
jq("#pager_p").html(lang);
}