var pp = window.location.hash.match(/pp(\d+)$/);
if (pp) {
pp = pp[1];
var link = window.location.href.match(/(.*\?)|(.*#)/);
link = link[0].replace(/[\?\#]+$/g, "");
if (window.location.search.match(/(^\?p=\d+)|(\&p=\d+)/)) {
var search = window.location.search.replace(/(\&pp=\d+)|(pp=\d+)/g, "");
link += search + "&pp=" + pp;
}
else if (link != "http://wech.site88.net/wp" && link != "http://wech.site88.net/wp/") {
var link = link.replace(/(\/post-page-\d+\/)|(\/$)/g, "");
link += "/post-page-" + pp + "/";
}
window.location.replace(link);
}
var pagepost_rpc = new PHPRPC_Client('http://wech.site88.net/wp/wp-content/plugins/pagepost/rpc.php', ['get_pagepost']);
pagepost_rpc.get_pagepost_callback = function (result, args, output) {
if (result instanceof PHPRPC_Error) {
alert(result.toString());
}
else {
setInnerHTML(document.getElementById('pagepost_' + args[0]), output);
}
}
function pagepost(id, curpage) {
if (typeof(event) == "undefined" || !event.shiftKey) {
var pagebar_loading = document.getElementById('pagebar_loading_' + id);
pagebar_loading.innerHTML = " Loading ...";
pagepost_rpc.abort();
pagepost_rpc.get_pagepost(id, curpage);
}
return true;
}