fTversion = "4.04a"
evalVersion = true
//**************************************************************** 
// You are free to copy the original "Folder-Tree" script found in: 
// http://www.geocities.com/Paris/LeftBank/2178/ 
// as long as you keep the copyright notice found in that file. 
// Author: Marcelino Alves Martins (martins@hks.com) December '97.
//
// This modified version of the script, found in:
// includes major changes by Nigel Goodwin (C) Copyright 1998-1999. All rights reserved.
//
// The evaluation license may be found in the file evallicense.txt
// The full purchase license may be found in the file fulllicense.txt
// The developer license may be found in the file developlicense.txt
// By using this software, you signify that you have read this notice and the license and accept its terms.
//
// This notice must be kept in full at the top of this foldertree code.
//********************************************************************* 

var error_count = 0;
window.onerror = errorHandler;
var werr
showmessretry = 0
var errmessage = ""
var errurl = ""
var errline = ""
var errstacktrace = ""
var errid = 0
errloading = false

function errormessage(){
if (!werr.loaded)
	{
	errid = setTimeout("errormessage()",200)
	showmessretry++;
	}
else
	{
	errloading = false
	clearTimeout(errid)
	var f = werr.document.errorfrm
	var n = navigator;
	f.message.value = errmessage;
	f.url.value = errurl;
	f.line.value = errline
	f.useragent.value = n.userAgent
	f.bname.value = n.appName
	f.bversion.value = n.appVersion
	f.bcodename.value = n.appCodeName
	if (n.platform) f.platform.value = n.platform
	if (n.javaEnabled()) f.java.value = "java: " + n.javaEnabled()
	f.fTversion.value = fTversion
	f.evalVersion.value = evalVersion
	f.stacktrace.value = errstacktrace
	if (bV > 0) werr.focus()
	}
if (showmessretry > 200) clearTimeout(errid)
}

function errorHandler(message, url, line)
{
if ((!werr || !werr.loaded) && !errloading){
msgText = ""
if (evalVersion) msgText = "\n\nIt may be because unsigned Java applets are disabled.\n\nIt will continue in a safe mode."
if (confirm("A JavaScript error has occurred - " + message + msgText + "\n\nDo you wish to report this error?"))
{
errloading = false
werr = window.open(ftFolder+"fterror.htm","error"+error_count++,"resizable,status,width=625,height=800");
errloading = true
errmessage = message
errurl = url
errline = line
errstacktrace = stacktrace()
errormessage()
}
if (!javaerror) setTimeout("rewritepage()",500)
javaerror = true;
}
   return true;
}

function stacktrace() {
	var s = "";
	for( a = arguments.caller; a != null; a = a.caller ) {
		s += funcname( a ) + "\n";	
		if( a.caller == a || !a.caller) break;	
		}
	return s;
}
function funcname(f) {
if (f == null) return "anonymous";
if (!f.callee)
	func = f
else
	func = f.callee
int1 = func.toString().indexOf("function")
int2 = func.toString().indexOf("(")
s = func.toString().substring(int1+9,int2)
if ((s == null) || (s.length == 0)) return "anonymous";
return s;
}

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.suid = 0
this.targetFrame = -1
this.linkType = -1
this.openIcon = ""
this.closedIcon = ""
this.openIconOver = ""
this.closedIconOver = ""
this.statusText = ""
this.hidden = false
this.userDef = ""
//dynamic data
this.isOpen = false
this.c = new Array
this.nC = 0
this.nodeLeftSide = ""
this.nodeLevel = 0
this.nodeParent = 0
this.isInitial = false
this.font = ""
//methods
this.initialize = initializeFolder
this.setState = setStateFolder
this.moveState = moveStateFolder
this.addChild = addChild
this.createIndex = createEntryIndex
this.hide = hideFolder
this.display = display
this.initMode = initModeFolder
this.renderOb = drawFolder
this.setFont = setFont
this.setInitial = setInitial
this.setIcon = setFolderIcon
this.setTarget = setTarget
this.setStatusBar = setStatusBar
this.setUserDef = setUserDef
this.getUserDef = getUserDef
this.setNodeFont = setNodeFont
this.setNodeDraw = setNodeDraw
}

