/** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */
 ;function postErrorChapter(o,e){$.ajax({type:"get",url:Hiturl,data:{action:"error",chapterid:o,bookid:e},success:function(o){var e="报送错误章节失败！";o==-1?e="报送错误章节过于频繁，请休息30秒后再执行此操作！":1==o&&(e="报送错误章节成功，我们会在2分钟以前尽快处理！"),alert(e)},error:function(o,e,t){}})}function clearCookies(o){var e=new Array,t=getCookie("booklist");if(null!=t&&void 0!=t&&t.length>0)for(var n=t.split(","),a=0;a<n.length;a++){var r=JSON.parse(unescape(n[a]));r.BookId!=o&&(e[r.BookId]=r)}saveBookcase(e)}function setCookie(o,e){var t=new Date;t.setDate(t.getDate()+365),document.cookie=o+"="+escape(e)+";expires="+t.toGMTString()+";path=/"}function getCookie(o){return document.cookie.length>0&&(c_start=document.cookie.indexOf(o+"="),c_start!=-1)?(c_start=c_start+o.length+1,c_end=document.cookie.indexOf(";",c_start),c_end==-1&&(c_end=document.cookie.length),unescape(document.cookie.substring(c_start,c_end))):""}function delCookie(o){var e=new Date;e.setTime(e.getTime()-1),getCookie(o),document.cookie=o+"=;expires="+e.toGMTString()}function delBook(o){confirm("确认从书架中删除此书吗？")&&(clearCookies(o),$("a[bookid='"+o+"']").parent().parent().remove())}function delAllBook(o){delCookie("bookinfo"),delCookie("bookid"),delCookie("booklist");var e=$("a[bookid]");void 0!=e&&null!=e&&0!=e.length&&e.each(function(){$(this).parent().parent().remove()})}function delBookFromBookcase(o){confirm("确认从书架中删除此书吗？")&&$.ajax({async:!1,type:"POST",url:"/DoBookcase.html",data:"action=delete&bookid="+o,dataType:"json",success:function(e){null!=e&&"undefined"!=typeof e.success&&1==e.success?(alert("已经成功将小说从书架删除！"),$("a[bookcaseid='"+o+"']").parent().parent().remove()):alert("将小说从书架删除失败！")}})}function addBookMarkByJs(o,e,t){var n={BookId:e,ChapterId:o,ChapterName:t},a=getBookcase();if(null!=a&&void 0!=a){var r=getBookcaseCount(a);a[e]=n,saveBookcase(a),r>10&&removeBookFromTop(r-10)}}function isLogin(){return getCookie("m_uid").length>0}function addBookMarkByManual(o,e,t){isLogin()?$.ajax({async:!1,type:"POST",url:"/DoBookcase.html",data:"action=addbookmark&bookid="+e+"&chapterid="+o+"&chaptername="+t,dataType:"json",success:function(o){null!=o&&"undefined"!=typeof o.success?alert(o.msg):alert("将小说添加到书架失败！")}}):(alert("登录成功后才可以使用书架功能！"),location.href="./login.html")}function addHistoryBookByManual2(o,e,t){var n={BookId:e,ChapterId:o,ChapterName:t},a=getBookcase();if(null!=a&&void 0!=a){var r=getBookcaseCount(a);a[e]=n,saveBookcase(a),r>10&&removeBookFromTop(r-10)}}function convertBookData(){var o=getCookie("bookinfo");if(null!=o&&void 0!=o){var e=o.split("§§");if(e.length>0)for(var t=0;t<e.length;t++){var n=e[t].split("||");3==n.length&&addHistoryBookByManual2(n[1],n[0],n[2])}delCookie("bookinfo")}}function getBookcase(){var o=new Array,e=getCookie("booklist");if(null!=e&&void 0!=e&&e.length>0)for(var t=e.split(","),n=0;n<t.length;n++){var a=JSON.parse(unescape(t[n]));o[a.BookId]=a}return o}function removeBookFromTop(o){var e=new Array,t=getCookie("booklist");if(null!=t&&void 0!=t&&t.length>0)for(var n=t.split(","),a=o;a<n.length;a++){var r=JSON.parse(unescape(n[a]));e[r.BookId]=r}saveBookcase(e)}function getBookcaseCount(o){var e=0;if(null!=o&&void 0!=o&&o.length>0)for(var t in o)e++;return e}function saveBookcase(o){if(null!=o&&void 0!=o&&o.length>0){var e="",t="";for(var n in o)e=e+","+n,t=t+","+escape(JSON.stringify(o[n]));e.length>0&&(e=e.substring(1)),t.length>0&&(t=t.substring(1)),setCookie("bookid",e),setCookie("booklist",t)}}function beforeBookCase(o){return!!isLogin()||(alert("登录成功后才可以使用书架功能！"),o.setAttribute("href","/user/auth/login.html"),!0)}null!=$(".cont")&&null!=$(".cont").html()&&$(".cont").html($(".cont").html().replace(/&amp;nbsp;/g,"<br />").replace(/\<br \/\>\s*(&nbsp;)+\<br \/\>/g,"<br />"));