home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <title>InterCD</title>
-
- <script LANGUAGE="JavaScript">
-
- // More Scripts at www.java-scripts.com
- // Node 0 = opens in right frame
- // Node 1 = opens in new window
-
- function generateTree()
- {
- var aux1, aux2, aux3, aux4
-
- foldersTree = folderNode("InterCD")
- 2
- }
-
- // *****************************
- // Auxiliary function to create the node
- // *****************************
- function folderNode(name)
- {
- var arrayAux
- arrayAux = new Array
- arrayAux[0] = 0
- arrayAux[1] = 0
- arrayAux[2] = 0
- arrayAux[3] = name // folder name.
- arrayAux[4] = 0 // folder=0 file=1
-
-
- return arrayAux
- }
-
- function appendChild(parent, child)
- {
- parent[parent.length] = child
- return child
- }
-
- function generateDocEntry(icon, docDescription, link)
- {
- var retString =""
- var arrayAux
- var altMsg
- arrayAux = new Array
- arrayAux[0] = 0
- arrayAux[1] = 0
- arrayAux[2] = 0
- arrayAux[3] = name // file name.
- arrayAux[4] = 1 // folder=0 file=1
-
- fileName = docDescription.toLowerCase()
- exten=fileName.substring(fileName.length-4, fileName.length)
-
- if((fileName == "setup.exe")||(fileName == "N6setup.exe")||(exten == ".mov")||(exten == ".jpg")||(exten == ".avi")||(exten == ".mp3")
- || (exten == ".scr")||(exten == ".wav")||(exten == ".bmp")||(exten == ".lit")||(exten == ".wsz")||(exten == ".asf")||
- (exten == ".mpg")) {
- altMsg=docDescription
- icon=0
- }
- else
- altMsg=""
-
- if(icon==2) {
- arrayAux[3] = "<img src='cd.gif' alt='Opens in right frame'"
- arrayAux[3] = arrayAux[3] + " border=0><td nowrap><font size=-1 face='Arial, Helvetica'>" + docDescription + "</font>"
-
- return arrayAux
- }
-
-
- if (icon==0)
- arrayAux[3] = "<A href='"+link+"' target=folderFrame><img src='cd.gif' alt='"+altMsg+"'"
- else if(icon==1)
- arrayAux[3] = "<A href='http://"+link+"' target=_blank><img src='link.gif' alt='"+altMsg+"'"
-
-
- arrayAux[3] = arrayAux[3] + " border=0></a><td nowrap><font size=-1 face='Arial, Helvetica'>" + docDescription + "</font>"
-
- return arrayAux
-
- }
-
-
- // *****************************
- // Display functions
- // *****************************
-
- function redrawTree()
- {
- //var scrolTop=0
- var doc = top.treeFrame.window.document
- count=0
- doc.clear()
-
- doc.write("<body bgcolor='white'>")
- redrawNode(foldersTree, doc, 0, 1, "")
- doc.close()
- finalCount--
- scrolTop = finalCount*22
- parent.treeFrame.scrollTo(0,scrolTop)
- parent.treeFrame.scrollTo(0,scrolTop)
- }
- var count
- function redrawNode(foldersNode, doc, level, lastNode, leftSide)
- {
- var j=0
- var i=0
- count++;
- if(topFolder==foldersNode[3])
- {finalCount = count;}
- //alert(foldersNode[3])
- doc.write("<table border=0 cellspacing=0 cellpadding=0><tr><td>")
- doc.write("<table border=0 cellspacing=0 cellpadding=0>")
- doc.write("<tr><td valign = middle nowrap>")
-
- doc.write(leftSide)
-
- if (level>0)
- if (lastNode) //the last 'brother' in the children array
- {
- doc.write("<img src='lastnode.gif' width=16 height=22>")
- leftSide = leftSide + "<img src='blank.gif' width=16 height=22>"
- }
- else
- {
- doc.write("<img src='node.gif' width=16 height=22>")
- leftSide = leftSide + "<img src='vertline.gif' width=16 height=22>"
- }
-
- displayIconAndLabel(foldersNode, doc)
- doc.write("</tr></table>")
- doc.write("</td></tr></table>")
- // there are sub-nodes and the folder is open
- if (foldersNode.length > 5 && !foldersNode[4] && foldersNode[1])
- {
-
- level=level+1
- for (i=5; i<foldersNode.length;i++)
- if (i==foldersNode.length-1)
- redrawNode(foldersNode[i], doc, level, 1, leftSide) // last folder/file
- else
- redrawNode(foldersNode[i], doc, level, 0, leftSide)
- }
- }
-
- // *****************************
- // Creates the html code to display a folder and its label
- // *****************************
- function displayIconAndLabel(foldersNode, doc)
- {
- folName=foldersNode[3]
-
-
-
- str= foldersNode[3].substring(0,1)
- if(str == '^')
- folName=foldersNode[3].substr(1,foldersNode[3].length)
-
- if(foldersNode[4]) // if a file.
- doc.write(foldersNode[3])
- else {
- doc.write("<A href=\"javascript:top.openBranch('"+ foldersNode[3]+'\','+ foldersNode[1] + ")\"><img src=")
- if (foldersNode[1])
- doc.write("openfolder.gif width=24 height=22 border=noborder></a></td>")
- else
- doc.write("closedfolder.gif width=24 height=22 border=noborder></a></td>")
- doc.write("<td valign=middle align=left nowrap>")
- doc.write("<font size=-1 face='Arial, Helvetica'>"+folName+"</font></td>")
- }
- }
-
- // *****************************
- // Recursive functions
- // *****************************
-
- //when a parent is closed all children also are
- 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
- }
-
- //recursive over the tree structure
- //called by openbranch
- function clickOnFolderRec(foldersNode, folderName)
- {
- var i=0
-
- if (foldersNode[3] == folderName)
- {
- if (foldersNode[0])
- closeFolders(foldersNode)
- else
- {
- foldersNode[0] = 1
- foldersNode[1] = 1
- }
- }
- else
- {
- if (!foldersNode[2] && !foldersNode[4])
- for (i=4; i< foldersNode.length; i++)
- clickOnFolderRec(foldersNode[i], folderName)
- }
- }
-
-
- // *****************************
- // Event handlers
- // *****************************
-
- //called when the user clicks on a folder
- function openBranch(branchName, isOpen)
- {
- topFolder= branchName
- progName=branchName.substr(1,branchName.length)
-
- str= branchName.substring(0,1)
- if((str == '^') && (!isOpen))
- top.program.location.href="http://www.enet.co.il/ts.exe?tsurl=11.84.0.0.0&tree=8&tsstmplt=program2&prog="+progName; // program URL.
- clickOnFolderRec(foldersTree, branchName)
- if (branchName=="Start folder" && foldersTree[0]==0)
- top.folderFrame.location="basefolder.htm"
- timeOutId = setTimeout("redrawTree()",100)
- }
-
- //called after this html file is loaded
- function initializeTree()
- {
- generateTree()
- redrawTree()
- }
- var finalCount
- var topFolder
- var foldersTree = 0
- var timeOutId = 0
- generateTree()
-
-
- // end hiding script -->
- </script>
-
-
- </HEAD>
-
- <FRAMESET COLS="200,600" onLoad='initializeTree()' FRAMEBORDER=0 FRAMESPACING=0 BORDER=0 marginwidth="0"
- marginheight="0" scrolling="no">
- <FRAME src="tree.html" name="treeFrame">
-
- <FRAME NAME="program" SRC="http://www.enet.co.il/ts.exe?tsurl=11.84.0.0.0&tsstmplt=program" marginwidth="0"
- marginheight="0" scrolling="yes" frameborder="yes" border="0">
- </FRAMESET>
-
-
- </HTML>