用hta实现制作的无殇 - 快书V1.1打包下载了

 更新时间:2007年11月10日 23:21:58   作者:  
用hta实现制作的无殇 - 快书V1.1打包下载了
<html>
<head>
<title>无殇 - 快书V1.1</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<HTA:APPLICATION ID="QuickBook"
ICON="book.ico"/>
<link rel="Shortcut Icon" href="book.ico">
<link rel="Bookmark" href="book.ico">
<style type="text/css">
<!--
BODY {
 BACKGROUND-COLOR: #d6d3cc;
 BORDER-RIGHT: #000000 0px outset;
 COLOR: #000000;
 FONT-SIZE: 9pt;
 LINE-HEIGHT: 14px;
 TEXT-DECORATION: none;
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 border:2 #cccccc solid;
 }
A:link {COLOR: red; TEXT-DECORATION: none;}
A:active {COLOR: red; TEXT-DECORATION: none;}
A:visited {COLOR: red; TEXT-DECORATION: none}
A:hover {COLOR: red; TEXT-DECORATION: none;}
TD {
    COLOR: #000000; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
.bu{
    BACKGROUND-COLOR: #f7f7f7; BORDER-BOTTOM: #999999 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #ffffff 1px solid; COLOR: #000000; FONT-SIZE: 9pt; HEIGHT: 20px; WIDTH:60px
}
.tx1{font-size:12px;border:1px solid;border-color:black black #000000;color: #0000FF}
.ta{
 border:solid 1px;border-color:#f6f6f6 #999999 #999999 #f6f6f6;background:#d6d3cc;
 margin-bottom: 2px;
}
a.
-->
</style>
<script>
var timeout=180;
var myurl="http://minhai.go1.icpcn.com/";
var myhome="http://minhai.ys168.com";
var myasp="http://minhai.8u3.8u.com/"
function err(a,b,c)
{
    if(a==1){
        if(confirm("程序出现未知错误,请联系:minkuwu@21cn.com!\n是否从网站下载最新版本?"))
        window.open(myhome);
        window.close();
    }else if(a==2){
        alert("下载目录失败,可能对方网站无法访问或本机网络无法连通,尝试下载新版本!");
        clearTime();
        bar(3);
    }else if(a==3){
        alert("找不到小说,请确认小说参数正确,如正确请尝试更新版本!");
        bar(4);
    }else{
        if(confirm("发生未知错误\n错误名称:"+a+"\n错误行数:"+c+"\n是否把错误发送到网上去,以便作者进行更新?"))
        window.open(myasp+"er.asp?name="+document.title+"&er="+a+"&c="+c);
    }
    return true;
}
window.onerror=err;
</script>
<body oncontextmenu='cl();return false'>
<COMMENT id="DownImg" style="behavior:url(GetFile.wsc);"></COMMENT>
<script src="Code.js" language="JavaScript"></script>
<center>需要帮助请按F1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;欢迎访问 《<a href="http://minhai.ys168.com">无殇主页</a>》<img src="close.jpg" height=12 onclick="this.parentNode.removeNode(true);"></center>
<table width='100%' border='0' cellpadding='0' cellspacing='0' class=ta>
<form name="ti" onsubmit="download();return false;">
<tr>
<td width="18%"><input type=button class=bu value="检查更新" onclick="getnew(document.title);"><input type=button class=bu value="软件测试" onclick="cheshi();"><br><input type=button class=bu style="width:120px;" value="报告错误或提交建议" onclick="sender();"></td>
<td width="38%">打&nbsp;&nbsp;开:<input class=tx1 type="text" onblur="this.value=checkpath(this.value,false);if(checkpath(this.value)!=''){newpath.value=checkpath(this.value,false);}" name="Folder" style="width:195" class="tx1"><input type=button class=bu value="打开路径" id=opf style="width:65" onclick='Folder.value=checkpath(BrowseFolder(),false);newpath.value=Folder.value'><br>另存为:<input class=tx1 type="text" name="newpath" style="width:195" class="tx1" onblur="this.value=checkpath(this.value,false);if(this.value=='') this.value=Folder.value;"><input type=button class=bu value="创建路径" style="width:65" onclick='if (checkpath(newpath.value,true)!="") alert("创建"+newpath.value+"完成");'></td>
<td width="44%">&nbsp;下载站点:
<select name="book" class=tx1 onchange="showsearch(this.value);">
<option value=1 selected>起点文学</option>
<option value=2>爬爬书库</option>
<option value=3>玄幻书殿</option>
<option value=4>思源中文</option>
<option value=5>79文学网</option>
<option value=6>虚拟天空</option>
<option value=7>梦想文学</option>
<option value=8>翠 微 居</option>
<option value=9>逐 浪 网</option>
</select> 文字编码:<select name=fan class=tx1><option value=0>保持原样</optioin><option value=1>繁 转 简</optioin><option value=2>简 转 繁</optioin></select><br>
&nbsp;HTML-->TXT<input type=checkbox onclick="if(this.checked){huan.checked=false;wap.checked=false;}divs();" name="txt">
HTML-->WAP<input type=checkbox onclick="if(this.checked){huan.checked=false;txt.checked=false;}divs();" name="wap">
文本替换器<input type=checkbox onclick="if(this.checked){wap.checked=false;txt.checked=false;}divs();" name="huan"></td>
</tr>
<tr><td colspan=2>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>搜索:书名:<input size="12" name="word" onkeydown="if(event.keyCode==13){sbu.click();return false;}" class=tx1> <input type="button" name="sbu" value="翠微居" class=bu> <select name="yi" class=tx1><option value=0>异步</option><option value=1>同步</option></select></td>
<td width=30%>
<input type="submit" name="Submit" class=bu value="下 载"> <input type="reset" id="ass" class=bu value="重 置" onclick="divr();">
</td>
</tr></table>
</td>
<td>&nbsp;下载超时:<input type=text name="cao" onfocus="this.select();" class=tx1 size=4 onblur="if(isNaN(this.value))this.value=timeout;else timeout=this.value;"> <input type=button value="获取网址参数" class=bu style="width:80px;" onclick="getch(document.all.book.value);"><input type=button value="显示网站小说" class=bu style="width:80px;" onclick="showxiao();"></td></tr>
<tr><td colspan=3 align=middle><font color=red>请输入小说参数:</font><span id="urldiv1"></span><input type=text class=tx1 size=6 name="url" onFocus="this.select();" onblur="var re=geturl(book.value);if(this.value.replace(re,'')!='') this.value=''" ondblclick="this.select();document.execCommand('paste');"><span id="urldiv2"></span></td></tr>
</form>
</table>
<form name="search" method="post" style="display:none;"><input type=text name="key"></form>
<table width='100%' border='0' cellpadding='0' cellspacing='0' class=ta id="tihuan" style="display:none;">
  <tr>
  <form name="th">
<td width='5%'>&nbsp;</td>
<td><font size=3 color=red><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;纯文本替换:</font>替换个数<input tpye=text class="tx1" value=1 size=3 onchange="if(!isNaN(this.value)) setid(this.value)" onfocus="this.select();"> 把HTML转换成TXT<input type=checkbox name="zhuan" onclick="if(this.checked){this.parentNode.children[1].value=0;dis(this.parentNode.children[3],1);setid(0);}else{dis(this.parentNode.children[3],0);}"><span style="display:none;">&nbsp;删除源文件<input type=checkbox name="yuan"></span></td>
<td>&nbsp;</td>
  </tr>
  <tr>
<td>&nbsp;</td>
<td>替换<b>1</b>:<textarea rows=7 cols=40 name="ti1" class="tx1"></textarea>成<textarea rows=7 cols=40 name="hu1" class="tx1"></textarea></textarea><br></td>
<td>正则替换:<input type=checkbox name="zenze"><br>全部替换:<input type=checkbox checked name="tihuan"><br>忽略大小写:<input type=checkbox name="da"></td>
  </tr>
  <tr>
<td>&nbsp;</td>
<td><center><input type=button onclick='if (obj.Folder.value!=""){tihu(obj.Folder.value,obj.newpath.value);}else{alert("请先打开欲替换的目录!");obj.opf.click();}' class=bu value="替 换"><input type=reset class=bu value="重 置"></center></td>
<td></td>
  </tr>
  </form>
</table>

<div id="show" style="display:'';">
<span id="menu"></span>
<table align="center" width="40%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000063" id="jin" style="display:none">
<tr>
<td bgcolor="#ffffff">
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="center"></td>
</tr>
<tr>
<td bgcolor="#ffffff" align="center"></td>
</tr>
</table>
<br>
<table align=center width='70%' border='0' cellpadding='0' cellspacing='1' bgcolor=#000000 style="display:none;">
<tr bgcolor=#ffffff>
<td align=center id="loading"></td>
<td align=center id="downer" style="display:none;"></td>
</tr>
</table>
</div>
<table align=center width='50%' border='0' cellpadding='0' cellspacing='1' bgcolor=#000000 id=cs style="display:'none'">
<tr bgcolor=#ffffff>
<td align=center>

</td>
</tr>
</table>
<script language="javascript" defer>
//初始化数据
String.prototype.getid=function(){return document.getElementById(this);}
var theFSO = new ActiveXObject("Scripting.FileSystemObject");
var ajax=new Array("Microsoft.XMLHTTP","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP");
var xmlhttp;
for(var i=0;i<ajax.length;i++)
try{xmlhttp = new ActiveXObject(ajax[i]);break;}catch(e){}
var adodbStream=new ActiveXObject("ADODB.Stream");
var rs=new ActiveXObject("ADODB.RecordSet");
//初始化全局变量
var obj=document.ti,m,newurl,cl1,cl2,ll,url1,url2,thelist="",downlist,dxing,thetime,der,there,newpic,stop=0,mdb,zhangting;
var zhen=new Array();

obj.book.onchange();

document.all.cao.value=timeout;

//开始下载
function download()
{
    if(document.all.url.value=="")
    {
        alert("请输入小说参数!");
        document.all.url.focus();
        return;
    }
    clearTime();
    dis("show",1);
    dis("menu",1);
    dis("jin",0);
    dis("loading",0);
    dis("show".getid().children[3],0);
    thelist="";
    "menu".getid().innerHTML="<table align=center width='50%' border='0' cellpadding='0' cellspacing='1' bgcolor=#000000><tr bgcolor=#ffff00><td align=center>正在下载小说目录……<font id='cshi' color=RED><\/span></td></tr></table>";
    setTimeout("downmenu();",10);
}
//下载目录
function downmenu()
{
    var fan=document.all.yi.value==0?true:false;
    cl1=null;cl2=null;
    if(fan)
    {
        if("cshi".getid()==null)return;
        "cshi".getid().innerText=timeout;
        clearTime();
        thetime=setInterval(function()
        {
            if("cshi".getid()==null || xmlhttp.readyState==0){clearTime();return;}
            if(xmlhttp.readyState<4)
            {
                if("cshi".getid().innerText==1)
                {
                    clearTime();
                    bar(5);
                }else
                "cshi".getid().innerText=parseInt("cshi".getid().innerText)-1;
            }else clearTime();
        },1000);
    }
    var str=gettxt(url1+document.all.url.value+url2,fan,function()
    {
        var thestr;
        if(xmlhttp.readyState<4)return;
        if(xmlhttp.readyState!=4){err(2);return;}
        bar(2);
        if(obj.book.value==9)
        setTimeout(function(){showmenu(gb2(xmlhttp.responseBody));},10);
        else
        setTimeout(function(){showmenu(gb(xmlhttp.responseBody));},10);
        return;
    },obj.book.value);
    if(!fan)
    {
        if(typeof(str)!="object"){err(2);return;}
        bar(2);
        setTimeout(function(){showmenu(str[0]);},10);
    }
}

function bar(id,color1,color2){
    var str,color1,color2;
    if(id==2)
    {
        str="处理小说目录中……";
        color1="#000000";
        color2="#00ff00";
    }else{
        str=id==3?"访问小说网站失败,无法连接!":id==4?"找不到小说!":"网络超时,对方网站未反应"
        color1="YELLOW";
        color2="#8C0000";
    }
    "menu".getid().firstChild.rows[0].cells[0].innerHTML="<font color="+color1+">"+str+"</font>";
    "menu".getid().firstChild.rows[0].bgColor=color2;
}

//显示小说目录
function showmenu(str)
{
    if(str==null || str==""){err(2);return;}
    var p,re,k=0,c=0;
    var mulu=new Array("<table align=center width='80%' border='0' cellpadding='0' cellspacing='1' class='ta'>");
    var list=new Array();
    newurl="";
    m="";
    switch(parseInt(obj.book.value))
    {
//起点中文
    case 1:
        m=cmfu(str);
        p=m.match(/title>(.*?)\s\-\-/i);
        var j,b,s="Object Not FoundHTTP\/1.1",i=1,r=/Object Not FoundHTTP\/1\.1|<TITLE>无法找到该页<\/TITLE>/,bb="6|8|2|7|5|1|3|4|9|10".split("|");
        newurl="http:\/\/newauthor6.cmfu.com\/books\/"+document.all.url.value+"\/"
        re=/<a.+?'(\d+)\.htm'[\s\S]+?>(.+?)<\/a>|<font color=black>(.+?)<\/font>/gi;
        if(p==null || p=="")
        {
            err(3)
            return;
        }
        var arr;
        mulu[mulu.length]=xiaomenu(p[1]);
        while (re.test(m))
        {
            if(RegExp.$3!="")
            {
                if(k==1){mulu[mulu.length]="<td width='25%'><\/td><\/tr>";k=0;}
                mulu[mulu.length]=xiaomenu1(RegExp.$3);
                j=RegExp.$3;
            }else{
                if(k==0) mulu[mulu.length]='<tr>';
                mulu[mulu.length]=xiaomenu2(c,RegExp.$1+"|"+j,RegExp.$2);
                c++;
                if(k==1) mulu[mulu.length]="<\/tr>";
                k=(k==1)?0:1
                if(b==null)
                {
                    while(r.test(s) && i++<10)
                    {
                        newurl=newurl.replace(/\d/,bb[i]);
                        s=gettxt(newurl+arr+".txt",false);
                        if(typeof(s)=="object")s=s[0];
                    }
                    b=i;
                }
            }
        }
    break;
//爬爬书库
    case 2:
        m=pap(str);
        newurl=url1+document.all.url.value+"\/"
        re = /<a\D+(\d+)\.htm[^>]+>(.+?)<\/a>|2px'>(.*?)<\/td>/gi;
        p=str.match(/<TITLE>(.*?)_目录_爬爬书库/i)
        mulu=themu(mulu,p,m,re);
    break;
//玄幻书殿
    case 3:
        zfile=null;
        str.replace(/(http:\/\/book\.xhsd\.net\/book\/\d*\/\d*\/)page\.js/,function(a,b){newurl=b;})
        str=gettxt(newurl+"page.js",false)
        if(typeof(str)!="object"){err(2);return;}
        eval(str[0].replace("var ",""))
        if(newurl=="" || newurl==null || zfile==null)
        {
            err(3);
            return;
        }
        m=xhm(zfile);
        m='<html>\r\n<head>\r\n<title>目录<\/title>\r\n<meta http-equiv="Content-Type" content="text/html; charset=gb2312">\r\n<style>\r\n.box{\r\nborder-collapse: collapse\r\n}\r\nbody {margin-top: 5px;}\r\ntd {\r\n    font-size: 9pt;\r\n}\r\n\r\na{\r\n    font-size: 9pt;\r\n    color: #000066;\r\n    text-decoration: none;\r\n}\r\n\r\na:link {\r\n    font-size: 9pt;\r\n    color: #000066;\r\n    text-decoration: none;\r\n}\r\na:visited {\r\n    font-size: 9pt;\r\n    color: #000000;\r\n    text-decoration: none;\r\n}\r\na:hover {\r\n    font-size: 9pt;\r\n    color: #FF0000;\r\n    text-decoration: underline;\r\n}\r\na:active {\r\n    font-size: 9pt;\r\n    color: #000000;\r\n    text-decoration: none;\r\n}\r\n\r\n<\/style>\r\n<\/head>\r\n<center>\r\n<BODY>\r\n<table width="760" border=1 cellpadding=2 cellspacing=0 bordercolor="#808080" bgcolor="white" class="box">\r\n<tr><td colspan="4" nowrap bgcolor="#808080">&nbsp;<font color="#FFFFFF"><b>目录<\/b><\/font><\/td><\/tr>\r\n'+m+'\r\n<tr><td colspan="4">\r\n<\/td>\r\n<\/tr>\r\n<\/table>\r\n<\/BODY><\/center><\/html>';
        list=list.concat(zfile)
        mulu[mulu.length]=xiaomenu(_name);
        for(var i=0;i<list.length-1;i+=2)
        {
            if(zfile[i]=="__")
            {
                if(k==1){mulu[mulu.length]="<td width='25%'><\/td><\/tr>";k=0;}
                mulu[mulu.length]=xiaomenu1(list[i+1]);
            }else{
                if(k==0) mulu[mulu.length]='<tr>';
                mulu[mulu.length]=xiaomenu2(c,list[i],list[i+1]);
                c++;
                if(k==1) mulu[mulu.length]="<\/tr>";
                k=(k==1)?0:1
            }
        }
    break;
//思源中文
    case 4:
        m=shim(str);
        p=m.match(/title>([^-]+)--/i)
        newurl=url1+document.all.url.value+"\/"
        re=/<a href="(\d+)\.htm">(.+?)<\/a>|vcss">[\r\n]+\s+(\S+)\s/gi;
        mulu=themu(mulu,p,m,re);
    break;
//79文学网
    case 5:
        m=mu79(str);
        newurl=url1+document.all.url.value+"\/"
        re = /<a href="(\d+)\.[^>]+>(.+?)<\/a>|<div id="NclassTitle">(.+?)<\/div>/gi;
        p=m.match(/<title>(.*?)<\/title>/i)
        mulu=themu(mulu,p,m,re);
    break;
//虚拟天空
    case 6:
        m=xkm(str);
        p=str.match(/<title>(.+?) - .*? - 虚拟天空/)
        newurl="http://www.xntk.com/book_j.php?tid="+document.all.url.value.split("\/")[0]+"&bid="+document.all.url.value.split("\/")[1]+"&cid=";;
        re=/<a\D+(\d+)\.htm>(.*?)<\/a>|max2'>(.*?)<\/td>/gi
        mulu=themu(mulu,p,m,re);
    break;
//梦想文学
    case 7:
        m=mx99(str);
        p=str.match(/title>(.*?)--/i)
        newurl=url1+document.all.url.value+"\/"
        re=/<a\D+(\d+)\.htm[^>]+>(.*?)<\/a>|=xt>(.*?)<\/td>/gi;
        mulu=themu(mulu,p,m,re);
    break;
//翠微居
    case 8:
        newurl=url1+document.all.url.value+"\/"
        p=str.match(/<title>(.*?)(?:\-[^\-]+)+<\/title>/i)
        m=cwm(str)
        re=/<a\D+(\d+)\.htm">(.+?)<\/a>|vcss">(.+?)<\/td>/gi
        mulu=themu(mulu,p,m,re);
    break;
//逐浪网
    case 9:
        newurl=url1+document.all.url.value+"\/"
        m=zhu(str);
        p=m.match(/<title>(.+?)\|.+?<\/title>/i)
        re=/<a href="(\d+)[^>]+>(.+?)<\/a>|bottomborder">(.+?)<\/li>/gi
        mulu=themu(mulu,p,m,re);
    break;
    default:err(1);return;
    }
    if(mulu==null)return;
    mulu[mulu.length]="<\/tr><tr><td colspan='2' align=center><input type=button onclick='xuan(1);' value='选中' class=bu style='width:30'> <input type=button onclick='xuan(2);' value='反选' class=bu style='width:30'> <input type=button onclick='chuanxuan(1);' value='全选' class=bu style='width:33'> <input type=button onclick='chuanxuan(2)' value='全反选' class=bu style='width:43'> <input type=button class=bu onclick=\"if(obj.Folder.value==''){alert('请先选择目录!');obj.opf.click();if(obj.Folder.value=='') return;}downxiao();\" value='下载小说' id='ddo' style='width:55;color:red'>下载目录<input type=checkbox checked name='xml'>下载图片<input type=checkbox checked name='dp'>图片异步下载<input type=checkbox checked name='picdown'><\/td><\/tr><\/table>"
    "menu".getid().innerHTML=mulu.join("");
    return;
}

function themu(mulu,p,str,re)
{
    var k=0,c=0;
    if(p==null || p=="")
    {
        err(3);
        return;
    }
    mulu[mulu.length]=xiaomenu(p[1]);
    while (re.test(str))
    {
        if(RegExp.$3!=""){
            if(k==1){mulu[mulu.length]="<td width='25%'><\/td><\/tr>";k=0;}
            mulu[mulu.length]=xiaomenu1(RegExp.$3);
        }else{
            if(k==0) mulu[mulu.length]='<tr>';
            mulu[mulu.length]=xiaomenu2(c,RegExp.$1,RegExp.$2);
            c++;
            if(k==1) mulu[mulu.length]="<\/tr>";
            k=(k==1)?0:1
        }
    }
    if(k==1) mulu[mulu.length]="<td width='25%'><\/td>";
    return mulu;
}

//开始下载章节
function downxiao(n)
{
    if(thelist==null || thelist=="")
    {
        alert("请至少选择一个章节!");
        return;
    }
    clearTime();
    if(n==null)
    {
        dis("menu",0);
        dis("jin",1);
        dis("show".getid().children[3],1);
        dis("loading",1);
        dis("downer",0);
        "loading".getid().innerHTML="";
        "downer".getid().innerHTML="";
        der=0;
        dxing=thelist;
        stop=0;
        downlist=thelist.split(",");
        document.body.oncontextmenu=function(){return false;}
        n=0;
        zhangting=new Array();
        jin.rows[0].cells[0].innerHTML='<table  border="0" width="0%" bgcolor="#000063"><tr><td width="100%" height="15" align="center"><font color="white"><b>0%<\/b><\/font><\/td><\/tr><\/table>'
        jin.rows[1].cells[0].innerHTML='0\/'+(thelist.split(',').length-1)
        jin.rows[2].cells[0].innerHTML='<input type=button name="zhan" class=bu value="暂停"><input type=button name="ting" class=bu value="停止">'
        oldtime=new Date().getTime();
        switch(parseInt(obj.book.value))
        {
            case 4:there=/<img src="([^"]+)"/gi;break;
            case 5:there=/<img src="([^"]+)"/gi;break;
            case 6:there=/<img src=([^>]+)/gi;break;
            case 7:there=/<IMG.+?src="([^"]+)"/gi;break;
            default:break;
        }
        document.all.zhan.onclick=function()
        {
            this.value=(stop===2)?"暂停":"继续";
            if(stop===0)
            {
                stop=2;
            }else{
                stop=0;
                switch(parseInt(zhangting[0]))
                {
                    case 0:downxiao(zhangting[1]);break;
                    case 1:downzhang(zhangting[1]);break;
                    case 2:editzhang(zhangting[1],zhangting[2],zhangting[3],zhangting[4]);break;
                    case 3:pic(zhangting[1]);break;
                    case 4:downpic(zhangting[1]);break;
                    case 5:adderr(zhangting[1],zhangting[2]);break;
                    case 6:downover(zhangting[1],zhangting[2]);break;
                    default:err(1);break;
                }
            }
        }
    }
    if(stop!==0)
    {
        if(stop==2)zhangting=new Array(0,n);
        return;
    }
    n++
    document.all.ting.onclick=new Function("downover("+n+",1);");
    if("loading".getid().innerHTML.split("<BR>").length>=15)
    {
        "downer".getid().innerHTML+="loading".getid().innerHTML;
        "loading".getid().innerHTML=""
    }
    "loading".getid().innerHTML+=((n==1)?"":"<br>")+"<span id='wang'>正在<\/span>下载 [ <font color=blue><b>"+menulist[downlist[n]].innerHTML.replace(/^<.*?>/,"")+"<\/b><\/font> ] <font id='cheng'>……<\/font><font id='caoshi' color='#E98D00'><\/font>";
    setTimeout("downzhang("+n+")",1);
}

