document.write(" 样本浏览") var totalpagenumber=0 var xmldoc1 var foldersTree = 0 var imagetif var bftype var timeOutId = 0 var bftif=0 var contentn=0 var titlen=0 var index=0 var glossary=0 var acknowledgements=0 var bibliography=0 var colophon=0 var rightpage=0 var dedication=0 var epigraph=0 var foreword=0 var loi=0 var lot=0 var notes=0 var preface=0 var appendix=0 var intro=0 var contenttif=0 var titletif=0 var covertif=0 var glossarytif=0 var acknowledgementstif=0 var bibliographytif=0 var colophontif=0 var rightpagetif=0 var dedicationtif=0 var epigraphtif=0 var forewordtif=0 var loitif=0 var lottif=0 var notestif=0 var prefacetif=0 var appendixtif=0 var introtif=0 xmldoc1=new ActiveXObject("microsoft.xmldom") xmldoc2=new ActiveXObject("microsoft.xmldom") xmldoc1.async=false; xmldoc1.resolveExternals = false; xmldoc1.validateOnParse = false; xmldoc2.async=false; xmldoc2.resolveExternals = false; xmldoc2.validateOnParse = false; var filename var titlepageexist var coverexist=0 filename="meta/a.opf" var url=filename xmldoc1.load(url) if (xmldoc1.parseError!=0) { alert(xmldoc1.parseError.reason) } root=xmldoc1.documentElement metadata=root.childNodes.item(0).childNodes.item(0) manifest=root.childNodes.item(1) guide=root.childNodes.item(3) //each node in the tree is an Array with 4+n positions // node[0] is 0/1 when the node is closed/open // node[1] is 0/1 when the folder is closed/open // node[2] is 1 if the children of the node are documents // node[3] is the name of the folder // node[4]...node[4+n] are the n children nodes function addItem(newItem) { this.length += 1; this[(this.length-1)] = newItem; } function shoppingList(firstItem) ///////////// do what?? { this.length = 2; this.addItem = addItem; this[(this.length-1)] = firstItem; } function generateTree() { var aux1, aux2, aux3, aux4 var open var i var num foldersTree = folderNode("书籍信息") aux1 = appendChild(foldersTree,leafNode2("元数据信息")) for(i=0;i< metadata.childNodes.length;i++) { metastring= metadata.childNodes.item(i).nodeName.substring(3)+":"+ metadata.childNodes.item(i).text if (metadata.childNodes.item(i).nodeName!="dc:Identifier") //why? aux2= appendChild(aux1,generateDocEntry1( metastring)) } i=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,7)=="content") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(7,10) i++ } contentn=parseInt(num) //alert(contentn) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,14)=="imageincontent") { i++ } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,5)=="cover") i++ while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,9)=="titlepage") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(9,10) i++ } titlen=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,8)=="colophon") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,20) i++ } colophon=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,8)=="epigraph") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,20) i++ } epigraph=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,10)=="dedication") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(10,20) i++ } dedication=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,5)=="index") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(5,6) i++ } index=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,8)=="appendix") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,20) i++ } appendix=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,8)=="foreword") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,20) i++ } foreword=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,5)=="notes") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(5,20) i++ } notes=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,16)=="acknowledgements") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(16,20) i++ } acknowledgements=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,8)=="glossary") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,9) i++ } glossary=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,7)=="preface") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(7,20) i++ } preface=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,5)=="intro") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(8,20) i++ } intro=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,12)=="bibliography") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(12,20) i++ } bibliography=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,9)=="rightpage") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(9,20) i++ } rightpage=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,3)=="loi") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(3,20) i++ } loi=parseInt(num) num=0 while( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,3)=="lot") { num=manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(3,20) i++ } lot=parseInt(num) totalpagenumber=i //书的总页数 num=0 if ( manifest.childNodes.item(i).attributes.item(0).nodeValue.substring(0,3)=="toc") i++ while ( i< manifest.childNodes.length) { if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("content")==0) { contenttif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("cover")==0) { covertif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("titlepage")==0) { titlepagetif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("colophon")==0) { colophontif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("epigraph")==0) { epigraphtif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("dedication")==0) { dedicationtif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("index")==0) { indextif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("appendix")==0) { appendixtif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("foreword")==0) { forewordtif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("notes")==0) { notestif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("acknowledgements")==0) { acknowledgementstif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("glossary")==0) { glossarytif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("preface")==0) { prefacetif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("intro")==0) { introtif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("bibliography")==0) { bibliographytif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("rightpage")==0) { rightpagetif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("loi")==0) { loitif=1 imagetif=1 } if (manifest.childNodes.item(i).attributes.item(0).nodeValue.indexOf("lot")==0) { lottif=1 imagetif=1 } i++ } //guide=root.childNodes.item(3) for(i=0;i0) { aux1 = appendChild(foldersTree,leafNode2("其他信息")) for(i=0;i") j=0 }*/ if (node.childNodes.length==1) //没有下一层的信息 { //pagenumber=node.childNodes.item(2).text //页码 //var strtmp="00000000" //href="ptiff\\"+strtmp.substring(strtmp,pagenumber.length)+".djvu" //href="ptiff\\0000000"+pagenumber+".djvu" href="ptiff\\"+node.childNodes.item(0).nodeValue+".djvu" //aux2=appendChild(parentnode,leafNode2(index+" "+title+"..."+page)) aux2=appendChild(parentnode,leafNode2(title+"..."+page)) } else { //aux2=appendChild(parentnode,folderNode1(index+" "+title+"..."+page)) //还有下一级信息 aux2=appendChild(parentnode,folderNode1(title+"..."+page)) //还有下一级信息 for(j=1;jOpens in right frameOpens in new window" + docDescription + "" return retString } function generateDocEntry1(docDescription) { var retString ="" retString="" + docDescription + "" return retString } function redrawTree() { var doc = top.treeFrame.window.document doc.clear() doc.write("") doc.write("") doc.write("") doc.write("
") redrawNode(foldersTree, doc, 0, 1, "") doc.close() } function redrawNode(foldersNode, doc, level, lastNode, leftSide) { var j=0 var i=0 doc.write("") doc.write("
") doc.write(leftSide) if (level>0) if (lastNode) { doc.write("") leftSide = leftSide + "" } else { doc.write("") leftSide = leftSide + "" } displayIconAndLabel(foldersNode, doc) doc.write("
") if (foldersNode.length > 4 && foldersNode[0]) //there are sub-nodes and the folder is open { if (!foldersNode[2]) //for folders with folders { level=level+1 for (i=4; i") doc.write("") doc.write(leftSide) if (i==foldersNode.length - 1) doc.write("") else doc.write("") doc.write(foldersNode[i]) doc.write("") } } } } function displayIconAndLabel(foldersNode, doc) { //此处替换掉章节名称中的双引号 var tp var re=/"/gi tp=foldersNode[3].replace(re,"") re=/'/gi tp=tp.replace(re,"") doc.write("") else doc.write("../../../../images/ebiao.gif width=18 height=18 border=noborder>") doc.write("") doc.write(""+foldersNode[3]+"") } function closeFolders(foldersNode) { var i=0 if (!foldersNode[2]) { for (i=4; i< foldersNode.length; i++) closeFolders(foldersNode[i]) } foldersNode[0] = 0 foldersNode[1] = 0 } function clickOnFolderRec(foldersNode, folderName) { var i=0 //此处替换掉章节名称中的双引号 var tp var re=/"/gi tp=foldersNode[3].replace(re,"") re=/'/gi tp=tp.replace(re,"") if (tp == folderName) { if (foldersNode[0]) closeFolders(foldersNode) else { foldersNode[0] = 1 foldersNode[1] = 1 } } else { if (!foldersNode[2]) for (i=4; i< foldersNode.length; i++) clickOnFolderRec(foldersNode[i], folderName) } } function openBranch(branchName) { clickOnFolderRec(foldersTree,branchName) var strtmp var strpretmp if (folderNode[3]=="书籍信息" && foldersTree[0]==0) top.folderFrame.location="about:blank" index1=branchName.indexOf("...")+3 strtmp=branchName.substring(index1) strpretmp="00000000" strpretmp=strpretmp.substring(strtmp.length) if (index1>3) top.folderFrame.location="ptiff/"+strpretmp+strtmp+".djvu" timeOutId = setTimeout("redrawTree()",100) } function currenttype() { var type var currentfile currentfile=top.folderFrame.location+"" var contentnumtmp0 var contentnumtmpend var covernumtmp0 var covernumtmpend var titlepagenumtmp0 var titlepagenumtmpend var indexnumtmp0 var indexnumtmpend var glossarynumtmp0 var glossarynumtmpend var acknowledgementsnumtmp0 var acknowledgementsnumtmpend var bibliographynumtmp0 var bibliographynumtmpend var colophonnumtmp0 var colophonnumtmpend var rightpagenumtmp0 var dedicationnumtmp0 var epigraphnumtmp0 var forewordnumtmp0 var loinumtmp0 var lotnumtmp0 var notesnumtmp0 var prefacenumtmp0 var appendixnumtmp0 var intronumtmp0 var covernumtmp0 var tifnumtmp0 var rightpagenumtmpend var dedicationnumtmpend var epigraphnumtmpend var forewordnumtmpend var loinumtmpend var lotnumtmpend var notesnumtmpend var prefacenumtmpend var appendixnumtmpend var intronumtmpend var covernumtmpend var tifnumtmpend var tifnumtmp0 var tifnumtmpend //alert(currentfile) var j=0 if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,7)=="content") contentnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,7)=="content") { contentnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="cover") covernumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="cover")) { covernumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,9)=="titlepage") titlepagenumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,9)=="titlepage")) { titlepagenumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="index") indexnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="index")) { indexnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="glossary") glossarynumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="glossary")) { glossarynumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,16)=="acknowledgements") acknowledgementsnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,16)=="acknowledgements")) { acknowledgementsnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,12)=="bibliography") bibliographynumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,12)=="bibliography")) { bibliographynumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="colophon") colophonnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="colophon")) { colophonnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,9)=="rightpage") rightpagenumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,9)=="rightpage")) { rightpagenumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,10)=="dedication") dedicationnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,10)=="dedication")) { dedicationnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="epigraph") epigraphnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="epigraph")) { epigraphnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="foreword") forewordnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="foreword")) { forewordnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,3)=="loi") loinumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,3)=="loi")) { loinumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,3)=="lot") lotnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,3)=="lot")) { lotnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,4)=="notes") notesnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,4)=="notes")) { notesnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,7)=="preface") prefacenumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,7)=="preface")) { prefacenumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="appendix") appendixnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,8)=="appendix")) { appendixnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="intro") intronumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="intro")) { intronumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="cover") covernumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,5)=="cover")) { covernumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } if (manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,12)=="imagecontent") tifnumtmp0=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) while((manifest.childNodes.item(j).attributes.item(0).nodeValue.substring(0,12)=="imagecontent")) { tifnumtmpend=new Number(manifest.childNodes.item(j).attributes.item(1).nodeValue.substring(5,13)) j++; } var a=currentfile.indexOf("ptiff/") var b=currentfile.substring(a+5,a+13) var now=new Number(b) //alert(now) //var dd=new String(now) //alert(now+"dd") if ((now>=contentnumtmp0)&&(now<=contentnumtmpend)) type="content" if ((now>=covernumtmp0)&&(now<=covernumtmpend)) type="cover" if ((now>=titlepagenumtmp0)&&(now<=titlepagenumtmpend)) type="titlepage" if ((now>=indexnumtmp0)&&(now<=indexnumtmpend)) type="index" if ((now>=glossarynumtmp0)&&(now<=glossarynumtmpend)) type="glossary" if ((now>=acknowledgementsnumtmp0)&&(now<=acknowledgementsnumtmpend)) type="acknowledgements" if ((now>=bibliographynumtmp0)&&(now<=bibliographynumtmpend)) type="colophon" if ((now>=colophonnumtmp0)&&(now<=colophonnumtmpend)) type="content" if ((now>=rightpagenumtmp0)&&(now<=rightpagenumtmpend)) type="rightpage" if ((now>=dedicationnumtmp0)&&(now<=dedicationnumtmpend)) type="dedication" if ((now>=epigraphnumtmp0)&&(now<=epigraphnumtmpend)) type="content" if ((now>=forewordnumtmp0)&&(now<=forewordnumtmpend)) type="foreword" if ((now>=loinumtmp0)&&(now<=loinumtmpend)) type="loi" if ((now>=lotnumtmp0)&&(now<=lotnumtmpend)) type="lot" if ((now>=notesnumtmp0)&&(now<=notesnumtmpend)) type="notes" if ((now>=prefacenumtmp0)&&(now<=prefacenumtmpend)) type="preface" if ((now>=appendixnumtmp0)&&(now<=appendixnumtmpend)) type="appendix" if ((now>=intronumtmp0)&&(now<=intronumtmpend)) type="intro" if ((now>=covernumtmp0)&&(now<=covernumtmpend)) type="cover" if ((now>=tifnumtmp0)&&(now<=tifnumtmpend)) type="tif" /*if (currentfile.indexOf("content")>0) type="content" if (currentfile.indexOf("cover")>0) type="cover" if (currentfile.indexOf("titlepage")>0) type="titlepage" if (currentfile.indexOf("index")>0) type="index" if (currentfile.indexOf("glossary")>0) type="glossary" if (currentfile.indexOf("acknowledgements")>0) type="acknowledgements" if (currentfile.indexOf("bibliography")>0) type="bibliography" if (currentfile.indexOf("colophon")>0) type="colophon" if (currentfile.indexOf("rightpage")>0) type="rightpage" if (currentfile.indexOf("dedication")>0) type="dedication" if (currentfile.indexOf("epigraph")>0) type="epigraph" if (currentfile.indexOf("foreword")>0) type="foreword" if (currentfile.indexOf("loi")>0) type="loi" if (currentfile.indexOf("lot")>0) type="lot" if (currentfile.indexOf("notes")>0) type="notes" if (currentfile.indexOf("preface")>0) type="preface" if (currentfile.indexOf("appendix")>0) type="appendix" if (currentfile.indexOf("intro")>0) type="intro" if (currentfile.indexOf("cover")>0) type="cover" if (currentfile.indexOf("djvu")>0) type="djvu"*/ //alert(type) return type } function lastn(dtype) { var last if (dtype=="content") last=contentn if (dtype=="titlepage") last=titlen if (dtype=="index") last=index if (dtype=="glossary") last=glossary if (dtype=="acknowledgements") last=acknowledgements if (dtype=="bibliography") last=bibliography if (dtype=="colophon") last=colophon if (dtype=="rightpage") last=rightpage if (dtype=="dedication") last=dedication if (dtype=="epigraph") last=epigraph if (dtype=="foreword") last=foreword if (dtype=="loi") last=loi if (dtype=="lot") last=lot if (dtype=="notes") last=notes if (dtype=="preface") last=preface if (dtype=="appendix") last=appendix if (dtype=="intro") last=intro return last } function change(dtype) { var ctype if (dtype=="content") ctype="正文" if (dtype=="titlepage") ctype="标题页" if (dtype=="index") ctype="索引" if (dtype=="glossary") ctype="术语表" if (dtype=="acknowledgements") ctype="感谢" if (dtype=="bibliography") ctype="参考书目" if (dtype=="colophon") ctype="题跋" if (dtype=="rightpage") ctype="版权页" if (dtype=="dedication") ctype="贡献" if (dtype=="epigraph") ctype="引语" if (dtype=="foreword") ctype="前言" if (dtype=="loi") ctype="插图清单" if (dtype=="lot") ctype="表格清单" if (dtype=="notes") ctype="注释" if (dtype=="preface") ctype="绪言" if (dtype=="appendix") ctype="附录" if (dtype=="intro") ctype="内容提要" return ctype } function currentpage(dtype) { var pnum var p var currentdoc if (dtype=="djvu") { pnum=bftif return pnum } currentdoc=top.folderFrame.location+"" indexofend=currentdoc.indexOf(".djvu") if (dtype=="content") { indexofbegin=currentdoc.indexOf("/contents/content") pagenumber=currentdoc.substring(indexofbegin+17,indexofend) } else { indexofbegin=currentdoc.indexOf("/others/") p=8+dtype.length pagenumber=currentdoc.substring(indexofbegin+p,indexofend) } pnum=parseInt(pagenumber) return pnum } function lastpage() { //stype=currenttype() //nowpage=currentpage(stype)-1 //if (stype=="djvu") stype=bftype var here var a var b var now here=top.folderFrame.location+"" if (here.indexOf(".djvu")>0) { a=here.indexOf("ptiff/") b=here.substring(a+6,a+14) now =new Number(b) } nowpage=now if (nowpage<1) nowpage=1 /* if ((stype=="content") || (stype=="tif")) top.folderFrame.location="ptiff\\0000000"+nowpage+".djvu" else top.folderFrame.location="others\\"+stype+nowpage+".djvu" */ var here here=top.folderFrame.location+"" if (here.indexOf(".djvu")>0) { var a=here.indexOf("ptiff/") var b=here.substring(a+6,a+14) var now =new Number(b) var next=now-1 if (next<1) { alert("已经到达第一页") return; } var snext=new String(next) var s="00000000" var tofilename=s.substring(snext.length)+snext+".djvu" top.folderFrame.location="ptiff\\"+tofilename } } function nextpage() { var here var a var b var now here=top.folderFrame.location+"" if (here.indexOf(".djvu")>0) { a=here.indexOf("ptiff/") b=here.substring(a+6,a+14) now =new Number(b) } nowpage=now /* if (stype=="cover") { top.folderFrame.location="ptiff\\content1.djvu" return } lastp=lastn(stype) if (nowpage==lastp) { alert("已经是"+change(stype)+"的最后一页!") return } else { nowpage=nowpage+1 if ((stype=="content") || (stype=="djvu")) top.folderFrame.location="ptiff\\0000000"+nowpage+".djvu" //else //top.folderFrame.location="ptiff\\"+stype+nowpage+".djvu" }*/ if (here.indexOf(".djvu")>0) { var a=here.indexOf("ptiff/") var b=here.substring(a+6,a+14) var now =new Number(b) var next=now+1 if (next>totalpagenumber) { alert("已经到达最后一页") return; } var snext=new String(next) var s="00000000" var tofilename=s.substring(snext.length)+snext+".djvu" top.folderFrame.location="ptiff\\"+tofilename } } function judge(dtype) {var exist=0 if ((dtype=="content") && (contenttif==1) ) { exist=1 return exist } if ((dtype=="cover") && (covertif==1) ) { exist=1 return exist } if ((dtype=="titlepage")&& (titlepagetif==1) ) { exist=1 return exist } if ((dtype=="colophon") &&(colophontif==1) ) { exist=1 return exist } if ((dtype=="epigraph") && (epigraphtif==1) ) { exist=1 return exist } if ((dtype=="dedication") && (dedicationtif==1) ) { exist=1 return exist } if ((dtype=="index") && (indextif==1) ) { exist=1 return exist } if ((dtype=="appendix") && (appendixtif==1) ) { exist=1 return exist } if ((dtype=="foreword")&& (forewordtif==1) ) { exist=1 return exist } if ((dtype=="notes") && (notestif==1) ) { exist=1 return exist } if ((dtype=="acknowledgements") && (acknowledgementstif==1) ) { exist=1 return exist } if ((dtype=="glossary") && (glossarytif==1) ) { exist=1 return exist } if ((dtype=="preface") && (prefacetif==1) ) { exist=1 return exist } if ((dtype=="intro") && (introtif==1) ) { exist=1 return exist } if ((dtype=="bibliography") && (bibliographytif==1) ) { exist=1 return exist } if ((dtype=="rightpage") && (rightpagetif==1) ) { exist=1 return exist } if ((dtype=="loi") && (loitif==1) ) { exist=1 return exist } if ((dtype=="lot") && (lottif==1) ) { exist=1 return exist } } function initializeFolderFrame() { //wotest //char[] a={'a','a','a'} //String b=String.copyValueOf(a) //alert(b) // if (coverexist==1) top.folderFrame.location="ptiff\\00000001.djvu" else top.folderFrame.location="ptiff\\00000001.djvu" } function initializeTree() { redrawTree() initializeFolderFrame() } function reSetFrames() {  top.total.cols=(top.total.cols=="0,*")?"200,*":"0,*" } function hidetree() { top.left.cols="0,*" } function initltop() { var tdoc=top.titleFrame.window.document generateTree() tdoc.clear() imagetif=1 //if (imagetif==1) tdoc.write("") tdoc.write("") tdoc.write("
") tdoc.write("") tdoc.write("返回首页") tdoc.write("") tdoc.write("
") if (imagetif==1) {tdoc.write("