(function(){function t(n,t){$("#msg").html("").append(n),t&&$("#ext_status").attr("src","mz://system/image/warn.jpg")}function i(n,t){$("#progress").html(n+(t>-1?" - "+t+"%":""))}var r=$GET.title||"",n=$GET.url||"",u=$GET.format||"";$e.run({_name:n.replace(/\W+/ig,""),_file:"download.dst",url:n,md5:$e.md5(n),title:r,action:"download",_runecho:function(n,i){debugtime(i),i.search(/error:/i)>-1&&t('<font color="red">'+i.substring(6)+"<\/font>")},_showspeed:function(n,t,r){debugtime(t),i(t,r)},_runover2:function(r,f,e,o){if(f&&__log("download","txt_downstop",n),e){t("下载成功，正在导入作品.");function s(i){var r=$e.importBook(i,o,n),f;r?(t("下载成功，导入成功."),__log("download","txt_downsucc",n),$e.deleteFile(i),location.href="mz://reader/?url="+r+"&from=txt_downsucc"):(f=$('<font class="pointer">导入失败，点击重试<\/font>').on("click",function(){s(i)}).attr("title",i),t(f,!0),__log("download","txt_importfail",u+"||"+n))}s(e)}else t("下载失败, 请重试！",!0),i("",-1),__log("download","txt_downfail",n)}})})(window,document,undefined)