function setStateFolder(isOpen)
{
var totalHeight
var fIt = 0
var i=0
this.isOpen = isOpen
if (bV > 0)
	propagateChangesInState(this)
}
function moveStateFolder(isOpen)
{
var totalHeight
var fIt = 0
var i=0
var j=0
var subopen = 1
var parent = 0
var thisnode = 0
var found = false
var width = 0
totalHeight = 0
for (i=0; i < this.nC; i++)
	{
	if (!noDocs || this.c[i].nC != null)
		{
		totalHeight += this.c[i].navObj.clip.height
		if (isOpen)
			width = Math.max(width,this.c[i].navObj.clip.width)
		}
	}
if (!isOpen) totalHeight = - totalHeight
this.navObj.clip.height +=  totalHeight
if (isOpen) this.navObj.clip.width = Math.max(width, this.navObj.clip.width)
thisnode = this
parent = thisnode.nodeParent
for (i=0; i < this.nodeLevel; i++)
	{
	parent.navObj.clip.height +=  totalHeight
	if (isOpen)
		parent.navObj.clip.width = Math.max(width, parent.navObj.clip.width)
	found = false
	for (j=0; j < parent.nC; j++)
		{
//		if (found) parent.c[j].navObj.top += totalHeight
		if (!noDocs || parent.c[j].nC != null)
			{
			if (found) parent.c[j].navObj.moveBy(0,totalHeight)
			else if (parent.c[j] == thisnode) found = true
			}
		}
	thisnode = parent
	parent = thisnode.nodeParent
	}
newHeight= fT.navObj.clip.height + topGap + doc.layers[0].clip.height
frameHeight = self.frames[menuFrame].innerHeight
if (isOpen){
	if (doc.height < newHeight)
		doc.height = newHeight
	else if (newHeight < frameHeight) {
		doc.height = frameHeight
		self.frames[menuFrame].scrollTo(0,0)
	}
       else if (doc.height > newHeight + 0.5*frameHeight){
		doc.height = doc.height*0.5 + (newHeight + 0.5*frameHeight)*0.5
		}
}
doc.layers[0].top = doc.layers[0].top + totalHeight

}

function nodeTIcon (node){
if (node.isOpen)
	{
	if (node.isLastNode)
		tmpIcon = iTA["mln"].src
	else
		tmpIcon = iTA["mn"].src
	}
else
	{
	if (node.isLastNode)
		tmpIcon = iTA["pln"].src
	else
		tmpIcon = iTA["pn"].src
	}
if (noDocs)
	{
	folderChildren = false
	for (i=0 ; i < node.nC; i++)
		{
		if (node.c[i].nC != null) folderChildren = true
		}
	if (!folderChildren) 
		if (node.isLastNode)
			tmpIcon = iTA["ln"].src
		else
			tmpIcon = iTA["n"].src
	}
if (treeLines == 0) tmpIcon = iTA["b"].src
return tmpIcon
}