function downzhang(n)
{
    if(stop!==0)
    {
        if(stop==2){zhangting=new Array(1,n);}
        return;
    }
    if(downlist==null)return;
    yan(downlist[n],0);
    var bo=document.all.book.value
    var p=checkpath(obj.Folder.value+document.all.xname.value+"--"+obj.book.options[obj.book.selectedIndex].text+"\\\\",true);
    newpic=new Array();
    if (bo==9 && n==1 && !document.all.txt.checked && !document.all.wap.checked)
    {
        try{
            SaveText(gettxt("http://www.zhulang.com/book.css",false)[0],p+"book.css");
        }catch(e){
            "loading".innerHTML+="<br>保存 [ <font color=#E98D00>风格文件<\/font> ] <font color=red>失败<\/font>!"
        }
    }
    if (n==1 && document.all.xml.checked)
    {
        try{
            SaveText(m,p+"index.htm");
            if(bo==4)
            SaveText(gettxt("http://book.syzw.cn/configs/article/page.css",false)[0],p+"page.css");
            else if(bo==7)
            SaveText('body\r\n{\r\nbackground-color:#E7F4FE\r\n}\r\n.zt{font-size:10.5pt;line-height:160%;font-family:"宋体","verdana","Arial","MS Sans Serif";}\r\n.m{padding-left:80px;padding-right:80px;TEXT-INDENT: 2em; FONT-FAMILY: 宋体;font-size:16px;LINE-HEIGHT: 130%;}\r\nP{TEXT-INDENT: 2em;}\r\n.b{background-color:#663366;font-size:12px;color:#ffffff;}\r\n.i{font-size:10pt;}\r\nA:link {COLOR: #004D00; TEXT-DECORATION: none}\r\nA:active {COLOR: blue; TEXT-DECORATION: underline}\r\nA:visited {COLOR: #004D00; TEXT-DECORATION: underline}\r\nA:hover {COLOR: blue; TEXT-DECORATION: underline;position:relative;left:1px;top:1px}',p+"css.css")
            else if(bo==8)
            SaveText('body {\r\n\tfont-family: 宋体,新细明体,Verdana,Arial,sans-serif;\r\n\tfont-size: 14px;\r\n}\r\n\r\na {\r\n\tcolor: #0A672E;\r\n\ttext-decoration: none;\r\n}\r\n\r\na:hover {\r\n\tcolor: #666666;\r\n}\r\n\r\nhr{\r\n\theight: 1px;\r\n\twidth: 100%;\r\n\tcolor: #000000;\r\n\tpadding: 0px;\r\n\tmargin: 0px;\r\n}\r\n#title{\r\n    text-align: center;\r\n\tfont-size: 16px;\r\n\tfont-weight: bold;\r\n\tline-height: 200%;\r\n}\r\n\r\n#content{\r\n    text-align: left;\r\n\tpadding: 10px 3% 10px 3%;\r\n\tfont-size: 16px;\r\n}\r\n\r\n.acss{\r\n    width: 90%;\r\n    text-align: left;\r\n\tbackground: #CBCDCC; \r\n}\r\n\r\n.vcss{\r\n\tfont-size: 16px;\r\n    background: #E0FFD7; \r\n    text-align: center;\r\n}\r\n\r\n.ccss{\r\n    font-size: 14px;\r\n    background: #EFFEE9; \r\n    width: 25%;\r\n\ttext-align: leftr;\r\n}\r\n\r\n#footlink{\r\n\ttext-align: center;\r\n\tline-height: 200%;\r\n}\r\n\r\n#info{\r\n\ttext-align: center;\r\n\tline-height: 200%;\r\n}',p+'page.css')
            else if(bo==6)
            SaveText('A {TEXT-DECORATION: none}\r\nA:link {COLOR: #333333}\r\nA:visited {COLOR: #a650; }\r\nA:hover {COLOR: #ff6600}\r\nBODY {SCROLLBAR-FACE-COLOR: #eeeeee; FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: #f0f0f0; SCROLLBAR-SHADOW-COLOR: #999999; COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #eeeeee; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #eeeeee; FONT-FAMILY: 宋体; SCROLLBAR-DARKSHADOW-COLOR: #eeeeee; TEXT-DECORATION: none}\r\nTD {FONT-SIZE: 9pt; COLOR: #333333; LINE-HEIGHT: 150%; FONT-FAMILY: 宋体}\r\n.min {font-family: \'宋体\';font-size: 10pt;}\r\n.middl{font-size : 14px;line-height: 18px}\r\n.max {font-family: \'宋体\';font-size: 12pt;font-weight: bold;}\r\n.max2 {font-family: \'宋体\';font-size: 10pt; background-color:\'#E3E3E3\'}',p+'2007.css');
            else if(bo==9){
            SaveText(gettxt("http://www.zhulang.com/css/layout.css",false)[0],p+"layout.css");
            SaveText(gettxt("http://www.zhulang.com/css/mulubook.css",false)[0],p+"mulubook.css");
            }
        }catch(e){
            "loading".innerHTML+="<br>保存 [ <font color=#E98D00>小说目录<\/font> ] <font color=red>失败<\/font>!"
        }
    }
    var downurl;
    if(bo==2 || bo==3 || bo==5)
        downurl=newurl+document.all.list[downlist[n]].value+".htm";
    else if(/[4789]/.test(bo))
        downurl=newurl+document.all.list[downlist[n]].value+".html";
    else if(bo==1)
        downurl=newurl+document.all.list[downlist[n]].value.split("|")[0]+".txt";
    else if(bo==6)
        downurl=newurl+document.all.list[downlist[n]].value
    else{
        err(1);return;
    }
    if(document.all.yi.value==0)
    {
        if("caoshi".getid()==null)return;
        "caoshi".getid().innerText=timeout;
        clearTime();
        thetime=setInterval(function()
        {
            if(stop===2){zhangting=new Array(7,this);clearTime();return;}
            if(stop===1 || "caoshi".getid()==null || xmlhttp.readyState==0){clearTime();return;}
            if(xmlhttp.readyState<4)
            {
                if("caoshi".getid().innerText==1)
                {
                    clearTime();
                    downover(n,3);
                }else
                "caoshi".getid().innerText=parseInt("caoshi".getid().innerText)-1;
            }else clearTime();
        },1000);
    }
    var str=gettxt(downurl,document.all.yi.value==0,function()
    {
        var thestr,r=xmlhttp.readyState;
        if(stop===1 || r<4)return;
        if(obj.book.value!=9)
        thestr=gb(xmlhttp.responseBody);
        else
        thestr=gb2(xmlhttp.responseBody);
        clearTime();
        if(r!=4 || thestr==null || thestr=="")
        {
            newpic=new Array();
            downover(n,2);
        }else{
            newpic=getpic(thestr,p,n);
            editzhang(thestr,n,newpic.length,p);
        }
        return;
    },obj.book.value);
    if(obj.yi.value==1)
    {
        if(typeof(str)!="object"){downover(n,2);return;}
        newpic=getpic(str[0],p,n);
        editzhang(str[0],n,newpic.length,p);
    }
}
//处理章节
function editzhang(str,n,l,path)
{
    var name,rre;
    clearTime();
    if(stop!==0)
    {
        if(stop==2)zhangting=new Array(2,str,n,l,path);
        return;
    }
    if(obj.book.value==6)
    {
        rre=/<script src=(http:\/\/\w+.cmfu\.com\/\/?books\/\d+\/\d+\.txt)><\/script>/i
        if(str.match(rre)!=null)
        {
            ss=gettxt(RegExp.$1,false);
            if(typeof(ss)=="object")
            str=str.replace(rre,ss[0].substring(16,ss[0].length-5))
        }
    }
    if(obj.fan.value!=0)str=convert(obj.fan.value,str);
    if(cl1==cl2 || cl2==null){cl1=null;cl2=null;}
    else if(cl1>cl2)cl1--;
    else cl1++;
    if(l!=0)str=str.replace(there,function(a,b){return "<img src='"+b.replace(/^.+\//,"")+"'";});
    switch(parseInt(obj.book.value))
    {
        case 1:
            str=cmf(str,document.all.list[downlist[n]],document.all.list[parseInt(downlist[n])+1],document.all.list[downlist[n]-1],downlist[n]);
            break;
        case 2:str=paf(str);break;
        case 3:str=xhf(str);break;
        case 4:str=shif(str);break;
        case 5:str=f79(str);break;
        case 6:str=xnf(str);break;
        case 7:str=mx9(str);break;
        case 8:str=cwf(str);break;
        case 9:str=zhuf(str);break;
        default:err(1);return;
    }
    if(obj.txt.checked)
    {
        str=txtf(str);
        h="txt";
    }else if(obj.wap.checked){
        str=wapf(str);
        h="wml";
    }else{
        h="htm"
    }
    if(obj.book.value==1)
    name=path+document.all.list[downlist[n]].value.split("|")[0]+"."+h;
    else
    name=path+document.all.list[downlist[n]].value+"."+h;
    try{
        SaveText(str,name);
        document.all.list[downlist[n]].checked=false
        dxing=dxing.replace(eval("\/,"+downlist[n]+"(,|$)\/"),"$1")
    }catch(hh){
        "loading".getid().innerHTML+"<br>保存 [ <font color=#E98D00>"+menulist[downlist[n]].innerHTML.replace(/^<.*?>/,"")+"<\/font> ] <font color=red>失败<\/font>!"
    }
    if(l==0){
        downover(n);
    }else{
        if(obj.yi.value==1)
        setTimeout(function(){pic(0);},10);
        else
        pic(0);
    }
}

//采集系统
function gettxt(url,f,onReady,b)
{
    xmlhttp.abort();
    try{
        if(f)
        xmlhttp.onreadystatechange = onReady;
        xmlhttp.open("GET",url,f);
        xmlhttp.send();
        if(f)return;
        if(xmlhttp.readyState!=4){return "f";}
        var str=new Array()
        if(b==9)
        str[0]=gb2(xmlhttp.responseBody);
        else
        str[0]=gb(xmlhttp.responseBody);
        xmlhttp.abort();
        return str;
    }catch(e){
        return "f";
    }
}

//判断是否有图片
function getpic(str,p,n)
{
    var bo=parseInt(obj.book.value);
    if(bo<4 || bo>7 || !document.all.dp.checked) return new Array();
    var arr,ss,re=new RegExp(there);
    while ((arr = re.exec(str)) != null)
    {
        if(bo==7)
        newpic.push("http://www.mx99.com"+arr[1])
        else if(bo==5)
        {
        if(arr[1].replace("front.gif","").length==arr[1].length)
        newpic.push("http://www.79wx.net"+arr[1])
        }else
        newpic.push(arr[1])
    }
    if(newpic.length>0)newpic.push(p,n)
    return newpic;
}

//采集图片
function pic(k)
{
    if(stop!==0)
    {
        if(stop==2)zhangting=new Array(3,k);
        return;
    }
    if(newpic[newpic.length-1]==jin.rows[1].cells[0].innerText.match(/(\d*)?\//)[1])return;
    var downobj="DownImg".getid();
    if(k>newpic.length-3)
    {
        downover(newpic[newpic.length-1])
        return;
    }
    adderr(0,newpic[k].replace(/^.*\//,""));
    if(document.all.picdown.checked)
    {
        if("caoshi".getid()==null)return;
        "caoshi".getid().innerText=timeout;
        clearTime();
        thetime=setInterval(function()
        {
            if(stop===2){zhangting=new Array(8,this);clearTime();return;}
            if(stop===1 || "caoshi".getid()==null || (downobj.Ready==0 && xmlhttp.readyState==0)){clearTime();return;}
            if((xmlhttp.readyState<4 && xmlhttp.readyState!=0) || (downobj.Ready<4 && downobj.Ready!=0))
            {
                if("caoshi".getid().innerText==1)
                {
                    clearTime();
                    downobj.Abort();
                    adderr(4)
                    pic(++k);
                }else
                "caoshi".getid().innerText=parseInt("caoshi".getid().innerText)-1;
            }else clearTime();
        },1000);
    }
    if(document.all.book.value!=6)
    {
        downpic(k);return;
    }else{
        downobj.DownImgOk = function()
        {
            if(downobj.Ready==4 && downobj.Data!=null)
            {
                try{
                    SaveFile(downobj.Data,newpic[newpic.length-2]+newpic[k].replace(/^.*\//,""));
                }catch(h){
                    adderr(2,h.description)
                }
            }else
                adderr(3);
            if(obj.yi.value==0)
            pic(++k);
            else
            setTimeout(function(){pic(++k);},10);
        }
        downobj.GetFile(newpic[k],document.all.picdown.checked);
    }
    return;
}

//下载图片
function downpic(k)
{
    if(stop!==0)
    {
        if(stop==2)zhangting=new Array(4,k);
        return;
    }
    try{
        for(var i=0;i<ajax.length;i++)try{xmlhttp = new ActiveXObject(ajax[i]);break;}catch(e){}
        xmlhttp.open("GET",newpic[k],document.all.picdown.checked);
        xmlhttp.onreadystatechange=function()
        {
            if(xmlhttp.readyState<4)return;
            var s=xmlhttp.responseBody;
            if(xmlhttp.readyState==4 && s!=null)
            {
                try{
                    SaveFile(s,newpic[newpic.length-2]+newpic[k].replace(/^.*\//,""))
                }catch(h){
                    adderr(2,h.description)
                }
            }else
                adderr(3);
            if(obj.yi.value==0)
            pic(++k);
            else
            setTimeout(function(){pic(++k);},10);
        }
        xmlhttp.send();
    }catch(e){
        adderr(1,"下载图片 [ <b>"+e.description+"<\/b> ] 失败, 放弃此项!");
        setTimeout(function(){pic(++k);},10);
    }
    return;
}

//下载图片出错
function adderr(id,text)
{
    if(stop!==0)
    {
        if(stop==2)zhangting=new Array(5,id,text);
        return;
    }
    var n;
    clearTime();
    if(id==4)retime(3);
    else if(id==3) retime(2);
    else retime();
    if(id==2) text="保存图片失败:[ <b>"+text+"<\/b> ], 放弃此项!"
    if(id==0)
    {
        n="<span id='wang'>正在<\/span>下载图片[ <font color=blue><b>"+text+"<\/b><\/font> ] <font id='cheng'>中……<\/font><font color=red id='caoshi'>"+timeout+"<\/font>"
    }else{
        n="<font color=red>"+text+"</font>"
    }
    "loading".getid().innerHTML+="<BR>"+n;
    return;
}

//结束章节
function downover(n,l)
{
    if(stop===2 && l!=1)
    {
        zhangting=new Array(6,n,l);
        return;
    }
    clearTime();
    if(n==jin.rows[1].cells[0].innerText.match(/(\d*)?\//)[1])return;
    var wid=parseInt((n/(downlist.length-1))*100),er,ee;
    if(wid>0)
    jin.rows[0].cells[0].children[0].width=wid+"%"
    jin.rows[0].cells[0].children[0].rows[0].cells[0].children[0].children[0].innerHTML=wid+"%"
    jin.rows[1].cells[0].innerHTML=n+"/"+(downlist.length-1)
    retime(l);
    if (n<(downlist.length-1) && l!=1)
    {
        downxiao(n)
    }else{
        if(l==null){cl1=null;cl2=null}
        stop=1;
        document.all.ting.disabled=true;
        document.all.zhan.disabled=true;
        "downer".getid().innerHTML+="loading".getid().innerHTML;
        ee="downer".getid().innerHTML.match(/\s+color=red/g);
        er=ee==null?0:ee.length;
        "loading".getid().innerHTML="<br><font color=blue>全部小说下载完毕!<\/font>下载文件:[ <font color=red>"+n+"<\/font> ] 个,"+(er>0?"<span style='BACKGROUND-COLOR: #000063;color:yellow;'>共有错误 [ "+er+" ] 个<\/span>,":"")+"共用时间:<font color=red>"+((new Date().getTime()-oldtime)/1000)+"<\/font>秒<br><input type=button class=bu value='返回目录' onclick='document.body.oncontextmenu=function(){cl();return false};dis(\"menu\",1);dis(\"jin\",0);dis(\"show\".getid().children[3],0);er=\"\";'> <input type=button class=bu value='查看过程' onclick='dis(\"loading\",0);dis(\"downer\",1);'>";
        "downer".getid().innerHTML+="loading".getid().innerHTML;
        thelist=dxing;
        dxing=null;
        downlist=null;
    }
}

function retime(l)
{
    var s;
    switch(l)
    {
        case 1:s="被停止";break;
        case 2:s="访问失败";break;
        case 3:s="下载超时";break;
        default:s="完成!";break;
    }
    if("wang".getid()==null)return;
    if("caoshi".getid()!=null)
    "caoshi".getid().removeNode(true);
    "wang".getid().removeNode(true);
    "cheng".getid().innerHTML="&nbsp;"+s;
    "cheng".getid().color=(l==null || l==1)?"GREEN":"RED";
    "cheng".getid().id='';
    return;
}

function clearTime(){
    try{clearInterval(thetime);}catch(e){}
    try{adodbStream.close();}catch(e){}
}

function xuan(l)
{
    if(cl1==null || cl1==="") return false;
    if(cl2==null || cl2==="")
    {
        if(l==1)
        document.all.list[cl1].checked=true;
        else
        document.all.list[cl1].checked=!document.all.list[cl1].checked;
        editlist(cl1);
        return false;
    }
    var r=((cl2>cl1)?cl2:cl1)+1;
    for(var i=(cl2>cl1)?cl1:cl2;i<r;i++)
    {
        if(l==1)
        document.all.list[i].checked=true;
        else
        document.all.list[i].checked=!document.all.list[i].checked;
        editlist(i);
    }
}

function chuanxuan(l)
{
    for(var i=0;i<document.all.list.length;i++)
    {
        if(l==1)
        document.all.list[i].checked=true;
        else
        with(document.all){list[i].checked=!list[i].checked;}
        editlist(i);
    }
}

function xiaomenu(name){
return "<tr bgcolor='blue'><td colspan='2' align=center><font color='yellow'><b>"+name+"<\/b><\/font><input type=hidden value='"+name+"' name='xname'><\/td><\/tr>"
}

function xiaomenu1(str){
return "<tr bgcolor='RED'><td colspan='2' align=center>"+str+"<\/td><\/tr>";
}

function xiaomenu2(c,id,str){
return '<td onclick="cl('+c+');" width="25%" id=menulist><input type=checkbox value="'+id+'" name="list" onclick="editlist('+c+')">'+str+'<\/td>';
}

//处理小说选中与消选
function editlist(id)
{
    if(isNaN(id)) return;
    if(document.all.list[id].checked)
        thelist+=","+id
    else
        thelist=thelist.replace(","+id,"")
}

//UTF编码转换
function gb(str)
{
    if(str==null)return;
    rs.Fields.Append("Data",201,1);
    rs.Open();
    rs.AddNew();
    rs("Data").AppendChunk(str);
    rs.Update();
    str=rs("Data").Value;
    rs.Close();
    return(str);
}

function gb2(str){
adodbStream=new ActiveXObject("ADODB.Stream");
adodbStream.Type = 2
adodbStream.Open
adodbStream.WriteText(str);
adodbStream.Position = 0
adodbStream.Charset = "UTF-8"
adodbStream.Position = 2
str =adodbStream.ReadText();
adodbStream.close
return str;
}

//搜索小说
function showsearch(id)
{
    var objform=document.search;
    var objinput=objform.getElementsByTagName("input");
    var l;
    while(objinput.length>1)
    objinput[1].removeNode(true);

    function getinput(name,value)
    {
        objform.onsubmit=function(){return true;}
        var newinput=document.createElement("input");
        newinput.type="hidden"
        newinput.name=name;
        newinput.value=value;
        objform.appendChild(newinput);
    }
    obj.sbu.onclick=function(){document.search.firstChild.value=document.all.word.value;document.search.submit();}
    switch(parseInt(id))
    {
    case 1:
        objform.action="http://sosu.cmfu.com/genius/searchbook.asp"
        getinput("s_class","Bl_name");
        objinput[0].name="s_book"
        obj.sbu.value="起点中文";
        url1='http://www.cmfu.com/readbook.asp?bl_id=';
        url2='';
        l=8;
        break;
    case 2:
        objform.action="http://www.3320.net/blib/f/search.php"
        getinput("act","1");
        objinput[0].name="skey";
        obj.sbu.value="爬爬书库";
        url1='http://www.3320.net/blib/c/read/';
        url2='/index.html';
        l=8;
        break;
    case 3:
        objform.action="http://www.xhsd.net/search.php"
        getinput("sort","1");
        objinput[0].name="keywords";
        obj.sbu.value="玄幻书殿";
        url1='http://www.xhsd.net/bookmenu.php?bid=';
        url2='';
        l=5;
        break;
    case 4:
        objform.action="http://www.syzw.cn/modules/article/search.php"
        getinput("searchtype","articlename");
        objinput[0].name="searchkey";
        obj.sbu.value="思源中文";
        url1='http://book.syzw.cn/files/article/htmlp/';
        url2='/index.html';
        l=8;
        break;
    case 5:
        objform.action="http://www.79wx.net/Book/Search.aspx"
        getinput("SearchClass","1");
        objinput[0].name="SearchKey";
        obj.sbu.value="79文学网";
        url1='http://www.79wx.net/Html/Book/';
        url2='/List.htm';
        l=5;
        break;
    case 6:
        objform.action="http://www.xntk.net/search.php"
        getinput("step","2");
        getinput("sch_area","0");
        getinput("asc","DESC");
        objinput[0].name="keyword";
        obj.sbu.value="虚拟天空";
        url1='http://www.xntk.com/htmpage/';
        url2='/content/index.htm';
        l=10;
        break;
    case 7:
        objform.action="http://www.mx99.com/Search_list.asp?action=Search&type=1"
        objinput[0].name="keyword";
        obj.sbu.value="梦想天空";
        url1='http://www.mx99.com/html/';
        url2='/Content.html';
        l=8;
        break;
    case 8:
        objform.action="http://www.cuiweiju.com/modules/article/search.php"
        getinput("searchtype","articlename");
        objinput[0].name="searchkey";
        obj.sbu.value="翠微居";
        url1='http://read.cuiweiju.com/files/article/html/';
        url2='/index.html';
        l=8;
        break;
    case 9:
        objform.action="http://www.zhulang.com/search.php"
        getinput("sType","a1");
        objinput[0].name="key";
        obj.sbu.value="逐浪网";
        obj.sbu.onclick=function(){document.charset="UTF-8";document.search.firstChild.value=document.all.word.value;document.search.submit();document.charset="GB2312";}
        url1='http://book.zhulang.com/';
        url2='/index.html';
        l=8;
        break;
    default:
        err(1);
        return;
    }
    dis("show",0);
    stop=1;
    clearTime();
    "urldiv1".getid().innerText=url1;
    "urldiv2".getid().innerText=url2;
    "url".getid().value="";
    document.all.url.size=l;
}

//纯文本替换
function tihu(path,newpath)
{
    if (confirm("是否确定对 [ "+path+" ] 进行替换?"))
    {
        if (!theFSO.FolderExists(newpath)){alert("路径不存在!请先创建路径!");return;}
        var z=document.all.zhuan.checked,y=document.all.yuan.checked,str,fileEx;
        if(z)
            fileEx=/\.(?:html|htm)$/;
        else
            fileEx=/\.(?:txt|html|htm)$/;
        var k=/\.txt$/;
        var theFiles = new Enumerator(theFSO.GetFolder(path).Files);
        var i,file,b=new Array();
        for(i=0;i<document.all.tags("textarea").length/2;i++)
        {
            try{
                b[b.length]=[eval("\/"+checkti(document.all.tags('textarea')[i*2].value,1,i)+"\/"+(reobj(document.th.tihuan,i).checked?'g':'')+(reobj(document.th.da,i).checked?'i':'')),checkti(document.all.tags('textarea')[i*2+1].value,2,i)];
            }catch(e){
                alert("替换错误:"+e.description+"\n\n请确认你的正则输入正确")
                return;
            }
        }
        if(!theFiles.atEnd())
        {
            theFiles.moveFirst();
            while (theFiles.atEnd()!== true)
            {
                filename=theFiles.item().name;
                if(fileEx.test(filename))
                {
                    file=theFSO.OpenTextFile(path+filename);
                    str=file.ReadAll();
                    file.close();
                    for(i=0;i<b.length;i++)
                    str=str.replace(b[i][0],b[i][1]);
                    if(z && !k.test(filename))
                    {
                        str=txtf(str);
                        filename=filename.replace(fileEx,".txt");
                    }
                        SaveText(str,newpath+filename);
                    if(z && y && !k.test(filename))
                    theFSO.DeleteFile(path+filename,true);
                }
                theFiles.moveNext();
            }
        }
    }
}

function checkti(s,b,k)
{
    if (!reobj(document.th.zenze,k).checked || b==2)
    {
        return s.replace(/[\\\/\.\?\*\+\|\$\^\(\)\[\]\{\}]/g,function(a){return "\\"+a;}).replace(/\r/g,"\\r").replace(/\n/g,"\\n");
    }else{
        return s;
    }
}
function reobj(tobj,k)
{
    if(tobj.length==null) return tobj;
        else return tobj[k];
}

//小说参数处理
function geturl(id)
{
    var re;
    if(/[1379]/.test(id))
    {
        re=/^\d*$/;
    }else if(/[24568]/.test(id)){
        re=/^\d*\/\d*$/;
    }else{
        err(1);
    }
    return re;
}

//检测路径是否正确,并创建不存在的路径
function checkpath(path,c)
{
    if (path==null || path=="") return "";
    path=path.replace(/\\\\/g,"\\").replace(/\t/g,"").replace(/\\$/,"").replace(/\\/g,"\\\\")+"\\\\"
    var dr=path.substring(0,path.search(/\\/))
    if (dr=="" || dr==null || dr.replace(/\w:/,"")!=""){alert("盘符错误!");return "";}
    if (/([\?\\\/\|\:"\\<>\t\r\n])/.test(path.substring(2,path.length).replace(/(\\|\/\/)/g,""))){alert("路径包含非法字符(? | < > : \ /)!");return "";}
    if(c)
    {
        var fp=path.substring(path.search(/\\/)+2,path.length-2).split("\\\\")
        for(var i=0;i<fp.length;i++)
        {
            dr=dr+"\\\\"+fp[i]
            if (!theFSO.FolderExists(dr)) theFSO.CreateFolder(dr);
        }
    }
    return path;
}

//设定替换个数
function setid(s)
{
    var theobj="tihuan".getid(),newRow,newCell
    while(s<theobj.rows.length-2)
    {
        theobj.rows[parseInt(s)+1].removeNode(true)
    }
    while(s>theobj.rows.length-2)
    {
        newRow=theobj.insertRow(theobj.rows.length-1)
        newCell=newRow.insertCell();
        newCell.innerText=" "
        newCell=newRow.insertCell();
        newCell.innerHTML='替换<b>'+(theobj.rows.length-2)+'<\/b>:<textarea rows=7 cols=40 name="ti" class="tx1"><\/textarea>成<textarea rows=7 cols=40 name="hu" class="tx1"><\/textarea>'
        newCell=newRow.insertCell();
        newCell.innerHTML='正则替换:<input type=checkbox name="zenze"><br>全部替换:<input type=checkbox checked name="tihuan"><br>忽略大小写:<input type=checkbox name="da"><br><br>'
    }
    for(var i=1;i<theobj.rows.length-2;i++)
    theobj.rows[i].cells[1].children[0].innerHTML="<b>"+getn(i,s)+"<\/b>"
}
function getn(n,l)
{
    var str=""
    for(var x=0;x<(l.toString().length-n.toString().length);x++)
    str+="0"
    return str+n;
}

//处理层关系
function divs()
{
    dis("tihuan",obj.huan.checked?1:0);
    obj.book.disabled=obj.huan.checked;
    if(obj.huan.checked)
        dis("show",0);
    else if("menu".getid().innerHTML!="")
        dis("show",1);
}

//层的显示与隐藏
function dis(o,l){if(typeof(o)!="object")o=o.getid();o.style.display=l==0?'none':'inline';}

//全部重置
function divr()
{
    var obj1=document.getElementsByTagName("input");
    var obj2=document.getElementsByTagName("textarea");
    while(obj1.length!=0)
    obj1[0].removeNode(true);
    while(obj2.length!=0)
    obj2[0].removeNode(true);
    window.location.reload();
}

//目录的选择
function cl(id)
{
    if(cl2!=null && cl2!="")
    {
        var r=((cl2>cl1)?cl2:cl1)+1
        for(var i=(cl2>cl1)?cl1:cl2;i<r;i++)
        yan(i)
        cl2=null;
    }
    if(cl1!=null && cl1!=="") yan(cl1)
    if(id==null || id===""){cl1=null;return;}
    if(ll!=1 || cl1==null || cl1==="")
    {
        cl1=id;
        yan(id,1)
    }else{
        cl2=id;
        var r=((cl2>cl1)?cl2:cl1)+1
        for(var i=(cl2>cl1)?cl1:cl2;i<r;i++)
        {
            yan(i,1)
        }
    }
}

function yan(id,l)
{
    menulist[id].style.backgroundColor=(l==1)?'#23B200':'';
    menulist[id].style.color=(l==1)?'blue':'';
}

//保存文本
function SaveText(str,path)
{
    var theFile = theFSO.CreateTextFile(path,true);
    theFile.Write(str.replace(/[\u0080-\u00a1\u00a9-\u00a9\u00ab-\u00ac\u00ae-\u00ae\u00b6-\u00b6\u00b8-\u00b8\u00bb-\u00bf\u00c2-\u00c7\u00cb-\u00cb\u00ce-\u00cf\u00d1-\u00d1\u00d4-\u00d6\u00d8-\u00d8\u00db-\u00db\u00df-\u00df\u00e3-\u00e7\u00eb-\u00eb\u00ee-\u00ef\u00f1-\u00f1\u00f4-\u00f6\u00f8-\u00f8\u00fb-\u00fb\u00ff-\u00ff\u0102-\u0111\u0114-\u0119\u011c-\u0129\u012c-\u0143\u0145-\u0147\u0149-\u014b\u014e-\u0169\u016c-\u01c0\u01c2-\u01cc\u01dd-\u0250\u0252-\u0260\u0262-\u02c6\u02c8-\u02c8\u02cc-\u02d8\u02da-\u0390\u03a2-\u03a2\u03aa-\u03b0\u03c2-\u03c2\u03ca-\u0400\u0402-\u040f\u0450-\u0450\u0452-\u200f\u2011-\u2012\u2017-\u2017\u201a-\u201b\u201e-\u2024\u2027-\u202f\u2031-\u2031\u2034-\u2034\u2036-\u203a\u203c-\u203d\u203f-\u20ab\u20ad-\u2102\u2104-\u2104\u2106-\u2108\u210a-\u2115\u2117-\u2120\u2122-\u215f\u216c-\u216f\u217a-\u218f\u2194-\u2195\u219a-\u2207\u2209-\u220e\u2210-\u2210\u2212-\u2214\u2216-\u2217\u2219-\u2219\u221b-\u221c\u2221-\u2222\u2224-\u2224\u2226-\u2226\u222c-\u222d\u222f-\u2233\u2238-\u223b\u223e-\u2247\u2249-\u224b\u224d-\u2251\u2253-\u225f\u2262-\u2263\u2268-\u226d\u2270-\u2294\u2296-\u2298\u229a-\u22a4\u22a6-\u22be\u22c0-\u2311\u2313-\u245f\u246a-\u2473\u249c-\u24ff\u254c-\u254f\u2574-\u2580\u2590-\u2592\u2596-\u259f\u25a2-\u25b1\u25b4-\u25bb\u25be-\u25c5\u25c8-\u25ca\u25cc-\u25cd\u25d0-\u25e1\u25e6-\u2604\u2607-\u2608\u260a-\u263f\u2641-\u2641\u2643-\u2fff\u3004-\u3004\u3018-\u301c\u301f-\u3020\u302a-\u3040\u3094-\u309a\u309f-\u30a0\u30f7-\u30fb\u30ff-\u3104\u312a-\u3191\u31a0-\u321f\u3244-\u327f\u329e-\u329e\u32a4-\u32a8\u32b1-\u338d\u3390-\u339b\u339f-\u33a0\u33a2-\u33c3\u33c5-\u33cd\u33cf-\u33d0\u33d3-\u33d4\u33d6-\u4dff\u9fa6-\udfff\ue865-\uf8f4\uf8f6-\uf8ff\ufa2e-\ufe2f\ufe32-\ufe32\ufe45-\ufe48\ufe53-\ufe53\ufe58-\ufe58\ufe67-\ufe67\ufe6c-\uff00\uff5f-\uffdf\uffe6-\uffff]/g,function(a){return "&#"+a.charCodeAt(0)+";";}));
    theFile.Close();
    return;
}

//保存文件
function SaveFile(str,path)
{
    adodbStream.Type=1;
    adodbStream.Open();
    adodbStream.write(str);
    adodbStream.saveToFile(path,2)
    adodbStream.close()
    return;
}

document.onkeydown=function()
{
    if(event.keyCode==16 && event.srcElement.tagName!="INPUT" && event.srcElement.tagName!="TEXTAREA")
    {
        ll=1;
        document.onselectstart=function(){return false;}
    }
    if (event.keyCode==112)
    {
        var mu="";
        if(!theFSO.FolderExists("help"))mu=myurl;
        window.showModalDialog(mu+"help/index.htm","","status:no;resizable:yes;dialogHeight:615px;dialogWidth:865px;unadorne:yes");
    }
}

document.onkeyup=function()
{
    if(event.keyCode==16)
    {
        ll=0;
        document.onselectstart=function(){return true;}
    }
}

//打开文件夹目录
function BrowseFolder()
{
    var Message = "清选择处理的文件夹";
    var Folder  = new ActiveXObject("Shell.Application").BrowseForFolder(0,Message,0x0040,0x11);
    if(Folder!= null)
    return Folder.items().item().Path;
}

//小说参数筛选
function getch(id)
{
    var a=new Array("20899","9/4464","2787","1/1035","0/250","1/2628","5455","19/19354","13191");
    var n=prompt("请输入小说的相关网址(如,目录网址,某章节网址),如:",url1+(a[id-1])+url2);
    if(n==null || n=="")return;
    if(/\/(\w+\/\d+)\/\d+\.html?$/.test(n)) n=RegExp.$1;
    else if(/(\d+)&bid=(\d+)/.test(n)) n=RegExp.$1+"\/"+RegExp.$2;
    else if(/(\d+)$/.test(n)) n=RegExp.$1;
    else if(/read\/(\d+\/\d+)\/\d+\.html$/.test(n)) n=RegExp.$1;
    else if(/(\d+)\/\d+\.html$/.test(n)) n=RegExp.$1;
    else if(/\d+\/(\d+)\/\d+\.htm$/.test(n)) n=RegExp.$1;
    else if(/(\d+\/\d+)\/\d+\.html$/.test(n)) n=RegExp.$1;
    else if(/\/(\d+\/\d+)\//.test(n)) n=RegExp.$1;
    else if(/\/(\d+)\//.test(n)) n=RegExp.$1;
    else n="";
    if(n=="")
    alert("网址不匹配!");
    else
    document.all.url.value=n;
    document.all.url.focus();
}

//检查新版本
function getnew(name){
var str=gettxt(myurl+"look.txt?"+new Date()+name.replace(/(\d\.\d)/,''),false);
if(typeof(str)!="object"){alert("无法连接上更新网站,请确认网络连接正常!");return;}
else
str=str[0];
if(str==""){alert("无法检查到版本数据!");return;}
str=str.split("|");
if(Number(RegExp.$1)<Number(str[0]))
{
    if(confirm("你的软件版本过旧,有新的版本:[ "+name.replace(/(\d\.\d)$/,'')+str[0]+" ],是否下载?"))
    window.open(str[1])
}else
alert("你当前的版本为最新版!");
}

function showxiao(l)
{
    var str;
    if(mdb==null)
    {
        if(l==null)
        {
            str=gettxt(myurl+"xiao.js",false);
            if(typeof(str)=="object" && !/<title>/i.test(str[0])){str=str[0];}else{showxiao(0);return;}
        }else{
            str=gettxt(myasp,false);
            if(typeof(str)=="object" && !/<title>/i.test(str[0])){str=str[0];}else{alert("网络连接错误!请确认网络正确?如果正常则请下载新版本或者联系作者!QQ:2322675");return;}
        }
        try{
        eval(str.replace(/function list\([\s\S]+$/,""));
        }catch(e){
            alert("下载小说数据失败,请重试!");
        }
    }
    var n;
    switch(parseInt(document.all.book.value))
    {
        case 1:n=5;break;
        case 2:n=6;break;
        case 3:n=7;break;
        case 4:n=8;break;
        case 5:n=9;break;
        case 6:n=10;break;
        case 7:n=11;break;
        case 8:n=13;break;
        case 9:n=12;break;
        default:n=0;break;
    }
    if(n==0)return;
    var y=window.showModalDialog("show.htm",new Array(mdb,n,document.all.book.options[document.all.book.selectedIndex].text,document.search.getElementsByTagName('input')[0].value),"status:no;resizable:yes;dialogHeight:400px;dialogWidth:450px;unadorne:yes");
    if(y!=null && y!="")
    {
        document.all.url.value=y;
    }
}

function cheshi(){
    if(document.getElementById("cs").style.display!="none")return;
    if(!confirm("软件测试指的是对本软件各个下载网站进行下载测试,看看各个网站是否因为更新而与本软件产生冲突,测试过程可能需要几分钟,如果你下载的小说正常,则不必要进行测试!请问你确定要进行软件测试吗?"))return;
    var a,obj=document.getElementById("cs"),b=new Array(
        ["起点目录","http://www.cmfu.com/readbook.asp?bl_id=20899",cmfu,36335],
        ["起点章节","http://newauthor7.cmfu.com/books/20899/552946.txt",function(str){return str;},151],
        ["爬爬目录","http://www.3320.net/blib/c/read/9/4464/index.html",pap,55653],
        ["爬爬章节","http://www.3320.net/blib/c/read/9/4464/6268.htm",paf,2821],
        ["玄幻目录","http://book.xhsd.net/book/10/2787/page.js",function(a){return a;},4905],
        ["玄幻章节","http://book.xhsd.net/book/10/2787/1.htm",xhf,781],
        ["思源目录","http://book.syzw.cn/files/article/htmlp/1/1035/index.html",shim,20402],
        ["思源章节","http://book.syzw.cn/files/article/htmlp/1/1035/184011.html",shif,1340],
        ["79目录","http://www.79wx.net/Html/Book/0/250/List.htm",mu79,22200],
        ["79章节","http://www.79wx.net/Html/Book/0/250/39711.htm",f79,6144],
        ["虚拟目录","http://www.xntk.com/htmpage/1/2628/content/index.htm",xkm,13264],
        ["虚拟章节","http://www.xntk.com/book_j.php?tid=1&bid=2628&cid=1",xnf,1070],
        ["梦想目录","http://www.mx99.com/html/5455/Content.html",mx99,63571],
        ["梦想章节","http://www.mx99.com/html/5455/167686.html",mx9,2250],
        ["翠微目录","http://read.cuiweiju.com/files/article/html/19/19354/index.html",cwm,17894],
        ["翠微章节","http://read.cuiweiju.com/files/article/html/19/19354/1357597.html",cwf,1039],
        ["逐浪目录","http://book.zhulang.com/13191/index.html",zhu,19322],
        ["逐浪章节","http://book.zhulang.com/13191/390402.html",zhuf,1215]
        );
    a=showall(true)
    obj.rows[0].cells[0].innerText="测试过程暂停一切软件活动,完成后恢复……"
    dis(obj,1)
    setTimeout(function(){cheshi1(a,b,obj,0,"")})
}

function cheshi1(a,b,obj,id,e)
{
    var o=obj.rows[0].cloneNode(true);
    obj.children[0].appendChild(o);
    obj.rows[obj.rows.length-1].cells[0].innerText="测试"+b[id][0]+"……";
    str=gettxt(b[id][1],true,function(){
        var thestr,r=xmlhttp.readyState;
        if(r<4)return;
        if(id>15)
        cheshi2(a,b,obj,id,e,gb2(xmlhttp.responseBody));
        else
        cheshi2(a,b,obj,id,e,gb(xmlhttp.responseBody));
    })
}

function cheshi2(a,b,obj,id,e,str)
{
    var o=obj.rows[obj.rows.length-1].cells[0],len;
    if(str==null)
    {
        e+=b[id][0]+"连接";
        o.innerHTML+="<font color=red>连接失败<\/font>"
    }else{
        len=b[id][2](str).length-b[id][3];
        if(len<5 && len>-5)
        {
            o.innerHTML+="<font color=blue>长度正常<\/font>"
        }else{
            e+=b[id][0]+"长度";
            o.innerHTML+="<font color=red>长度错误<\/font>"
            /*
            var theFile = theFSO.CreateTextFile("e:\\"+b[id][0]+".htm",true);
            theFile.Write(b[id][2](str));
            //theFile.Write(str);
            theFile.Close();
            */
        }
    }
    if(id!=b.length-1)
    setTimeout(function(){cheshi1(a,b,obj,++id,e);},1)
    else{
        if(e!="")
        {
            if(confirm("测试出现错误,是否提交到网站上去,以便软件进行更新?"))
            sender(e);
        }else{
            alert("测试结束,各个网站下载正常!")
        }
        var oo=document.getElementById("cs");
        while(oo.rows.length!=1)
        oo.rows[1].removeNode(true);
        dis(oo,0)
        showall(false,a);
    }
    return;
}

function sender(e)
{
    if(e==null)
    var str=prompt("请输入你的建议或者错误说明!","有什么地方出错?还是你有什么建议?");
    else
    str=e;
    if(str!=null && str!="")
    window.open(myasp+"er.asp?name="+str+"&id=0&title="+document.title)
}

function showall(id,c)
{
    var obj=document.ti.children;
    var a=new Array(),b=new Array("show","tihuan","yi","book","fan");
    for(var i=0;i<obj.length;i++)
    {
        if(id)
        a[i]=obj[i].disabled;
        obj[i].disabled=id?true:c[i];
    }
    for(var i=0;i<b.length;i++)
    {
        if(id)
        a[b[i]]=b[i].getid().style.display;
        b[i].getid().style.display=id?"none":c[b[i]];
    }
    return a;
}

//所有文本正则处理

//起点目录
function cmfu(str)
{
    str=str.replace(/^[\s\S]{1,100}<html>/i,'<html>');
    str=str.replace(/<title>(.+?)\/(.+?)\/.+?<\/title>/,'<title>$1 -- $2<\/title>');
    str=str.replace(/include\/|<META\sN[\s\S]+?t">\r\n/g,'');
    str=str.replace("<br>",'');
    str=str.replace(/<script[\s\S]+?<\/script>\r\n/g,'');
    str=str.replace(/<iframe[\s\S]+?<\/iframe>/i,'');
    str=str.replace(/<table[\s\S]+?<\/table>(?:\r\n)+<br>\r\n/,'');
    str=str.replace(/[^>]*<a.+?&nbsp;/i,'');
    str=str.replace(/(?:&nbsp;){3}\[.*?\]/g,'<\/font>');
    str=str.replace(/<!--d:\d+-->[\s\S]+?<br><br>/i,'');
    return str.replace(/javascript:gotopage\((\d+)\)/g,'$1.htm');
}

//爬爬目录
function pap(str){
    str=str.replace(/<META.*\n/g,'');
    str=str.replace(/javascript:gotozhj\((\d*)\)/gi,'$1.htm');
    str=str.replace(/<script[\s\S]+?<\/script>\r\n/gi,'');
    str=str.replace(/<center>[\s\S]+?id=ad2.*\n.*\n/i,'');
    str=str.replace(/<BR>[\s\S]+?<\/table>[\s\S]+?<\/table>\r\n/,'');
    str=str.replace(/\t*<td.*?bk1.*\n/g,'');
    str=str.replace(/_目录[^<]*/,'');
    str=str.replace(/<LINK.*\n/,'');
    return str.replace("TEXT-DECORATION: underline }",'TEXT-DECORATION: underline }\r\nTD {FONT-SIZE: 9pt; COLOR: #06131c; FONT-FAMILY: "宋体"}\r\nA:link {COLOR: #000000; TEXT-DECORATION: none}\r\nA:visited {COLOR: #000000; TEXT-DECORATION: none}\r\nA:hover {COLOR: #3300FF; TEXT-DECORATION: none}')
}

//翠微居目录
function cwm(str){
    str=str.replace(/\-[^<]+/,'');
    str=str.replace(/\/>[\r\n]*<meta[\s\S]+室" \/>/,'\/>');
    str=str.replace(/http:.+?e\//,'');
    str=str.replace(/var a.+[\r\n]*.+\n/,'');
    str=str.replace(/<div (?:id|align)="[^ti].+?<\/div>(?:<hr \/>)?/gi,'');
    str=str.replace(/<div>.+?<\/div>/i,'');
    str=str.replace(/\r?\n/gi,'\r\n');
    str=str.replace(/<\/html>[\r\n]+<script>[\s\S]+/i,'<\/html>');
    return str.replace(/\.html/gi,'.htm');
}

//玄幻书殿目录
function xhm(zfile)
{
    var i=0
    var nn=0
    var lin=0
    var m="";
    while(zfile[i]!="_END_")
    {
        m=m+"<tr bgcolor=#FFFFFF>";
        for(nn=1;nn<5;nn++)
        {
            if (zfile[i]=="_END_")
            {
                if(nn==1)
                break;
                else
                m=m+"<td>&nbsp;</td>";
            }else{if (zfile[i]=="__"){
                if(nn==1)
                {
                    m=m+"<td colspan=4  align=center><b>";
                    m=m+zfile[i+1];
                    m=m+"</b></td>";
                    nn=5;
                    i+=2;
                }else{
                    m=m+"<td>&nbsp;</td>";
                }
            }else{
                m=m+"<td><a href="+zfile[i]+".htm><font color=#0066AA>";
                m=m+zfile[i+1];
                m=m+"</font></a></td>";
                i+=2;
            }
        }
    }
    m=m+"</tr>"}
    return m;
}

//思源中文目录
function shim(str)
{
    str=str.replace(/<title>([^|]+)\|\1在线阅读\|作者:/,'<title>$1--');
    str=str.replace(/\-[^-]+\-思源中文网/,'--无殇快书');
    str=str.replace(/<meta n[\s\S]+?com" \/>\r\n/,'');
    str=str.replace(/<div[^>]+><script.+?<\/div>[\r\n]+/gi,'');
    str=str.replace(/[\r\n]+<hr \/>[\s\S]+?<hr \/>/i,'');
    str=str.replace("http://book.syzw.cn/configs/article/",'');
    str=str.replace(/\.html/gi,'.htm');
    return str;
}

//79文学网目录
function mu79(str)
{
    str=str.replace(/.+\n.+\n/,'<html>');
    str=str.replace(/\s\-\s79[^<]+/,'');
    str=str.replace(/<m[\s\S]+?T" \/>\r\n/,'');
    str=str.replace(/<meta n[\s\S]+网" \/>\r\n/,'');
    str=str.replace(/\/Skin\/Default\/Css\//gi,'');
    str=str.replace(/<div id="Top">[\s\S]+?<\/div>\r\n\t<\/div>\r\n/,'');
    str=str.replace(/<table width="7[\s\S]+?<\/table>/gi,'');
    str=str.replace(/<\/html>[\s\S]+/i,'<\/html>');
    str=str.replace(/<script[\s\S]+?<\/script>\r\n/gi,'');
    str=str.replace(/\&nbsp;.+?】/gi,'');
    return str;
}

//虚拟天空目录
function xkm(str)
{
    str=str.replace(/<!--[\s\S]+?--> +\r\n/,'');
    str=str.replace(" -  - 虚拟天空","")
    str=str.replace(/<table[\s\S]*?noshade><br>/i,"")
    str=str.replace(/<meta.*空">\r\n/gi,"")
    str=str.replace(/<!--[\s\S]*?<hr WIDTH=760 >/i,"")
    str=str.replace(/\/book_j\.php\?bid=\d+&tid=\d+&cid=(\d+)/gi,'$1.htm');
    return str.replace(/\/css\/css/,"2007");
}

//梦想文学目录
function mx99(str){
str=str.replace(/.*\n/,'');
str=str.replace(/--梦想小[^<]+/,'');
str=str.replace(/<META.*\n.*\n/,'');
str=str.replace(/\.(style3|xt|input1)[\s\S]*?\}\r\n/g,'');
str=str.replace(/<script[\s\S]+?<\/script>(?:\r\n)*/gi,'');
str=str.replace(/<tr[\s\S]*?<\/tr>\r\n/i,'');
str=str.replace(/<iframe[^>]*>/i,'');
str=str.replace(/(\d+)\.html/gi,'$1.htm');
return str.replace(/(?:&nbsp;){3}.*?\]/gi,'');
}

//逐浪网目录
function zhu(str){
    str=str.replace(/.+\n.+\n/,'<html>');
    str=str.replace(/\|[^|]+\|[^|]+?</,'<');
    str=str.replace("utf-8",'GB2312');
    str=str.replace(/http.+?s\//gi,'');
    str=str.replace(/<script[\s\S]+?<\/div>\r\n\r\n\t+/i,'<body>');
    str=str.replace(/<!\-\-[\s\S]+/i,'<\/body><\/html>');
    str=str.replace(/http:\/\/book\.zhulang\.com\/\d+\//gi,'');
    str=str.replace(/\s\[\s<a.+?\]\s/gi,'');
    str=str.replace(/\.html/gi,'.htm');
    return str;
}

//HTML转TXT
function txtf(str)
{
var str=str.replace(/<head>[\s\S]*?<\/head>/gi,"");
str=str.replace(/<style.*?>[\s\S]*?<\/style>/gi,"");
str=str.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");
str=str.replace(/<!\-\-[\s\S]*?\-\->/g,"");
str=str.replace(/<div.*?>/gi,"<br>");
str=str.replace(/<(tr|form).*?>/gi,"<br>");
str=str.replace(/\t/g," ");
str=str.replace(/\r\n {1,}/g,"");
str=str.replace(/ {1,}\r\n/g,"");
str=str.replace(/ {1,}/g," ");
str=str.replace(/\r|\n/g,"");
str=str.replace(/<br(?: \/)?>/gi,"\r\n");
str=str.replace(/&nbsp;&nbsp;/g," ");
str=str.replace(/(?:<\/p>)?<p[^>]*?>/gi,"\r\n\r\n");
str=str.replace(/<\/p(?: \/)?>/gi,"\r\n\r\n");
str=str.replace(/<.*?>/g,"");
str=str.replace(/&nbsp;/g," ");
str=str.replace(/&quot;/g,'"');
str=str.replace(/&#39;/g,"'");
str=str.replace(/&lt;/g,"<");
str=str.replace(/&amp;/g,"&");
str=str.replace(/\r\n +\r\n/g,"\r\n\r\n");
str=str.replace(/[\r\n]+/g,"\r\n\r\n");
str=str.replace(/^[\r\n\s]{1,}/,"")
return str.replace(/\&gt;/g,">");
}

//HTML-->WAP

function wapf(str)
{
str=txtf(str);
str=str.replace(/ /g,"&nbsp;")
str=str.replace(/\r\n/g,"\r\n<br \/>");
str=str.replace(/<br \/>\r\n<br \/>/g,"<p><\/p>\r\n")
return '<?xml version="1.0" encoding="gb2312"?> \r\n<wml>\r\n<head>\r\n<meta http-equiv="Cache-control" content="max-age=0" \/>\r\n<\/head>\r\n<card title="http:\/\/i.6to23.com"><p>'+str+'<\/p><\/card><\/wml>';
}

//起点中文文章
function cmf(str,j,d,u)
{
str=str.substr(16).replace(/'\);[\r\n\s]+$/,"");
str='<html>\r\n<head>\r\n<title>'+j.value.split("|")[1]+' '+j.parentNode.innerText+'<\/title>\r\n<META HTTP-EQUIV="Content-Type" CONTENT="text\/html; charset=gb2312">\r\n<link rel="stylesheet" href="main.css" type="text\/css">\r\n<script language=javascript>\r\ndocument.onkeydown=nextpage\r\nvar prevpage="'+(u?u.value.split("|")[0]:"index")+'.htm"\r\nvar nextpage="'+(d?d.value.split("|")[0]:"index")+'.htm"\r\nvar bookpage="index.htm"\r\nfunction nextpage(event) {\r\n\tevent = event ? event : (window.event ? window.event : null); \r\n\tif (event.keyCode==13) location=bookpage\r\n\r\n\tif (event.keyCode==37) location=prevpage\r\n\r\n\tif (event.keyCode==39) location=nextpage\r\n}\r\n<\/script>\r\n<style>\r\n        <!--\r\n        .skin0\r\n        {\r\n                position:absolute;\r\n                width:120px;\r\n                border:1px solid black;\r\n                background-color:menu;\r\n                font-family:Verdana;\r\n                cursor:default;\r\n                visibility:hidden;\r\n        }\r\n        .skin1\r\n        {\r\n                cursor:default;\r\n                font:menutext;\r\n                position:absolute;\r\n                width:120px;\r\n                background-color:menu;\r\n                border:1 solid buttonface;                \r\n                visibility:hidden;\r\n                border:1 outset buttonhightlight;\r\n        }\r\n        menuitems\r\n        {\r\n                padding-top:3px;\r\n                padding-left:11px;\r\n                padding-right:8px;        \r\n        }\r\n        -->        \r\n<\/style>\r\n<\/Head>\r\n<BODY leftMargin=5 topMargin=0 onLoad="this.focus();" bgcolor=#E7F4FE>\r\n<table border=0 cellPadding=0 cellSpacing=0 width=95% valign=top align=center>\r\n\t<tr>\r\n\t\t<td align=center><br>\r\n<p align=center style="FONT-SIZE:18pt;color:#990000;font-family:楷体_GB2312"><b>'+j.value.split("|")[1]+'&nbsp;&nbsp;'+j.parentNode.innerText+'<\/b><\/p>\r\n<div align=left style=\'font-size:10.5pt;color:black;line-height:180%;padding-left:10;padding-right:10\'>'+str.replace(/<(div|a).*?<\/\1>/g,"")+'\r\n\r\n<br><br><\/div><\/td><\/tr><tr><td align=center class=zt>\r\n<div class=zt>\t\r\n← <a href=\'javascript:document.location=prevpage\' target=_top>上一页<\/a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a \r\n\r\nhref=\'javascript:document.location=bookpage\' target=_top>回书目<\/a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a \r\n\r\nhref=\'javascript:document.location=nextpage\' target=_top>下一页<\/a> →\r\n\t\t<\/div><\/td>\r\n\t<\/tr>\r\n<\/table>\r\n<\/body>\r\n<\/html>'
    if(obj.txt.checked)
    {
        str=str.replace(/<table[\s\S]+?<b>/,'');
        str=str.replace(/<\/tr><tr>[\s\S]+/,'<p>完');
        str=str.replace(/(?:<p> *){2,}/,'');
    }
return str;
}

//爬爬书库文章
function paf(str)
{
str=str.replace(/<META.*\n/g,'');
str=str.replace(/\|[^<]*/,'');
str=str.replace(/<script.*\nfunction bk_change[\s\S]*?<\/script>/,'');
str=str.replace(/http.*?\/blib\/c\/read\/\d*\/\d*\//g,'');
str=str.replace(/<!\-\-[\s\S]+?\-\->\r\n/,'');
str=str.replace(/<a href='?(?:\/blib\/|http).*?<\/a> \| /gi,'');
str=str.replace(/<FONT.*\n/,'');
str=str.replace(/<script src.+?<\/script>/,'');
str=str.replace(/<script src[\s\S]+<\/script>/,'');
str=str.replace(/A\.ad[\s\S]*?\.mm/,'.mm');
str=str.replace(/(?:\r?\n?<p>\r?\n?){1,}<p>/gi,'<p>');
str=str.replace(/nextpage\(\)\s\{/,"nextpage() {\r\n\tif(event.keyCode==13) gotozhj('index')")
    if(obj.txt.checked)
    {
        str=str.replace(/<tr>.*\n.*\n.*\n.*\n.*\n.*?charp.*\n/i,'');
        str=str.replace(/^[\s\S]*?[^『:]<b>/i,'');
        str=str.replace(/<\/span>[\s\S]*$/i,'<p><p>完');
    }
return str;
}

//翠微居文章

function cwf(str){
str=str.replace(/\-.+?\-.+?\-[^<]+/,'');
str=str.replace(/<meta n[\s\S]+室" \/>\r\n/,'');
str=str.replace(/http:.+?e\//,'');
str=str.replace(/var a.+[\r\n]*.+\n/,'');
str=str.replace(/<div id="[^tif].+?<\/div>(?:\r\n)?(?:<hr \/>)?/gi,'');
str=str.replace(/<div>.+?<\/div>/i,'');
str=str.replace(/<center.+\n.+?script><\/div>(.+?)<div>[\s\S]+?\s+<\/SCRIPT>/i,'$1');
str=str.replace(/\r?\n/gi,'\r\n');
return str.replace(/\.html/gi,'.htm');
}

//玄幻书殿文章

function xhf(str)
{
var piao="",juan="",q2="",h2="";
var str=str.replace(/<link.*>/,"");
str=str.replace('id="by"','bgColor="#E6F3FF"');
try{
zfile=","+zfile
str=str.replace(/<script>_now="?(\d*)"?<\/script>/gi,function(a,b){
piao=eval('zfile.match(/,'+b+',([^,]*?),/)[1]')
if (eval('zfile.match(/__,([^,]*?)(,[^_]*)?,'+b+',/)')!=null)
juan=eval('zfile.match(/__,([^,]*?)(,[^_]*)?,'+b+',/)[1]')
q=eval('zfile.match(/,(\\d+),[^,]*(,__,[^,]*)?,'+b+',/)')
h=(eval('zfile.match(/,'+b+',[^,]*,__,[^,]*,\\d+/)')==null)?eval('zfile.match(/,'+b+',[^,]*?,(\\d+)/)'):eval('zfile.match(/,'+b+',[^,]*?,__,[^,]*,(\\d+)/)')
q2="<A href="+q[1]+".htm><font size=2>≤上一篇<\/font></A> "
q='\r\n        if (event.keyCode==37) location.href="'+q[1]+'.htm";'
h2=" <A href="+h[1]+".htm><font size=2>下一篇≥<\/font></A>"
h='\r\n        if (event.keyCode==39) location.href="'+h[1]+'.htm";'
return '<script language="javascript">\r\ndocument.onkeydown=nextpage\r\n    function nextpage() {'+q+h+'\r\n        if (event.keyCode==13) location.href="index.htm";}'});
}catch(e){}
str=str.replace("<script>show(_file[i+1])<\/script>",piao);
str=str.replace("<script>showbot()<\/script>",q2+"<A href=index.htm>目录</A>"+h2);
str=str.replace(/<script[^>]*>.*?<\/script>/gi,"");
str=str.replace(/\ id=bookT/g,"");
str=str.replace(/\width="760"/g,'width="100%"');
str=str.replace(/<div class="txt">[\s\S]+?<p PBG>/i,'<div class="txt"><p PBG>');
return str.replace("<HEAD>","<HEAD>\r\n<title>"+piao+"--"+juan+"<\/title>");
}

//思源中文文章
function shif(str)
{
    str=str.replace(/\-[^-]+\-思源中文网/,'');
    str=str.replace(/<title>([^|]+)\|\1\S+\s(.+?)\|[^<]+/,'<title>$1 -- $2');
    str=str.replace(/<meta n[\s\S]+?com" \/>[\r\n]+/,'');
    str=str.replace(/<div[^>]+><script.+?<\/div>[\r\n]+/gi,'');
    str=str.replace(/[\r\n]+<hr \/>[\s\S]+?<hr \/>/gi,'');
    str=str.replace(/<div s.+?<\/div>/gi,'');
    str=str.replace("http://book.syzw.cn/configs/article/",'');
    str=str.replace(/(?:&nbsp;)+本文<a href="http[\s\S]+?<\/div>/i,'<\/div>');
    str=str.replace(/\.html/gi,'.htm');
    str=str.replace(/http:\/\/book\.syzw\.cn\/modules\/article\/lastchapter\.php\?aid=\d+dynamic=\d+/gi,'index.htm');
    return str;
}

//79文学文章
function f79(str)
{
    str=str.replace(/.+\n.+\n/,'<html>');
    str=str.replace(/\s\-\s79[^<]+/,'');
    str=str.replace(/<m[\s\S]+?T" \/>\r\n/,'');
    str=str.replace(/<meta n[\s\S]+网" \/>\r\n/,'');
    str=str.replace(/\/Skin\/Default\/Css\//gi,'');
    str=str.replace(/<table width="750[\s\S]+?<\/table>\r\n/i,'');
    str=str.replace(/<table width="100%[\s\S]+?<\/table>/gi,'');
    str=str.replace(/<\/html>[\s\S]+/i,'<\/html>');
    str=str.replace(/<script>ShowLinkMenu\('(.+?)',.+?','(.+?)'\);<\/script>/i,'$1 &nbsp;<a href="javascript:document.location=gotobook">返回目录</a>&nbsp; $2');
    str=str.replace(/\/Book\/[^"]+/i,'index.htm');
    str=str.replace(/<script.+<\/script>[\r\n]*/gi,'');
    str=str.replace(/<div [^a].+?<\/div>/gi,'');
    return str;
}

//虚拟天空文章
function xnf(str)
{
str=str.replace(/\s*-\s*虚拟天空[^<]+/,'');
str=str.replace(/htmpage\/\d+\/\d+\/content\//gi,'');
str=str.replace(/.+book.+[\r\n]+/i,'');
str=str.replace(/css\//,'');
str=str.replace(/<center[\S\s]+?\r\n<\/td><\/tr><\/table>[\r\n]*/i,'');
str=str.replace(/<!\-\-[\s\S]+?<\/td><td >/i,'<table align="center"><tr><td>');
str=str.replace(/→]<\/font><\/td><TD >[\s\S]+/i,'→]<\/font><\/td><\/tr><\/table>\r\n<\/body><\/HTML>');
str=str.replace(/book_j\.php\?tid=\d+&bid=\d+&cid=(\d+)/gi,'$1.htm');
str=str.replace(/if\s*\(event.keyCode==45\).+/i,'');
    if(obj.txt.checked)
    {
        str=str.replace(/<title>.+?<\/title>/i,"")
        str=str.replace(/<HTML>/,"<P>完!")
    }
return str;
}

//梦想文学文章
function mx9(str)
{
str=str.replace("→梦想文学网","");
str=str.replace(/<table bor[\s\S]*?<\/table>/g,'');
str=str.replace(/<script [^l][\s\S]+?<\/script>(?:\r\n)*/gi,'');
str=str.replace(/<td.*?<\/td>\r\n/,'');
str=str.replace(/ *<TR>\r\n.*?>『[\s\S]+<\/TR>\r\n/,'');
str=str.replace(/content\.html/gi,"index.htm");
str=str.replace(/(\d+)\.html/gi,"$1.htm");
str=str.replace(/\.\.\/\.\.\/include\/book2/,'css');
str=str.replace(/<div style='display:none'>.+?<\/div>/gi,'');
str=str.replace(/<table a[\s\S]+?<\/table>\r\n/,'');
    if(obj.txt.checked)
    {
        str=str.replace(/<table[\s\S]+?<\/table>/i,'');
        str=str.replace(/<!--text over-->[\s\S]+/i,'<P>完!');
    }
return str;
}

//逐浪网文章
function zhuf(str)
{
    str=str.replace(/.+\n/,'');
    str=str.replace(/\|[^|]+\|[^|]+?</,'<');
    str=str.replace("utf-8",'GB2312');
    str=str.replace(/http.+?s\//gi,'');
    str=str.replace(/<script[\s\S]+?<\/div>\r\n\r\n<div id="midbody/i,'<div id="midbody');
    str=str.replace(/<div id="oDiv"[\s\S]+/i,'<\/body><\/html>');
    str=str.replace(/http:\/\/book\.zhulang\.com\/\d+\//gi,'');
    str=str.replace(/\.html/gi,'.htm');
    str=str.replace(/<script.+?<\/script>/gi,'');
    str=str.replace("http:\/\/www.zhulang.com\/","");
    str=str.replace(/\t+<meta[\s\S]+?"">\r\n/gi,'');
    return str;
}
</script>
快书打包下载
小说下载处理器 V3[1].5.hta

相关文章

最新评论