//**************************************************************** // Keep this copyright notice: // This copy of the script is the property of the owner of the // particular web site you were visiting. // Do not download the script's files from there. // For a free download and full instructions go to: // http://www.treeview.net //**************************************************************** // Log of changes: // // 08 Jun 04 - Very small change to one error message // 21 Mar 04 - Support for folder.addChildren allows for much bigger trees // 12 May 03 - Support for Safari Beta 3 // 01 Mar 03 - VERSION 4.3 - Support for checkboxes // 21 Feb 03 - Added support for Opera 7 // 22 Sep 02 - Added maySelect member for node-by-node control // of selection and highlight // 21 Sep 02 - Cookie values are now separated by cookieCutter // 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and // can preserve state through external (DB) IDs // 29 Aug 02 - Fine tune 'supportDeferral' for IE4 and IE Mac // 25 Aug 02 - Fixes: STARTALLOPEN, and multi-page frameless // 09 Aug 02 - Fix repeated folder on Mozilla 1.x // 31 Jul 02 - VERSION 4.1 - Dramatic speed increase for trees // with hundreds or thousands of nodes; changes to the control // flags of the gLnk function // 18 Jul 02 - Changes in pre-load images function // 13 Jun 02 - Add ICONPATH var to allow for gif subdir // 20 Apr 02 - Improve support for frame-less layout // 07 Apr 02 - Minor changes to support server-side dynamic feeding // (example: FavoritesManagerASP) // Definition of class Folder // ***************************************************************** function Folder(folderDescription, hreference) //constructor { //constant data this.desc = folderDescription; this.hreference = hreference; this.id = -1; this.navObj = 0; this.iconImg = 0; this.nodeImg = 0; this.isLastNode = 0; this.iconSrc = ICONPATH + "ftv2folderopen.gif"; this.iconSrcClosed = ICONPATH + "ftv2folderclosed.gif"; this.children = new Array; this.nChildren = 0; this.level = 0; this.leftSideCoded = ""; this.isLastNode=false; this.parentObj = null; this.maySelect=true; this.prependHTML = "" //dynamic data this.isOpen = false this.isLastOpenedFolder = false this.isRendered = 0 //methods this.initialize = initializeFolder this.setState = setStateFolder this.addChild = addChild this.addChildren = addChildren this.createIndex = createEntryIndex this.escondeBlock = escondeBlock this.esconde = escondeFolder this.folderMstr = folderMstr this.renderOb = drawFolder this.totalHeight = totalHeight this.subEntries = folderSubEntries this.linkHTML = linkFolderHTML this.blockStartHTML = blockStartHTML this.blockEndHTML = blockEndHTML this.nodeImageSrc = nodeImageSrc this.iconImageSrc = iconImageSrc this.getID = getID this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders } function initializeFolder(level, lastNode, leftSide) { var j=0 var i=0 nc = this.nChildren this.createIndex() this.level = level this.leftSideCoded = leftSide if (browserVersion == 0 || STARTALLOPEN==1) this.isOpen=true; if (level>0) if (lastNode) //the last child in the children array leftSide = leftSide + "0" else leftSide = leftSide + "1" this.isLastNode = lastNode if (nc > 0) { level = level + 1 for (i=0 ; i < this.nChildren; i++) { if (typeof this.children[i].initialize == 'undefined') //document node was specified using the addChildren function { if (typeof this.children[i][0] == 'undefined' || typeof this.children[i] == 'string') { this.children[i] = ["item incorrectly defined", ""]; } //Basic initialization of the Item object //These members or methods are needed even before the Item is rendered this.children[i].initialize=initializeItem; this.children[i].createIndex=createEntryIndex; if (typeof this.children[i].maySelect == 'undefined') this.children[i].maySelect=true this.children[i].forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders } if (i == this.nChildren-1) this.children[i].initialize(level, 1, leftSide) else this.children[i].initialize(level, 0, leftSide) } } } function drawFolder(insertAtObj) { var nodeName = "" var auxEv = "" var docW = "" var i=0 finalizeCreationOfChildDocs(this) var leftSide = leftSideHTML(this.leftSideCoded) if (browserVersion > 0) auxEv = "" else auxEv = "" nodeName = this.nodeImageSrc() if (this.level>0) if (this.isLastNode) //the last child in the children array leftSide = leftSide + "