function propagateChangesInState(folder)
{
var i=0
if (folder.nodeImg) folder.nodeImg.src = nodeTIcon(folder)

if (folder.isOpen)
	{
	for (i=0; i<folder.nC; i++)
		if (!noDocs || folder.c[i].nC != null)
			folder.c[i].display()

	}
else
	{
	if (folder.isInitial)
		for (i=0; i<folder.nC; i++) 
			if (!noDocs || folder.c[i].nC != null)
				folder.c[i].hide()
	}

var iA = iNA
folder.iconImg.src = nodeIcon(folder,"",iA)
}
function display()
{
var i=0
if (bV == 1)
	this.navObj.style.display = "block"
else if (bV ==2)
	this.navObj.visibility = "show"
if (bV == 1)
	{
	if (this.isInitial && this.isOpen)
		for (i=0; i < this.nC; i++)
			if (!noDocs || this.c[i].nC != null)
				this.c[i].display()
	}
}
function hideFolder()
{
var i = 0
if (bV == 1)
	{
	this.navObj.style.display = "none"
	}
else
	{
	this.navObj.visibility = "hidden"
	}
if (bV == 1)
	{
	if (this.isInitial)
		for (i=0; i<this.nC; i++)
			{
			if (!noDocs || this.c[i].nC != null)
				this.c[i].hide()
			}
	}
}
function initializeFolder(level, lastNode, leftSide, doc, prior)
{
var j=0
var i=0
var numberOfFolders
var numberOfDocs
var nc
var totalHeight
var parent = 0
var found = false
var oldyPos
var width = 0
nc = this.nC
this.createIndex()
	this.nodeLevel = level
var auxEv = ""
auxEv = "<a href='javascript:;' onClick='return parent.clickOnNode("+this.id+");'"
auxEv += " onMouseOver='return parent.mouseOverNode(0,"+this.id+");'"
auxEv += " onMouseOut='return parent.mouseOutNode(0,"+this.id+");' alt=''>"
if (level>0)
	{
	if (lastNode) this.isLastNode = 1
	else this.isLastNode = 0
	tmpIcon = nodeTIcon(this)
	if (this.isLastNode == 1)
		tmp2Icon = iTA["b"].src
	else
		tmp2Icon = iTA["vl"].src
	if (treeLines == 0) tmp2Icon = iTA["b"].src
	if (this.hidden == false) this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' src='" + tmpIcon + "' border=0 alt=''></a>", doc, prior)
	leftSide +=  "<img src='" + tmp2Icon + "' >"
	}
else
	{
	doc.yPos = null
	this.renderOb("", doc, prior, "")
	}
this.nodeLeftSide = leftSide
if (nc > 0 && this.isInitial)
	{
	level = level + 1
	if (bV == 2)
		{
		oldyPos = doc.yPos
		doc.yPos = this.navObj.clip.height
		totalHeight = 0
		}
	for (i=0 ; i < this.nC; i++)
		{
		this.c[i].nodeParent = this
		if (noDocs)
			{
			newLastNode = 1
			for (j=i+1; j < this.nC; j++)
				if (this.c[j].nC != null) newLastNode = 0
			}
		else
			{
			newLastNode = 0
			if (i == this.nC-1) newLastNode = 1
			}
		if (!noDocs || this.c[i].nC != null)
			{
			this.c[i].initialize(level, newLastNode, leftSide, doc, prior)
			if (bV == 2)
				{
				totalHeight +=  this.c[i].navObj.clip.height
				width = Math.max(width,this.c[i].navObj.clip.width)
				}
			}
		}
	if (bV == 2)
		{
		if (this.isOpen)
			{
			doc.yPos = oldyPos + totalHeight
			this.navObj.clip.height += totalHeight
			this.navObj.clip.width = Math.max(width, this.navObj.clip.width)
			}
		else
			{
			doc.yPos = oldyPos
			}
		}
	}
}
function drawFolder(leftSide,doc, prior)
{
var strbuf = ""
var font
if (bV > 0) nEntries--;
if (bV == 2)
	{
	if (!doc.yPos)
		{
		doc.yPos=topGap
		strbuf += "<LAYER id='menuFooter' top=" + doc.yPos + " visibility=show>" + menuFooter + "</LAYER>"
		strbuf += "<layer id='folder" + this.id + "' top=" + doc.yPos + " visibility=show>"
		strbuf += menuHeader
		rootfolder = true
		}
	else
		{
		rootfolder = false
		testlayer = new Layer(400, this.nodeParent.navObj)
		testlayer.visibility = "show"
		testlayer.name = "folder"+this.id
		testlayer.top = doc.yPos
	}
}
this.setNodeDraw(leftSide,strbuf,0)
if (doc.all)
	{
	this.navObj = doc.all["folder"+this.id]
	this.iconImg = doc.all["folderIcon"+this.id]
	this.nodeImg = doc.all["nodeIcon"+this.id]
	}
else if (doc.layers)
	{
	if (bV == 2)
		{
		if (rootfolder)
			{
			this.navObj = doc.layers[1]
			doc.yPos=doc.yPos+this.navObj.clip.height
			}
		else
			{
			this.navObj = testlayer
			doc.yPos=doc.yPos+this.navObj.clip.height
			}
		this.iconImg = this.navObj.document.images["folderIcon"+this.id]
		this.nodeImg = this.navObj.document.images["nodeIcon"+this.id]
		}
	else
		{
		this.navobj = doc.images["folder"+this.id]
		this.iconImg = doc.images["folderIcon"+this.id]
		this.nodeImg = doc.images["nodeIcon"+this.id]
		}
	}
}
function Item(itemDescription, hreference) // Constructor
{
// constant data
this.desc = itemDescription
this.hreference = hreference
this.id = -1 
this.navObj = 0 
this.iconImg = 0
this.hidden = false
this.suid = 0
this.font = ""
this.isInitial = false
this.targetFrame = -1
this.linkType = -1
this.iconName = ""
this.iconNameOver = ""
this.statusText = ""
this.userDef = ""
// methods
this.initialize = initializeItem
this.createIndex = createEntryIndex
this.hide = hideItem
this.display = display
this.renderOb = drawItem
this.initMode = initModeItem
this.setFont = setFont
this.setInitial = setInitial
this.setIcon = setItemIcon
this.setTarget = setTarget	
this.setStatusBar = setStatusBar	
this.setUserDef = setUserDef
this.getUserDef = getUserDef
this.setNodeFont = setNodeFont
this.setNodeDraw = setNodeDraw
}
function hideItem()
{
if (bV == 1) {
	if (this.navObj.style.display == "none")
	return
	this.navObj.style.display = "none"
	} else {
		if (this.navObj.visibility == "hidden")
		return
	this.navObj.visibility = "hidden"
	}
}
function initializeItem(level, lastNode, leftSide, doc, prior)
{
this.createIndex()
this.isInitial = true
	this.nodeLevel = level
if (level>0)
{
if (lastNode)
	{
	tmpIcon = iTA["ln"].src
	tmp2Icon = iTA["b"].src
	}
else
	{
	tmpIcon = iTA["n"].src
	tmp2Icon = iTA["vl"].src
	}
if (treeLines == 0) tmpIcon = iTA["b"].src
if (treeLines == 0) tmp2Icon = iTA["b"].src
if (this.hidden == false) this.renderOb(leftSide + "<img src='" + tmpIcon + "' >", doc, prior)
leftSide = leftSide + "<img src='" + tmp2Icon + "' >"
}
else
this.renderOb("", doc, prior, "")
}
function drawItem(leftSide, doc, prior)
{
var strbuf = ""
var font
if (bV == 2)
	{
	testlayer = new Layer(400, this.nodeParent.navObj)
	testlayer.visibility ="show"
	testlayer.name = "item"+this.id
	testlayer.top = doc.yPos
	}
this.setNodeDraw(leftSide,strbuf,1)
if (doc.all){
	this.navObj = doc.all["item"+this.id]
	this.iconImg = doc.all["itemIcon"+this.id]
	}
else
	{
	if (doc.layers && bV == 2)
		{
		this.navObj = testlayer
		this.iconImg = this.navObj.document.images["itemIcon"+this.id]
		doc.yPos=doc.yPos+this.navObj.clip.height
		}
	else if (doc.layers && bV == 0)
		{
		this.navObj = doc.images["item"+this.id]
		this.iconImg = doc.images["itemIcon"+this.id]
		}
	}
}
function setNodeDraw(leftSide,strbuf,nodetype)
{
fullLink = ""
linkFrame = ""
if (this.targetFrame == -1)
targetFrame = defTargetFrame
else
targetFrame = this.targetFrame
if (targetFrame == 0) linkFrame = "target=\"" + baseFrame + "\""
else if (targetFrame == 1) linkFrame = "target=_blank"
else if (targetFrame == 2) linkFrame = "target=_top"
if (this.linkType == -1)
linkType = defLinkType
else
linkType = this.linkType
linkURL = ""
if (linkType == 0) linkURL = ""
else if (linkType == 1) linkURL = "http://"
else if (linkType == 2) linkURL = "fttp://"
if (this.hreference)
	{
	linkText = commonLink + this.hreference
	int1 = linkText.indexOf("this\.id")
	if (int1 != -1) {
	linkText = linkText.substring(0,int1) + this.id + linkText.substring(int1+7)
	}
//	if (bV > 0) eval("linkText = linkText.replace(/this\.id/i,this.id)");
	fullLink = " href='" + linkURL + linkText + "' " + linkFrame
	}
else
	fullLink = " href='javascript:;' "
fullLink += " onMouseOver='return parent.mouseOverNode(1,"+this.id+");' "
fullLink += " onMouseOut='return parent.mouseOutNode(1,"+this.id+");' "
if (nodetype == 0)
fullLink += " onClick='return parent.clickOnFolder("+this.id+");' "
if (this.statusText == "")
	var toolTip= this.desc
else
	var toolTip = this.statusText
if (bV > 0) eval("toolTip = toolTip.replace(/<[^<>]*>/g,'');");
fullLink += " TITLE ='" + toolTip + "' "

strbuf += "<table id='"
if (bV == 1)
	if (nodetype == 0)
		strbuf += "folder"
	else
		strbuf += "item"
strbuf += this.id + "' style='position:block;' "
strbuf += " border=0 cellspacing=0 cellpadding=0><tr><td valign = middle nowrap>" + leftSide
strbuf += "<a " + fullLink + "><img name='"
if (nodetype == 0)
	strbuf += "folderIcon"
else
	strbuf += "itemIcon"
strbuf += this.id + "' "
var iA = iNA
tmpIcon = nodeIcon(this,"",iA)
strbuf += "src='" + tmpIcon + "' border=0 align = 'absmiddle' alt = '" + toolTip + "'>"
if (nodetype == 0)
	var space = folderIconSpace
else
	var space = documentIconSpace
if (space > 0) {
hspace = parseInt("" + (space/2 + .5) + "")
wspace = 1
if (hspace*2 == space) wspace = 2
hspace = hspace - 1; 
strbuf += "<IMG border=0 align = 'absmiddle' height = '" + wspace + "' width = '" + wspace + "' src='" + iTA["b"].src + "' hspace = '" + hspace + "'>"
}
strbuf += "</a></td><td valign=middle nowrap>"
font = this.setNodeFont(nodetype)
if (useTextLinks && this.hreference)
strbuf += "<a " + fullLink + " >" + font + this.desc + "</font></a>"
else
strbuf += font + this.desc + "</font>"
strbuf += "</td></tr></table>"
if (bV == 0) doc.write(strbuf)
else
	{
	doc.EssfT.setBrowserVersion(bV);
	doc.EssfT.setEntries(nEntries);
	if (nodetype == 0) 
		strBV = "" + doc.EssfT.getFolderJScript().toString();
	else
		strBV = "" + doc.EssfT.getItemJScript().toString();
	eval(strBV)
	}
}

