outputFrame.write("\n\n"); outputFrame.close(); window.status="OmenTree v1.0"; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 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("Klicka för att öppna mappen") outputFrame.write("Klicka för att öppna mappen " + 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("Klicka för att öppna mappen") outputFrame.write("Klicka för att öppna mappen " + 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','neggard','html/main.html','','')); // Root Node MUST be first! treeData.add(new LinkNode('root','Nätverk','html/net.html','','')); treeData.add(new LinkNode('root','Kortkommanddo','html/kort.html','','')); treeData.add(new LinkNode('root','Registret','html/reg.html','','')); treeData.add(new LinkNode('root','Bra att veta','html/bra.html','','')); treeData.add(new LinkNode('root','Logo','html/logo.html','','')); treeData.add(new LinkNode('root','Kolla din Hotmail','html/mail.html','','')); treeData.add(new LinkNode('root','Skicka SMS','html/sms.html','','')); treeData.add(new LinkNode('root','Downloadcalculator','html/calc.html','','')); treeData.add(new LinkNode('root','Landskoder','html/kod.html','','')); treeData.add(new LinkNode('root','Filändelser','html/fil.html','','')); treeData.add(new LinkNode('root','$$$','html/dollar.html','','')); treeData.add(new LinkNode('root','Smilyes','html/smil.html','','')); treeData.add(new LinkNode('root','Anslagstavla','html/anslag.html','','')); treeData.add(new LinkNode('root','Länkar','html/links.html','','')); treeData.add(new LinkNode('root','Medela mig...','html/syn.html','','')); treeData.add(new LinkNode('root','Gästbok','http://cgi.swipnet.se/apps/guestbook?backlink=false&bgcolor=0068D0&text=000000&link=ff2244&vlink=ffcc00&alink=3399FF','','')); treeData.add(new FolderNode('engines','root','Sökmotorer','','')); treeData.add(new LinkNode('engines','AltaVista','http://www.altavista.digital.com','_blank','img-page-link.gif')); treeData.add(new LinkNode('engines','InfoSeek','http://www.infoseek.com','_blank','img-page-link.gif')); treeData.add(new LinkNode('engines','HotBot','http://www.hotbot.com','_blank','img-page-link.gif')); treeData.add(new LinkNode('engines','WebCrawler','http://www.webcrawler.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','Excite','http://www.excite.com','_blank','img-page-link.gif')); treeData.add(new LinkNode('engines','Lycos','http://www.lycos.com','_blank','img-page-link.gif')); treeData.add(new LinkNode('engines','Magellan','http://www.mckinley.com','_blank','img-page-link.gif')); treeData.add(new FolderNode('favs','root','Favorites','img-folder-closed-fav.gif','img-folder-open-fav.gif')); treeData.add(new FolderNode('HTML&Java','favs','HTML&Java','','')); treeData.add(new LinkNode('HTML&Java','Atiger','http://www.atiger.pp.se/sida.html','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('HTML&Java','Cadell','http://hem.passagen.se/cadell/html/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('HTML&Java','Erimax','http://www.erimax.com/se/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('HTML&Java','JsWorld','http://www.jsworld.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('HTML&Java','Wsabstract','http://www.wsabstract.com/','_blank','img-page-globe-link.gif')); treeData.add(new FolderNode('Software','favs','Software','','')); treeData.add(new LinkNode('Software','WinZip','http://www.winzip.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','WinRar','http://www.rarsoft.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','WinAce','http://www.winace.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','FlashFXP','http://flashfxp.phix-it.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','mIRC','http://www.mirc.com','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','WinAmp','http://www.winamp.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','Svenska Sharewarelistan','http://www.ssw.nu/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','Freeware','http://www.freewarehome.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('Software','Nonags','http://ftp.sunet.se/nonags/index.html','_blank','img-page-globe-link.gif')); treeData.add(new FolderNode('cd','favs','CD bränning','','')); treeData.add(new LinkNode('cd','CD Media World','http://www.cdmediaworld.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('cd','Adaptec','http://www.adaptec.com/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('cd','CDRwin','http://www.goldenhawk.de/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('cd','Nero','http://www.nero.com/','_blank','img-page-globe-link.gif')); treeData.add(new FolderNode('driv','favs','Drivrutiner','','')); treeData.add(new LinkNode('driv','dll Archive','http://solo.abac.com/dllarchive/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('driv','Modem','http://home.swipnet.se/tydal/modem/','_blank','img-page-globe-link.gif')); treeData.add(new LinkNode('driv','WinDrivers','http://www.windrivers.com/','_blank','img-page-globe-link.gif')); treeData.add(new FolderNode('newsg','root','Newsgroups','','')); treeData.add(new LinkNode('newsg','comp.lang.javascript','news:comp.lang.javascript','','img-newsgroup.gif')); treeData.add(new FolderNode('email','root','E-mail','','')); treeData.add(new LinkNode('email','neggard','mailto:neggard@hotmail.com','','img-email.gif')); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // User defined variables: structureStyle = 0; // 0 for light background, 1 for dark background backgroundColor = '#0068D0'; // 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 = 'omenimages/'; // 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,Helvetica'; // the font used for the menu omenTreeFontSize = 1; // its size - don't make it too big! // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Additional HTML sources: prefixHTML = ""; } // End Hiding -->