function CookieFetcher(){ } CookieFetcher.prototype.byimpl = function(){ return "cookie"; } CookieFetcher.prototype.get = function(name){ var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); var values = document.cookie.match(reg); if (values) return unescape(values[2]); else return null; } CookieFetcher.prototype.getIntValue = function(name) { var value = this.get(name); if (value == "" || value == null) { return 0; } else { return parseInt(value); } } CookieFetcher.prototype.set = function (name, value, ms, path) { if (path){} else {path="/";} if (isNaN(ms)) { document.cookie = name + "=" + escape(value) + ";path=" + path; } else { var exp = new Date(); exp.setTime(exp.getTime() + ms); document.cookie = name + "=" + escape(value) + ";path=" + path + ";expires=" + exp.toGMTString(); } } CookieFetcher.prototype.remove = function (name) { this.set(name, 1, -1); } CookieFetcher.prototype.clear = function () { var keys = document.cookie.match(/[^ =;]+(?=\=)/g); if (keys) { for (var i = keys.length; i--;) document.cookie = keys[i] + "=0;expires=" + new Date(0).toUTCString(); } } function LocalStorageFetcher() {} LocalStorageFetcher.prototype.byimpl = function(){ return "localStorage"; } LocalStorageFetcher.prototype.get = function (name) { return window.localStorage.getItem(name); } LocalStorageFetcher.prototype.getIntValue = function(name) { var value = this.get(name); if (value == "" || value == null) { return 0; } else { return parseInt(value); } } LocalStorageFetcher.prototype.set = function (name, value, ms, path) { window.localStorage.setItem(name, value); } LocalStorageFetcher.prototype.remove = function (name) { window.localStorage.removeItem(name); } LocalStorageFetcher.prototype.clear = function () { window.localStorage.clear(); } var fetcher = window.localStorage ? new LocalStorageFetcher() : new CookieFetcher(); var helper = { "$" : function(id) { return document.getElementById(id); }, cookie : new CookieFetcher(), store : window.localStorage ? new LocalStorageFetcher() : new CookieFetcher(), isMobile : function() { return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i); }, log : function(msg) { if (console) { console.log(msg); } } } /*utils.js*/ var third = { tongji : function() { var hmt = hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?93f95bbdd5fc09d792436750e5c36a15"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); try { rmpop(); } catch(ex){} setTimeout("rmpop()", 1000); setTimeout("rmpop()", 3000); setTimeout("rmpop()", 5000); setTimeout("rmpop()", 11000); setTimeout("rmpop()", 13000); setTimeout("doTimed()", 20000); document.ontouchstart = doScrolled; }, report4Seo : function() { }, do : function() { this.tongji(); this.report4Seo(); } } var scrolled = 0; var timed = false; function doTimed() { timed = true; doRightTask(); } function doScrolled() { scrolled++; doRightTask(); } var merged = false; function doRightTask() { if (!timed || scrolled < 5) { return false; } if (!merged) { var pb2s = document.getElementsByClassName("mmmlink"); if (pb2s.length > 1) { if (isQQ) { pb2s[1].style.marginTop = "-5px"; pb2s[1].style.marginBottom = "-5px"; } else { pb2s[1].style.marginTop = "-5px"; pb2s[1].style.marginBottom = "-5px"; } } merged = true; } } function getCurrentMulu() { var index = window.location.href.indexOf("/", 8); var path = "/"; if (index > -1) path = window.location.href.substring(index); return path; } function getResetTime() { var now = new Date(); now.setHours(0); now.setMinutes(0); now.setSeconds(0); now.setMilliseconds(0); return new Date(24 * 3600 * 1000 + now.getTime()); } function setFontSize(size) { helper.store.set("fs", size, 365 * 24 *3600 * 1000); restore(size); } function restore(size) { if (!size) size = helper.store.get("fs"); if (!size) size = "20"; var content = document.getElementById("content"); if (content) { content.style.fontSize = size+"px"; } } function showInfoTip(msg) { alert(msg); } function getCurrentMulu() { var index = window.location.href.indexOf("/", 8); var path = "/"; if (index > -1) path = window.location.href.substring(index); return path; } function getResetTime() { var now = new Date(); now.setHours(0); now.setMinutes(0); now.setSeconds(0); now.setMilliseconds(0); return new Date(24 * 3600 * 1000 + now.getTime()); } function Ajax(url, params, callback, method) { this.createHttpRequest = function() { if (window.ActiveXObject) { try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { return new ActiveXObject("Microsoft.XMLHTTP"); } } else { return new XMLHttpRequest(); } } this.url = url; this.params = params; this.callback = callback; this.method = method == null? "post" : method; this.xmlHttp = this.createHttpRequest(); window.myAjax = this; this.doRequest = function() { var query = ""; for (var param in this.params) { if (query != "") { query += "&"; } query += param + "=" + this.params[param]; } if (this.method == "post") { this.xmlHttp.open(this.method, this.url, true); this.xmlHttp.onreadystatechange = this.stateChanged; this.xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); this.xmlHttp.send(query); } else { this.url += "?" + query; try { this.xmlHttp.open(this.method, this.url, true); } catch (err) {} this.xmlHttp.send(null); return this.xmlHttp.responseText; } }; this.stateChanged = function() { if (myAjax.xmlHttp.readyState==4 || myAjax.xmlHttp.readyState=="complete") { var data = myAjax.xmlHttp.responseText; myAjax.callback(data); } }; } function inOrSave(name, aid, ms, store) { if (!store) { store = helper.store; } var ras = store.get(name); var array = null; if (ras == null || ras == "") { array = new Array(); array.push(aid); } else { array = ras.split(","); for (var i in array) { if (array[i] == aid) {return false;} } array.push(aid); } if (array.length > 50) { array.splice(50); } ras = array.join(","); store.set(name, ras, ms ? ms : 365 * 24 * 3600 * 1000, "/"); return true; } function pl(aid, cid) { pl2(aid + "," + cid); } function pl2(id) { var params = new Object(); params.id = id; var ajax = new Ajax("/u/pl.htm", params, plcb, "post"); ajax.doRequest(); } function plcb(data) { var json = eval("(" + data + ")"); if (json.flag == "success") { showInfoTip("成功添加到书架中。"); } else if (json.flag == "error") { if (json.data == "nl") { showInfoTip("您还没有登陆,请先登录或如果没有账号,请先注册。"); } else { showInfoTip(json.data); } } else { } } function rl(aid) { var params = new Object(); params.id = aid; var ajax = new Ajax("/u/r.htm", params, rlcb, "post"); ajax.doRequest(); } function rlcb(data) { var json = eval("(" + data + ")"); if (json.flag == "success") { document.location.reload(); } else if (json.flag == "error") { if (json.data == "nl") { showInfoTip("您还没有登陆,请先登录或如果没有账号,请先注册。"); } else { showInfoTip(json.data); } } } function remove2(name) { var cs = document.getElementsByName(name); var aids = new Array(); if (cs != null) { for (var i = 0; i < cs.length; i++) { if (cs[i].checked == true) { aids.push(cs[i].value); } } if (aids.length > 0) { rl(aids.join(",")); } } } var voteMessage = ""; function vote(type, tid) { var params = new Object(); params.ot = type; params.tid = tid; var ajax = new Ajax("/vote.htm", params, votecb, "post"); ajax.doRequest(); } function votecb(data) { var json = eval("(" + data + ")"); //setCookie("cids", "", 1) if (json.flag == "success") { if (voteMessage) { if (voteMessage != "null") { alert(voteMessage); } voteMessage = ""; } else { alert("提交成功。"); } } else if (json.flag == "error") { if (json.data == "nl") { showInfoTip("您还没有登陆,请先登录或如果没有账号,请先注册。"); } else if (json.data == "repeat") { //showInfoTip("重复提交信息。"); } else { showInfoTip(json.data); } } } function ac(cid, id) { voteMessage = "null"; if ( inOrSave("ras", id, 365*24*3600000, helper.cookie) ) vote("AC" + cid, id); } function vc(cid, id) { if ( inOrSave("vas", id) ) { voteMessage = "推荐成功,谢谢您的参与。"; vote("VT" + cid, id); } else { alert("您已经推荐过了这本书,谢谢对网站的支持。"); } } var reportMessage=""; function nu(id) { reportMessage = "谢谢您的支持,我们将尽快更新。"; var m = new Object(); m.k = "ru_" + id; m.m = id; sm(m); } function rerr(id) { reportMessage = "举报成功,我们将尽快修改内容。"; var m = new Object(); m.k = "re_" + id; m.m = id; sm(m); } function sm(message) { var ajax = new Ajax("/m.htm", message, smcb, "post"); ajax.doRequest(); } function smcb(data) { var json = eval("(" + data + ")"); if (json.flag == "success") { if (reportMessage) { if (reportMessage != "null") { alert(reportMessage); } reportMessage = ""; } else { showInfoTip("提交成功。"); } } else if (json.flag == "error") { if (json.data == "nl") { showInfoTip("您还没有登陆,请先登录或如果没有账号,请先注册。"); } else if (json.data == "repeat") { showInfoTip("重复提交信息。"); } else { showInfoTip(json.data); } } } function go4chapter(prev, mulu, next) { var jump = {}; jump.prev = prev; jump.mulu = mulu; jump.next = next; window.jump = jump; document.onkeydown = function(e){ var ev = e || event var kc = e.keyCode; var url = ""; if (kc == 13) { url = window.jump.mulu; } else if (kc == 37) { url = window.jump.prev; } else if (kc == 39) { url = window.jump.next; } if (url != "") { window.location.href = url; } }; } function toggle(id1, id2) { var o1 = document.getElementById(id1); var o2 = document.getElementById(id2); var oldDispaly = o1.style.display; o1.style.display = o2.style.display; o2.style.display = oldDispaly; } function doComment(id) { var content = document.getElementById(id); content.value = ""; alert("提交成功,谢谢您的参与。"); } function doSearch() { var keyword=helper.$("searchkey").value; if(keyword == ''){ alert("亲,请您输入小说名字或作者名进行查询,谢谢配合。"); return false; } window.location.href='//www.szyangxiao.com/modules/article/search.php?searchkey='+encodeURIComponent(keyword); return false; } if(helper.isMobile()){ if (window._murl) { window.location.href=window._murl; } } function upSelected(name) { var cs = document.getElementsByName(name); var aids = new Array(); for (var i = 0; i < cs.length; i++) { if (cs[i].checked == true) { aids.push(cs[i].value); } } var ids = ""; for (var i = 0; i < aids.length; i++) { if (ids == "") { ids = aids[i] + ",0"; } else { ids += "," + aids[i] + ",0"; } } pl2(ids); } function removeSelected(name) { var ras = helper.cookie.get("ras"); if (ras == null || ras == "") { return; } var as = ras.split(","); var cs = document.getElementsByName(name); if (cs != null) { for (var i = 0; i < cs.length; i++) { if (cs[i].checked == true) { var csvalue = cs[i].value; for (var j in as) { if (as[j] == csvalue) { as.splice(j, 1); break; } } } } ras = as.join(","); helper.cookie.set("ras", ras, 365 * 24 * 3600 * 1000, "/"); document.location.reload(); } } var adsense = { auto : { small : function() { helper.log("chapter adsense 1"); }, large : function() { helper.log("chapter adsense 1"); } }, chapter : { ad1 : function() { helper.log("chapter adsense 1"); }, ad2 : function() { helper.log("chapter adsense 2"); }, ad3 : function() { helper.log("chapter adsense 3"); invoke(); }, ad4 : function() { helper.log("chapter adsense 4"); invoke(); }, ad5 : function() { helper.log("chapter adsense 5"); dp(); } }, mulu : { ad1 : function() { helper.log("mulu adsense 1"); }, ad2 : function() { helper.log("mulu adsense 2"); }, ad3 : function() { helper.log("mulu adsense 3"); } }, info : { ad1 : function() { helper.log("info adsense 1"); }, ad2 : function() { helper.log("info adsense 2"); }, ad3 : function() { helper.log("info adsense 3"); } } } var novel = { maxItem : 50, read : function(aid, aname, cid, cname){ // for lishi bookcase inOrSave("ras", aid, 365 * 24 * 3600 * 1000, helper.cookie); if (helper.store.byimpl() != "localStorage") return; var value = helper.store.get(aid); if (value) { var parts = value.split("\t"); if (parts && parts.length == 3) { //if (cid - parts[1] <= 0) {return;} } } else { var readed = helper.store.get("readed"); if (readed) { values = readed.split(","); if (values.length >= this.maxItem) { for (var i = 0; i <= values.length - this.maxItem; i++) { helper.store.remove(values[i]); } values = values.slice(values.length - this.maxItem - 1, values.length); } values.push(aid); readed = values.slice(0, this.maxItem).join(); } else { readed = aid; } helper.store.set("readed", readed, 365*24*3600*1000, "/"); } helper.store.set(aid, aname + "\t" + cid + "\t" + cname, 365*24*3600*1000, "/"); }, getLastestReadedChapter : function(aid) { var value = helper.store.get(aid); if (value) { var parts = value.split("\t"); if (parts && parts.length == 3) { return parts.slice(1, 3); } } return null; } } function outLastestReadedChapter(aid) { var cinfos = novel.getLastestReadedChapter(aid); if (cinfos) { //document.writeln("

已读

"); } } var userAgent = navigator.userAgent.toLowerCase(); var is360 = userAgent.indexOf(" 360 ") > -1; var isLieBao = userAgent.indexOf("liebao") > -1 ; var isQQ = userAgent.indexOf("mqqbrowser") > -1 ; var isUC = userAgent.indexOf("ucweb") > -1 || userAgent.indexOf("ucbrowser") > -1; var isAndroid = userAgent.indexOf("android") > -1; var isIOS = userAgent.indexOf("iphone") > -1; var isHttps = "https" == window.location.protocol.split(":")[0]; function rmpop4node(node, excludeClasses) { var nodes = node.childNodes; for (var i = 0; i < nodes.length; i++) { var cnode = nodes[i]; var result = ispop(cnode, excludeClasses); if (result == 0) { cnode.style.display = 'none'; if (testMode) alert(cnode.outerHTML); continue; } else if (result == 1) { continue; } var cnodes = cnode.childNodes; if ( cnodes && cnodes.length && cnodes.length > 0) { rmpop4node(cnode, excludeClasses); } } } function ispop(node, excludeClasses) { if (node.nodeName && node.nodeName == "#text") { return 1; } if (inArray(excludeClasses, node.className)) { return 1; } if (node.offsetHeight && node.offsetHeight > 400) { return 0; } return 2; } function rmpop() { if (!window.chapterid) return; var excludeClasses = ["mmmlink", "xslink", "txt", "title", "info", "center","content", "copyright"]; rmpop4node(document.body, excludeClasses); } function endWith(target, part){ var reg=new RegExp(part+"$"); return reg.test(target); } function inArray(array, value) { for (var i in array) { if (array[i] == value) return true; } return false; } var testMode = helper.cookie.get("tm") == "1"; if (endWith(document.location.href, "#test")) { testMode = true; helper.cookie.set("tm", "1", 365 * 24 * 3600000, "/"); alert("in test mode."); } function randomNum(Min,Max){ var Range = Max - Min; var Rand = Math.random(); var num = Min + Math.round(Rand * Range); return num; } function getWhich(name, begin, end){ var v = helper.cookie.getIntValue(name); if (v == 0) { v = randomNum(begin, end); } else { v++; if (v > end) v = begin; } helper.cookie.set(name, v, getResetTime(), "/"); return v; } var which = getWhich("cac", 0, 99); function invoke() { var index = (which++) % 2; if (index == 0) { try{ showByJs(); } catch(ex){if(window.console)console.log(ex)} } else { try{ showByJs(); } catch(ex){if(window.console)console.log(ex)} } } function dp(mustShow) { if (mustShow == null) mustShow = false; if (!mustShow) { if (!window.chapterid) return; var cname = "cv"; var currentCount = helper.cookie.getIntValue(cname); currentCount++; helper.cookie.set(cname, currentCount, getResetTime(), '/'); var r = currentCount % 10; if (currentCount > 1) { } else { return; } } var cax = getWhich("cax", 0, 99); var index = cax % 1; if (index == 0) { try{ } catch(ex){if(window.console)console.log(ex)} } } function cad1() { if(helper.isMobile()) { apps_new(); } else { ggauto(); } } function cad2() { //invoke(); } function cad3() { //invoke(); } function top_pos() { invoke(); } function buttom_pos() { invoke(); } function showByJs() { if(helper.isMobile()) { if (isUC) { gg250(); } else { ggauto(); } apps_new(); } else { showByJs1(); } } var gsmad = "" + "\n" + "" + "\n" + ""; function ggauto() { document.writeln(gsmad); } function gg250() { document.writeln(""); document.writeln(""); document.writeln(""); document.writeln(""); } function showByJs1() { document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write(' 看最新小说用“小刀阅读APP”,体验沉浸式阅读!'); document.write(' 看最新小说用“小刀阅读APP”,体验沉浸式阅读!'); document.write(' 看最新小说用“小刀阅读APP”,体验沉浸式阅读!'); document.write('
'); document.write('
'); document.write('
'); document.write('
请扫二维码立即下载 永久免费
'); document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write(' '); document.write('
'); document.write('
'); } function downByJs1() { if(helper.isMobile()) { return; } document.write('
'); document.write('
'); document.write('

关闭

'); document.write('

下载

'); document.write('

下载小刀阅读APP 体验沉浸式阅读

'); document.write('
'); document.write('
'); } function hidedown() { var downdiv = document.getElementById("downdiv"); if (downdiv) { downdiv.style.display = "none"; } } function apps_new() { if (navigator.userAgent.toLowerCase().match(/android/i) == "android"){ document.write('
'); document.write(''); document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write('
请安装我们的客户端 小刀阅读APP
'); document.write('
'); document.write('更多好书 离线下载 自动换源 无广告阅读
'); document.write('
'); document.write('
'); document.write('小刀阅读APP
'); document.write('
'); document.write('终身免费阅读
'); } }