function setNodeFont(nodetype)
{
font = "<FONT>"
if (!levelDefFont[this.nodeLevel])
	levelDefFont[this.nodeLevel] = ""
if (this.font != "")
	font = this.font
else
	if (levelDefFont[this.nodeLevel] != "")
		font = levelDefFont[this.nodeLevel]
	else
		if (defFolderFont != "" && nodetype == 0)
			font = defFolderFont
		else
			if (defDocFont != "" && nodetype == 1)
				font = defDocFont
return font;
}

function createEntryIndex()
{
this.id = nEntries
indexOfEntries[nEntries] = this
nEntries++
}
function mouseOverNode(type,folderId)
{
var mouseNode = 0
mouseNode = indexOfEntries[folderId]
if (type == 0)
	if (mouseNode.isOpen)
		{
		setStatus("Click to close")
		if (mouseOverPMMode == 2) clickOnNode(folderId)
		}
	else
		{
		setStatus("Click to open")
		if (mouseOverPMMode > 0) clickOnNode(folderId)
		}
else if (type == 1)
	{
	clearTimeout(timeoutIDOver)
	if (mouseNode.statusText == "")
		{
		setStatus(mouseNode.desc)
		}
	else
		{
		setStatus(mouseNode.statusText)
		}
	if (mouseNode.isOpen != null)
		if ((mouseNode.isOpen && mouseOverIconMode == 2) || mouseOverIconMode > 0) timeoutIDOver = setTimeout("clickOnNode(" + folderId + ")",500)
	}
if (document.images && type == 1)
	{
	over = "Over"
	var iA = iNAO
	mouseNode.iconImg.src = nodeIcon(mouseNode,over,iA)
	}
return true;
}
function clickOnFolder(folderId)
{
var clickNode = 0
clickNode = indexOfEntries[folderId]
if (clickIconMode == 1 && clickNode.isOpen != null)
	if(!clickNode.isOpen)
		clickOnNode(folderId)
else if (clickIconMode == 2 && clickNode.isOpen != null)
		clickOnNode(folderId)
return true;
}
function nodeIcon(node,over,iA){

	tmpIcon = ""
	if (node.isOpen != null)
		{
		if (node.isOpen)
			{
			if (node["openIcon"+over] != "")
				tmpIcon = imageArray[node["openIcon"+over]].src
			else if (node.nodeLevel == 0)
				tmpIcon = iA["tOF"].src
			else
				tmpIcon = iA["oF"].src
			}
		else
			{
				if (node["closedIcon" + over] != "")
					tmpIcon = imageArray[node["closedIcon"+over]].src
				else if (node.nodeLevel == 0)
					tmpIcon = iA["tCF"].src
				else
					tmpIcon = iA["cF"].src
			}
		}
	else
		{
		if (node["iconName"+over] != "")
			tmpIcon = imageArray[node["iconName"+over]].src
		else
			tmpIcon = iA["d"].src
		}
	if (tmpIcon == "") tmpIcon = iTA["b"].src

return tmpIcon;
}
function mouseOutNode(type,folderId)
{
var mouseNode = 0
mouseNode = indexOfEntries[folderId]
clearTimeout(timeoutIDOver)
if (document.images && type == 1)
	{
	over = ""
	var iA = iNA
	mouseNode.iconImg.src = nodeIcon(mouseNode,over,iA)
	}
setStatus("")
return true;
}
function setStatus(statusText){
var str = statusText
if (bV > 0)
	eval("str = str.replace(/<[^<>]*>/g,'');")
top.window.defaultStatus = ""
top.window.status = str
self.frames[menuFrame].window.defaultStatus = str
self.frames[menuFrame].window.status = str
if (bV == 0)
	{
	clearTimeout(timeoutID)
	timeoutID = setTimeout("top.window.status = ''",5000)
	}
}
function clickOnNode(folderId)
{
var cF = 0
var state = 0
oldwinheight = self.frames[menuFrame].innerHeight
oldwinwidth = self.frames[menuFrame].innerWidth
cF = indexOfEntries[folderId]
state = cF.isOpen
if (!state)
	{
	if (cF.isInitial == false)
		{
		if(cF.nC == 0) 
			if (!addToTree)
				alert("Folder has no children")
			else
				if (addToTree(cF) == true) return false;
		if(cF.nC > 0)
			{
			if (bV == 2) doc.yPos = cF.navObj.clip.height
			if (bV == 1) prior = cF.navObj
			if (bV > 0)
				{
				level = cF.nodeLevel
				leftSide = cF.nodeLeftSide
				for (var i=0 ; i < cF.nC; i++)
					{
					cF.c[i].nodeParent = cF
					if (i == cF.nC-1)
						newLastNode = 1
					else
						last = 0
					if (noDocs)
						{
						newLastNode = 1
						for (var j=i+1; j < cF.nC; j++)
							if (cF.c[j].nC != null) newLastNode = 0
						}
					else
						{
						newLastNode = 0
						if (i == cF.nC-1) newLastNode = 1
						}
					if (!noDocs || cF.c[i].nC != null)
						{
						cF.c[i].initialize(level + 1, newLastNode, leftSide, doc, prior)
						if (bV == 1) prior = cF.c[i].navObj
						}
					}
				}
			cF.isInitial = true
			}
		}
	}
else
	if (bV == 0) cF.isInitial = false

cF.setState(!state) //open<->close
if (bV == 2)cF.moveState(!state);
if (!state && modalClick && (cF.nodeLevel > 0))
	for (i=0; i < cF.nodeParent.nC; i++)
		{
		if (cF.nodeParent.c[i].isOpen && (cF.nodeParent.c[i] != cF))
			{
			if (bV == 2) cF.nodeParent.c[i].moveState(false)
			if (bV == 0) cF.nodeParent.c[i].isInitial = false
			cF.nodeParent.c[i].setState(false)
			}
		}
if (bV == 0)
	setTimeout("rewritepage()",50)
else
	doc.close()
return false;
}
function initModeItem()
{
if (initialMode == 2)
	this.isInitial = true
}
function initModeFolder()
{
var i=0
if (initialMode == 2)
	{
	this.isOpen = true
	this.isInitial = true
	}
for (i=0; i<this.nC; i++)
	{
	this.c[i].initMode()
	if (this.c[i].isOpen && this.c[i].isInitial)
		{
		this.isOpen = true
		this.isInitial = true
		}
	}
}
function initializeDocument()
{
if (firstInitial)
	{
	if (initialMode == 0)
		{
		fT.isInitial = false
		fT.isOpen = false
		}
	if (initialMode == 1)
		{
		fT.isInitial = true
		fT.isOpen = true
		}
	fT.initMode()
	}
prior = null
fT.initialize(0, 1, "", doc, prior)
fT.display()
if (bV == 2) doc.height = fT.navObj.clip.height + topGap + doc.layers[0].clip.height
firstInitial = false
}
function gFld(d, h, suid)
{
folder = new Folder(d, h)
if (suid != null)
	folder.suid = suid;
return folder
}
function gLnk(d, h, suid)
{
linkItem = new Item(d, h)
if (suid != null)
	linkItem.suid = suid;
return linkItem
}
function insFld(p, c)
{
return p.addChild(c)
}
function insDoc(p, d)
{
return p.addChild(d)
}
function addChild(childNode)
{
this.c[this.nC] = childNode
this.nC++
return childNode
}
function setFont(font){
this.font = font
return
}
function setInitial(initial){
if (initial)
	{
	this.isInitial = true
	this.isOpen = true
	}
return
}
function setFolderIcon(o,c, oO,cO){
if (o != null) this.openIcon = o
if (c != null) this.closedIcon = c
if (oO != null) this.openIconOver = oO
if (cO != null) this.closedIconOver = cO
return
}
function setItemIcon(i, iO){
if (i != null) this.iconName = i
if (iO != null) this.iconNameOver = iO
return
}
function fTimage(f){
this.src = iconFolder + f
return
}
function addImage(name, f){
if (bV == 0)
	imageArray[name] = new fTimage(f)
else
	{
	imageArray[name] = new Image()
	imageArray[name].src = iconFolder + f
	}
nImageArray++
}
function addIcon(icon,prop,f) {
if (bV == 0)
	icon[prop] = new fTimage(f)
else
	{
	icon[prop] = new Image()
	icon[prop].src = iconFolder + f
	}
}
function setTarget(t){
if (t >= 0 && t <= 2)
	this.targetFrame = t
return
}
function setStatusBar(s){
if (s != null) this.statusText = s
return
}
function setUserDef(name,text){
if (text != null) this.userDef += "<" + name + ">" + text + "</" + name + ">"
return
}
function getUserDef(name){
substr1 = "<" + name + ">"
substr2 = "</" + name + ">"
length1 = substr1.length
index1 = this.userDef.indexOf(substr1)
index2 = this.userDef.indexOf(substr2)
if (index1 == -1 || index2 == -1) return "";
return this.userDef.substring(index1+length1,index2);
}
function initImage(){
addIcon(iNA,"tOF",topOpenFolderIcon)
addIcon(iNA,"tCF",topClosedFolderIcon)
addIcon(iNA,"oF",openFolderIcon)
addIcon(iNA,"cF",closedFolderIcon)
addIcon(iNA,"d",documentIcon)
addIcon(iNAO,"tOF",topOpenFolderIconOver)
addIcon(iNAO,"tCF",topClosedFolderIconOver)
addIcon(iNAO,"oF",openFolderIconOver)
addIcon(iNAO,"cF",closedFolderIconOver)
addIcon(iNAO,"d",documentIconOver)
addIcon(iTA,"mn",mnIcon)
addIcon(iTA,"pn",pnIcon)
addIcon(iTA,"pln",plnIcon)
addIcon(iTA,"mln",mlnIcon)
addIcon(iTA,"b",bIcon)
addIcon(iTA,"ln",lnIcon)
addIcon(iTA,"vl",vlIcon)
addIcon(iTA,"n",nIcon)

}
function blank() {
ret = "<HTML><HEAD><link rel='stylesheet' href='" + styleSheetFile + "'>"
if (bV < 2 ) ret += "<BASE HREF='" + document.location + "'>"

ret += "</HEAD><BODY " + bodyOption + ">"
if (!javaerror && document.layers && evalVersion)
	{
	if (ftFolder == "")
		ret += "<APPLET CODE='EssfT.class' NAME = 'EssfT' width='1' height = '1'></APPLET>"
	else
		ret += "<APPLET CODE='EssfT.class' CODEBASE = '" + ftFolder + "' NAME = 'EssfT' width='1' height = '1'></APPLET>"
	}
ret += "<B><CENTER>Please wait for menu<BR>to be constructed</B><P>"
ret += "<font size=-1>Loading auxiliary bitmaps:<br>"
initImage()
subret = "<img src='"
for (var propname in iNA)
	if (iNA[propname].src != "") ret += subret + iNA[propname].src + "'>"
for (var propname in iNAO)
	if (iNAO[propname].src != "") ret += subret + iNAO[propname].src + "'>"
for (var propname in iTA)
	if (iTA[propname].src != "") ret += subret + iTA[propname].src + "'>"
for (var propname in imageArray)
	ret += subret + imageArray[propname].src + "'>"
ret += "<br></CENTER></BODY></HTML>"
return ret
}
function rewritepage() {
if (rewriting) return false;
rewriting = true
if (!fT)
{
alert("No menu structure")
rewriting = false
return false;
}
doc = self.frames[menuFrame].window.document

if (doc.all)
	bV = 1
else
	if (doc.layers)
		bV = 2
	else
		bV = 0
if (bV == 2) self.onresize = self.handleResize
if (bV == 1 && !javaerror && evalVersion)
	//if (confirm("You are running Internet Explorer version 4 or above.\n\nIn some environments, for this evaluation version only, there may be errors arising from the Java applet. If these occur, foldertree automatically goes into a safe mode.\n\n However, if you have the script debugger installed, this cannot take place, so you should please disable the debugger. This can be done under Internet options, under the Advanced tab.\n\nThese problems do not occur in the full license version.\n\nAlternatively you can manually set foldertree to continue in a safe mode. This is fully functional, but does not perform as fast as the normal mode.\n\nDo wish to set foldertree to the safe mode?"))
	//if (confirm("Confirmez l'affichage en cours ?"))
			
		javaerror = true

if (bV == 2) {
	if (doc.width == 0)
	{
	clearTimeout(rewriteID)
	rewriteID = setTimeout("rewritepage()",1000)
	rewriting = false
	return false;
	}
}
if (evalVersion && javaerror) bV = 0
setStatus("Please wait for menu.")
if (bV < 2) doc.open()
nEntries = 0
cumulHeight = 0
doc = self.frames[menuFrame].window.document
doc.write("<html><head><link rel='stylesheet' href='" + styleSheetFile + "'>")
if (bV < 2 ) doc.write("<BASE HREF='" + document.location + "'>");
doc.write("<Title></Title></head>")
resizestr = ""
if (bV == 2) resizestr = "onResize = 'parent.handleResize(event)' "
doc.write("<Title></Title></head><BODY " + resizestr + bodyOption + ">")
setStatus("Please wait for menu.")
initImage()
if (bV == 2) self.onresize = self.handleResize
if (evalVersion)
	{

	if (bV > 0)
		{
		if (!navigator.javaEnabled())
			{
			alert("Java not enabled.\n\nThe page will reload and continue in a safe mode.");
			clearTimeout(rewriteID)
			if (!javaerror) rewriteID = setTimeout("rewritepage()",1000)
			javaerror = true
			rewriting = false
			return false;
			}
		}
	if (bV == 1)
		{
		if (ftFolder == "")
			doc.write("<APPLET CODE='EssfT.class' id = 'EssfT' width='1' height = '1'></APPLET>")
		else
			doc.write("<APPLET CODE='EssfT.class' CODEBASE = '" + ftFolder + "' id = 'EssfT' width='1' height = '1'></APPLET>")
		testwin=window.open("","test","width=1,height=1")
		testwin.close()
		}
	if (bV > 0)
		{
		if (doc.EssfT == null)
			{
			//alert("reloading - applet null")
			doc.location.href="javascript:parent.blank()"
			clearTimeout(rewriteID)
			rewriteID = setTimeout("rewritepage()",1000)
			rewriting = false
			return false;
			}
		}
	}
if (bV < 2 && menuHeader != "")
	{
	doc.write(menuHeader + "<BR>")
	}
initializeDocument()
if (bV < 2 )
	{
	doc.write("<BR>" + menuFooter + "</BODY></HTML>")
	doc.close()
	}
if (bV == 2)
	{
	doc.layers[0].top = doc.yPos
	doc.layers[0].visibility = "show"
	}
oldwinheight = self.frames[menuFrame].window.innerHeight
oldwinwidth = self.frames[menuFrame].window.innerWidth
setStatus("")
rewriting = false
return false;
}

