\n"); outputFrame.write("\n"); outputFrame.write(prefixHTML + "\n\n"); if (treeData[1].target == "") {var targetFrame = defaultTargetFrame} else {var targetFrame = treeData[1].target} if (treeData[1].icon == "") {var imageString = defaultImageURL + 'img-globe-' + structureStyle + '.gif'} else {imageString = defaultImageURL + treeData[1].icon} outputFrame.write("" + treeData[1].url + " " + treeData[1].name + "
\n"); drawBranch("root",""); outputFrame.write("
\n" + suffixHTML + "\n"); outputFrame.write("
\n\n"); outputFrame.close(); window.status="OmenTree v1.0 - (C) 1998 Colin Tucker/OmenSoft - http://omensoft.home.ml.org"; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // drawBranch() - GENERAL FUNCTION - used by the drawTree() function to recursively draw all // visable nodes in the tree structure. function drawBranch(startNode,structureString) { var children = extractChildrenOf(startNode); var currentIndex = 1; while (currentIndex <= children.length) { outputFrame.write(structureString); if (children[currentIndex].type == 'link') { if (children[currentIndex].icon == "") { var imageString = defaultImageURL + defaultLinkIcon; } else {var imageString = defaultImageURL + children[currentIndex].icon} if (children[currentIndex].target == "") { var targetFrame = defaultTargetFrame; } else {var targetFrame = children[currentIndex].target} if (currentIndex != children.length) { outputFrame.write("") } else { outputFrame.write("") } outputFrame.write("" + children[currentIndex].url + " " + children[currentIndex].name + "
\n") } else { var newStructure = structureString; if (children[currentIndex].iconClosed == "") {var iconClosed = "img-folder-closed-" + structureStyle + ".gif"} else {var iconClosed = children[currentIndex].iconClosed} if (children[currentIndex].iconOpen == "") {var iconOpen = "img-folder-open-" + structureStyle + ".gif"} else {var iconOpen = children[currentIndex].iconOpen} if (currentIndex != children.length) { if (children[currentIndex].open == 0) { outputFrame.write("Click to open this folder") outputFrame.write("Click to open this folder " + children[currentIndex].name + "
\n") } else { outputFrame.write("Click to close this folder"); outputFrame.write("Click to close this folder " + children[currentIndex].name + "
\n"); newStructure = newStructure + ""; drawBranch(children[currentIndex].id,newStructure); } } else { if (children[currentIndex].open == 0) { outputFrame.write("Click to open this folder") outputFrame.write("Click to open this folder " + children[currentIndex].name + "
\n") } else { outputFrame.write("Click to close this folder"); outputFrame.write("Click to close this folder " + children[currentIndex].name + "
\n"); newStructure = newStructure + ""; drawBranch(children[currentIndex].id,newStructure); } } } currentIndex++; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // toggleFolder() - GENERAL FUNCTION - opens/closes folder nodes. function toggleFolder(id,status) { var nodeIndex = indexOfNode(id); treeData[nodeIndex].open = status; timeOutId = setTimeout("drawTree()",100)} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // indexOfNode() - GENERAL FUNCTION - finds the index in the treeData Collection of the node // with the given id. function indexOfNode(id) { var currentIndex = 1; while (currentIndex <= treeData.length) { if ((treeData[currentIndex].type == 'root') || (treeData[currentIndex].type == 'folder')) { if (treeData[currentIndex].id == id) {return currentIndex}} currentIndex++} return -1} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // extractChildrenOf() - GENERAL FUNCTION - extracts and returns a Collection containing all // of the node's immediate children nodes. function extractChildrenOf(node) { var children = new Collection(); var currentIndex = 1; while (currentIndex <= treeData.length) { if ((treeData[currentIndex].type == 'folder') || (treeData[currentIndex].type == 'link')) { if (treeData[currentIndex].parent == node) { children.add(treeData[currentIndex])}} currentIndex++} return children} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Collection() - OBJECT - a dynamic storage structure similar to an Array. function Collection() { this.length = 0; this.add = add; return this} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // add() - METHOD of Collection - adds an object to a Collection. function add(object) { this.length++; this[this.length] = object} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // RootNode() - OBJECT - represents the top-most node of the hierarchial tree. function RootNode(id,name,url,target,icon) { this.id = id; this.name = name; this.url = url; this.target = target; this.icon = icon; this.type = 'root'; return this} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // FolderNode() - OBJECT - represents a node which branches to contain other nodes. function FolderNode(id,parent,name,iconClosed,iconOpen) { this.id = id; this.parent = parent; this.name = name; this.iconClosed = iconClosed; this.iconOpen = iconOpen; this.type = 'folder'; this.open = 0; return this} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LinkNode() - OBJECT - a node that represents a link using a URL. function LinkNode(parent,name,url,target,icon) { this.parent = parent; this.name = name; this.url = url; this.target = target; this.icon = icon; this.type = 'link'; return this} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // loadData() - GENERAL FUNCTION - user defined data and variables exist in this function. function loadData() { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Tree structure definitions: // Syntax: // ROOT NODE: // treeData.add(new RootNode("","","","","")); // NOTE: There must be only ONE root node, and it MUST be the FIRST node. // and can be left null - defaults will be used. // FOLDER NODE: // treeData.add(new FolderNode("","","","","")); // NOTE: Folder nodes MUST have a valid parent node, and they SHOULD have children nodes. // and can be left null - OmenTree will use the // default images. // LINK NODE: // treeData.add(new LinkNode("","","","","")); // NOTE: and may be left null - defaults specified in the user // defined variables section will be used. // Consult the OmenTree documentation for further assistance. treeData = new Collection(); treeData.add(new RootNode('root','Home','welcome.html','','')); // Root Node MUST be first! treeData.add(new LinkNode('root','PC Tips!!','PCtips.html','','')); treeData.add(new LinkNode('root','有趣的chem!!','chem.html','','')); treeData.add(new LinkNode('root','有著數!!','luck.html','','')); treeData.add(new LinkNode('root','最新消息!!','news.html','','')); treeData.add(new FolderNode('song','root','song','','')); // treeData.add(new LinkNode('song','女歌手','song/song1.html','','')); // treeData.add(new LinkNode('song','男歌手','song/song2.html','','')); // treeData.add(new LinkNode('song','兒歌','song/song3.html','','')); treeData.add(new LinkNode('song','民歌','midi1.html','','')); treeData.add(new FolderNode('chat','root','chat room 小技巧','','')); treeData.add(new LinkNode('chat','技巧1','chat-lesson1.html','','')); treeData.add(new LinkNode('chat','技巧2','chat-lesson2.html','','')); // treeData.add(new FolderNode('docs','root','eva','','')); // treeData.add(new FolderNode('nodes','docs','EVA 人物','','')); // treeData.add(new LinkNode('nodes','真治','eva/Shinji.html','','')); // treeData.add(new LinkNode('nodes','綾波麗','eva/rei.html','','')); // treeData.add(new LinkNode('nodes','明日香','eva/Asuka.html','','')); // treeData.add(new LinkNode('nodes','美里','eva/Misato.html','','')); // treeData.add(new LinkNode('nodes','赤木律子','eva/Ritsuko.html','','')); // treeData.add(new LinkNode('nodes','赤木直子','eva/Naoko.html','','')); // treeData.add(new LinkNode('nodes','碇元渡','eva/Gendou.html','','')); // treeData.add(new LinkNode('nodes','冬月耕造','eva/Kouzou.html','','')); // treeData.add(new LinkNode('nodes','碇唯','eva/Yui.html','','')); // treeData.add(new LinkNode('nodes','加持','eva/Kaji.html','','')); // treeData.add(new LinkNode('nodes','冬二','eva/Touji.html','','')); // treeData.add(new LinkNode('nodes','劍介','eva/Kensuke.html','','')); // treeData.add(new LinkNode('nodes','洞木光','eva/Hikari.html','','')); // treeData.add(new LinkNode('nodes','青葉茂','eva/Shigeru.html','','')); // treeData.add(new LinkNode('nodes','伊吹摩耶','eva/Ibuki.html','','')); // treeData.add(new LinkNode('nodes','日向誠','eva/Makoto.html','','')); // treeData.add(new LinkNode('nodes','羅倫茲','eva/Lorenz.html','','')); // treeData.add(new LinkNode('nodes','渚薰','eva/Kaworu.html','','')); // treeData.add(new LinkNode('nodes','片片','eva/PenPen.html','','')); // treeData.add(new FolderNode('nodes1','docs','EVA 機','','')); // treeData.add(new LinkNode('nodes1','零號機','eva/zero.html','','')); // treeData.add(new LinkNode('nodes1','初號機','eva/one.html','','')); // treeData.add(new LinkNode('nodes1','貳號機','eva/two.html','','')); // treeData.add(new LinkNode('nodes1','參號機','eva/three.html','','')); // treeData.add(new LinkNode('nodes1','肆號機','eva/four.html','','')); // treeData.add(new FolderNode('gall','root','gallery','','')); // treeData.add(new FolderNode('nodes4','gall','people','','')); // treeData.add(new LinkNode('nodes4','girl','girlcg.html','','')); // treeData.add(new LinkNode('nodes4','boy','boycg.html','','')); // treeData.add(new FolderNode('nodes5','gall','comics','','')); // treeData.add(new LinkNode('nodes5','love','lovecg.html','','')); // treeData.add(new LinkNode('nodes5','eva','evacg.html','','')); // treeData.add(new LinkNode('nodes5','ff8','ff8cg.html','','')); // treeData.add(new LinkNode('nodes5','封神演義','gcg.html','','')); // treeData.add(new LinkNode('nodes5','sakura','sakuracg.html','','')); // treeData.add(new FolderNode('nodes6','gall','others','','')); // treeData.add(new LinkNode('nodes6','十二星座','12starcg.html','','')); // treeData.add(new LinkNode('nodes6','things','thingscg.html','','')); treeData.add(new FolderNode('favs','root','Favorites','img-folder-closed-fav.gif','img-folder-open-fav.gif')); treeData.add(new FolderNode('chatroom','favs','chatroom','','')); treeData.add(new LinkNode('chatroom','繁體子 chatroom','http://www.hkcyber.com/chatroom/','blank','img-page-link.gif')); treeData.add(new LinkNode('chatroom','簡體字 chatroom','http://say.china.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('chatroom','eng chatroom','http://www.englishtown.com/','blank','img-page-link.gif')); treeData.add(new FolderNode('engines','favs','Search Engines','','')); treeData.add(new LinkNode('engines','InfoSeek','http://www.infoseek.com','blank','img-page-link.gif')); treeData.add(new LinkNode('engines','Yahoo!','http://www.yahoo.com','blank','img-page-link.gif')); treeData.add(new LinkNode('engines','香港雅虎!','http://www.yahoo.com.hk','blank','img-page-link.gif')); treeData.add(new LinkNode('engines','新浪網','http://www.sina.com.hk/','blank','img-page-link.gif')); treeData.add(new LinkNode('engines','哇塞中文網','http://www.whatsite.com.tw/','blank','img-page-link.gif')); treeData.add(new LinkNode('engines','蕃薯藤','http://www.yam.com.tw/','blank','img-page-link.gif')); treeData.add(new FolderNode('edu','favs','Education','','')); treeData.add(new LinkNode('edu','hkcampus','http://www.hkcampus.net/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','香港公共圖書館','http://www.rcpl.rc.gov.hk/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','漢語語法修辭常識','http://www.oocities.com/CollegePark/Campus/7065/index.html','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','hyperphysics','http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','englishtown','http://www.englishtown.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','daisyland','http://daisyland.tierranet.com/index.html','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','EZ TALK','http://www.eztalk.to/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','EZ JAPAN','http://www.ezjapan.com.tw/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','english4us','http://www.english4us.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','abcnews','http://abcnews.go.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('edu','readers digest','http://www.readersdigest.com/','blank','img-page-link.gif')); treeData.add(new FolderNode('font','favs','font','','')); treeData.add(new LinkNode('font','k2page','http://k2page.hypermart.net/K2_fonts.html','blank','img-page-link.gif')); treeData.add(new LinkNode('font','font downloads','http://www2.nsysu.edu.tw/fontLink.htm','blank','img-page-link.gif')); treeData.add(new FolderNode('game','favs','Games','','')); treeData.add(new LinkNode('game','黑雨帝國','http://www.oocities.com/FashionAvenue/M6192/','blank','img-page-link.gif')); treeData.add(new LinkNode('game','GoFun2000','http://202.89.254.210/mypoint_frame.asp','blank','img-page-link.gif')); treeData.add(new LinkNode('game','中黑客急中心','http://huge.virtualave.net/chinahack/index.htm','blank','img-page-link.gif')); treeData.add(new FolderNode('comic','favs','Comics','','')); treeData.add(new LinkNode('comic','日本san','http://www.san-x.co.jp/index01.html','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','Sakura City','http://sakuracity3.heha.net/core.html','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','Final Fantasy World','http://travel.to/ffworld','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','C.C.Sakura','http://www.ccsakura.com.tw/','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','EVA研究站','http://home.baoding.cn.net/~jediliao/Newweb/index.html','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','EVA NET','http://eva.163.net/','blank','img-page-link.gif')); treeData.add(new LinkNode('comic','漫盟排行榜','http://203.208.16.231/iscomic/rank.asp','blank','img-page-link.gif')); treeData.add(new FolderNode('entertain','favs','Entertainment','','')); treeData.add(new LinkNode('entertain','pchome','http://www.pchome.com','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','Chinese Lyrics Page','http://homepages.ihug.co.nz/~coolman/lyrice.html','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','DHTML','http://www.dynamicdrive.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','Tripod','http://www.tripod.lycos.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','Tucows','http://tucows.hongkong.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','netease','http://www.163.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','熾天使書城','http://welcome.to/silencer.com','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','求愛日記','http://diary.tacomall.com.tw/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','hkgolden','http://www.hkgolden.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','yes','http://www.yes.com.hk/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','welcome','http://www.wellcomehk.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','parknshop','http://www.parknshop.com/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','animfactory','http://www.animfactory.com/index.html','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','hksina','http://www.sina.com.hk/','blank','img-page-link.gif')); treeData.add(new LinkNode('entertain','centamap','http://www.centamap.com/cent/index.htm','blank','img-page-link.gif')); treeData.add(new FolderNode('news','favs','News','','')); treeData.add(new LinkNode('news','東方日報','http://orientaldaily.com.hk','blank','img-newsgroup.gif')); treeData.add(new LinkNode('news','星島日報','http://www.singtao.com/','blank','img-newsgroup.gif')); treeData.add(new LinkNode('news','蘋果日報','http://www.appledaily.com/','blank','img-newsgroup.gif')); treeData.add(new LinkNode('news','南華早報','http://www.scmp.com/','blank','img-newsgroup.gif')); treeData.add(new LinkNode('news','明報','http://www.mingpao.com/','blank','img-newsgroup.gif')); treeData.add(new LinkNode('root','E-mail','mailto:hktoby@sinatown.com?subject=To Toby','','img-email.gif')); treeData.add(new LinkNode('root','guestbook','http://www.2u.com.tw/cgi-bin/09/guestbook.cgi?toby','','')); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // User defined variables: structureStyle = 0; // 0 for light background, 1 for dark background backgroundColor = 'lightblue'; // sets the bgColor of the menu textColor = '#000000'; // sets the color of the text used in the menu linkColor = '#0000AA'; // sets the color of any text links (usually defined in additional HTML sources) aLinkColor = '#FF0000'; // sets the active link color (when you click on the link) vLinkColor = '#880088'; // sets the visited link color backgroundImage = ''; // give the complete path to a gif or jpeg to use as a background image defaultTargetFrame = 'pageFrame'; // the name of the frame that links will load into by default defaultImageURL = 'images/'; // the URL or path where the OmenTree images are located defaultLinkIcon = 'img-page-globe.gif'; // the default icon image used for links omenTreeFont = 'MS Sans Serif,Arial'; // the font used for the menu omenTreeFontSize = 1; // its size - don't make it too big! // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Additional HTML sources: prefixHTML = ""; suffixHTML = "

最好用IE看這網頁!!
有空請去留言啊!!
~.~
"; } // End Hiding --> 1