Make your own free website on Tripod.com
") doc.write("

Investigação em Ciências da Educação

") redrawNode(foldersTree, doc, 0, 1, "") redrawNode(foldersTree1, doc, 0, 1, "") redrawNode(foldersTree2, doc, 0, 1, "") redrawNode(foldersTree3, doc, 0, 1, "") redrawNode(foldersTree4, doc, 0, 1, "") redrawNode(foldersTree5, doc, 0, 1, "") redrawNode(foldersTree6, doc, 0, 1, "") doc.write("Trata-se de uma versão de visualização em javascript") doc.close() } function redrawNode(foldersNode, doc, level, lastNode, leftSide) { var j=0 var i=0 var l = 0 doc.write("") doc.write("
") doc.write(leftSide) if (level>0) if (lastNode) //the last 'brother' in the children array { 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("") } } } } // ***************************** // Creates the html code to display a folder and its label // ***************************** function displayIconAndLabel(foldersNode, doc) { doc.write("Clique para fechar") else doc.write("images/closedfolder.gif width=24 height=22 border=noborder alt = 'Clique para abrir'>") doc.write("") doc.write(""+foldersNode[3]+"") } // ***************************** // 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]) for (i=4; i< foldersNode.length; i++) clickOnFolderRec(foldersNode[i], folderName) } } // ***************************** // Event handlers // ***************************** //called when the user clicks on a folder function openBranch(branchName) { clickOnFolderRec(foldersTree1, branchName) clickOnFolderRec(foldersTree2, branchName) clickOnFolderRec(foldersTree3, branchName) clickOnFolderRec(foldersTree4, branchName) clickOnFolderRec(foldersTree5, branchName) clickOnFolderRec(foldersTree6, branchName) clickOnFolderRec(foldersTree, branchName) timeOutId = setTimeout("redrawTree()",100) } //called after this html file is loaded function initializeTree() { generateTree() redrawTree() } var foldersTree = 0 var foldersTree1 = 0 var foldersTree2 = 0 var foldersTree3 = 0 var foldersTree4 = 0 var foldersTree5 = 0 var foldresTree6 = 0 var timeOutId = 0 generateTree() // end hiding script -->