function handleResize(evt) {
if (rewriting) {
alert("Please do not resize window while menu is loading.\n\n Resize again to redraw menu.")
rewriting = false
return false
}
if (evt.target.name == menuFrame)
	{
	remenu = false
	if(!(oldwinheight == evt.target.innerHeight && oldwinwidth == evt.target.innerWidth))
		{
		clearTimeout(rewriteID)
		rewriteID = setTimeout("rewritepage()",1000)
		rewriting = false
		remenu = true
		}
	}
else
	{
	if(!(oldtopheight == evt.target.innerHeight && oldtopwidth == evt.target.innerWidth))
		{
		if (!remenu){
			clearTimeout(rewriteID)
			rewriteID = setTimeout("rewritepage()",1000)
			rewriting = false
		}
		oldtopheight = evt.target.innerHeight
		oldtopwidth = evt.target.innerWidth
		}
	remenu = false
	}
return false;
}

// Global variables
// ****************
indexOfEntries = new Array
var nEntries = 0
var selectedNode = 0
var bV = 0
var cumulHeight = 0
var javaerror = false
var doc = document
var oldwinheight = 0
var oldwinwidth = 0
var oldtopheight = 0
var oldtopwidth = 0
levelDefFont = new Array
var remenu = false
var firstInitial = true
top.window.defaultStatus = "";
iNA = new Object()
iNAO = new Object()
iTA = new Object()
imageArray = new Object()
var nImageArray = 0
timeoutID = 0
timeoutIDOver = 0
rewriteID = 0
rewriting = false
fT = 0
addToTree = 0
mnIcon = "ftmn.gif";
pnIcon = "ftpn.gif";
plnIcon = "ftpln.gif";
mlnIcon = "ftmln.gif";
bIcon = "ftb.gif";
lnIcon = "ftln.gif";
vlIcon = "ftvl.gif";
nIcon = "ftn.gif";

