//fTversion = "4.70"
//evalVersion = true
//**************************************************************** 
// Arvore ou Menu em forma de arvore - "Folder-Tree" script 
// Este arquivo e parte do pacote Folder-Tree (FT)
// 
// Autor: Romildo Cantalice (romildo@midiarte.com.br) Mar/2002.
//
//********************************************************************* 

var nomeicone;
error_count = 0;
//window.onerror = errorHandler;
var werr;
showmessretry = 0
errmessage = ""
errurl = ""
errline = ""
errstacktrace = ""
errid = 0
errloading = false
seval = "retVal = String.fromCharCode(10,102,117,110,99,116,105,111,110,32,117,110,115,99,114,97,109,98,108,101,40,41,32,123,10,32,32,32,32,115,32,61,32,34,114,101,116,86,97,108,32,61,32,83,116,114,105,110,103,46,102,114,111,109,67,104,97,114,67,111,100,101,40,34,59,10,32,32,32,32,102,111,114,32,40,118,97,114,32,105,32,61,32,48,59,32,105,32,60,32,97,114,103,117,109,101,110,116,115,46,108,101,110,103,116,104,59,32,105,43,43,41,32,123,10,32,32,32,32,32,32,32,32,105,99,104,97,114,32,61,32,97,114,103,117,109,101,110,116,115,91,105,93,32,43,32,49,59,10,32,32,32,32,32,32,32,32,115,32,43,61,32,105,99,104,97,114,32,43,32,34,44,34,59,10,32,32,32,32,125,10,32,32,32,32,115,32,61,32,115,46,115,117,98,115,116,114,105,110,103,40,48,44,32,115,46,108,101,110,103,116,104,32,45,32,49,41,59,10,32,32,32,32,115,32,43,61,32,34,41,34,59,10,32,32,32,32,101,118,97,108,40,115,41,59,10,32,32,32,32,114,101,116,117,114,110,32,114,101,116,86,97,108,59,10,125,10)"
eval(seval)
eval(retVal)

/*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 (confirm("Ocorreu um erro de JavaScript na linha " + line + " - " + message + msgText + "\n\nVoc&ecirc; deseja reportar este erro?"))
{
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()
}
rewriting = false
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 Node(folderDescription, hreference)
{
this.desc = folderDescription
this.hreference = hreference
this.id = -1
this.navObj = null
this.divObj = null
this.iconImg = null
this.nodeImg = null
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 = ""
this.isOpen = false
this.checked = true
this.checkBox = true
this.c = new Array()
this.nC = 0
this.nodeLeftSide = ""
this.nodeLevel = 0
this.nodeParent = 0
this.isInitial = false
this.font = ""
this.isFolder = true
this.initialize = initialize
this.setState = setStateFolder
this.moveState = moveStateFolder
this.addChild = addChild
this.createIndex = createEntryIndex
this.hide = hide
this.display = display
this.initMode = initMode
this.collExp = collExp
this.initLayer = initLayer
this.setNodeDraw = setNodeDraw
this.setFont = setFont
this.setInitial = setInitial
this.setIcon = setIcon
this.setTarget = setTarget
this.setStatusBar = setStatusBar
this.setUserDef = setUserDef
this.getUserDef = getUserDef
this.setNodeFont = setNodeFont
this.nodeIcon = nodeIcon
this.nodeTIcon = nodeTIcon
this.setCheckBox = setCheckBox

}
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].isFolder)
		{
		totalHeight += this.c[i].navObj.clip.height
		if (isOpen)
			width = Math.max(width,this.c[i].navObj.clip.width)
		}
	}
if (!isOpen) totalHeight = - totalHeight
if (isOpen && noFrame && cascade)this.divObj.clip.height = totalHeight
if (!(noFrame && cascade))this.navObj.clip.height +=  totalHeight
if (isOpen && !(noFrame && cascade)) this.navObj.clip.width = Math.max(width, this.navObj.clip.width)
thisnode = this
parent = thisnode.nodeParent
for (i=0; i < this.nodeLevel ; i++)
	{
if (parent.nodeLevel == 0 || !(noFrame && cascade)) 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 (!noDocs || parent.c[j].nC != null)
			{
			if (found && !(noFrame && cascade)) 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 + topLayer.layers["header"].clip.height + topLayer.layers["footer"].clip.height
topLayer.clip.height = newHeight
topLayer.clip.width = Math.max(topLayer.clip.width,fT.navObj.clip.width)
newHeight = newHeight + topGap
if (isOpen && !noFrame){
	frameHeight = thisFrame.innerHeight
	if (doc.height < newHeight)
		doc.height = newHeight
	else if (newHeight < frameHeight) {
		doc.height = frameHeight
		thisFrame.scrollTo(0,0)
	}
       else if (doc.height > newHeight + 0.5*frameHeight){
		doc.height = doc.height*0.5 + (newHeight + 0.5*frameHeight)*0.5
		}
}
if (!(noFrame && cascade)) topLayer.layers["footer"].top = topLayer.layers["footer"].top + totalHeight
}



function propagateChangesInState(folder)
{

	var i=0
	if (folder.nC && treeLines == 1) 
	{
	if (!folder.nodeImg)
	 {

	 if (bV == 2) folder.nodeImg = folder.navObj.document.images["treeIcon"+folder.id]
	 else if (bV == 1 || doc.images) folder.nodeImg = doc.images["treeIcon"+folder.id]
	 }
	if (folder.nodeLevel > 0) folder.nodeImg.src = folder.nodeTIcon()
	}
	if (folder.isOpen && folder.isInitial)
		{
		if (cascade && noFrame && bV == 1) doc.all["div"+folder.id].style.display = "block"
		if (cascade && noFrame && bV == 2) folder.divObj.visibility = "show"
		for (i=0; i<folder.nC; i++) {
			if (!noDocs || folder.c[i].isFolder)
				folder.c[i].display()
		}
		}
	else
		{
		if (folder.isInitial){
			if (cascade && noFrame && bV == 1) doc.all["div"+folder.id].style.display = "none"
			if (cascade && noFrame && bV == 2) folder.divObj.visibility = "hidden"
			for (i=0; i<folder.nC; i++) 
				if (!noDocs || folder.c[i].isFolder)
					folder.c[i].hide()
		}
		}
	var iA = iNA
	
	if (!folder.iconImg)
	{
	if (bV == 2) folder.iconImg = folder.navObj.document.images["nodeIcon"+folder.id]
	else if (bV == 1 || doc.images) folder.iconImg = doc.images["nodeIcon"+folder.id]
	}
	//folder.iconImg.src = folder.nodeIcon("",iA)
	
	
	
	
	
		
	//alert(nomeicone);
	//alert(folder.nodeLevel );
		
	if (folder.nodeLevel == 1)
	{
		nomeicone = folder.nodeIcon("",iA)
		//alert("nomeicone "+nomeicone)
		nomeicone = nomeicone.replace("4.gif","SetaSeleciona.gif");
		nomeicone = nomeicone.replace("5.gif","Seta_sel.gif");
		//nomeicone = nomeicone.replace("10.gif","SetaSeleciona.gif");
		
		folder.iconImg.src = nomeicone
	}
	else
	{
		folder.iconImg.src = "images/ftblank.gif"
	}
	//alert(folder.iconImg.name)
	
}




function display()
{
	var i=0
	if (bV == 1)
	{
		if (!this.navObj) this.navObj = doc.all["node" + this.id]
		this.navObj.style.display = "block"
	}
	else if (bV ==2)
		this.navObj.visibility = "show"
	if (bV == 2 && cascade && noFrame && this.divObj && (this.isOpen || !this.isFolder)) {
		this.divObj.visibility = "show"
	}
	if (bV == 1 || (bV == 2 && cascade && noFrame)) {
	if (this.isInitial && this.isOpen)

		for (i=0; i < this.nC; i++) {
			if (!noDocs || this.c[i].isFolder || (bV ==2 && cascade && noFrame))
				this.c[i].display()
	}
	}
}

function hide()
{
	var i = 0
	
	
	
	if (bV == 1)
	{
		//alert("1")
		if (!this.navObj) this.navObj = doc.all["node" + this.id]
		this.navObj.style.display = "none"
	}
	else if (bV ==2)
	{
		//alert("2")
		this.navObj.visibility = "hidden"
	}
	if (bV == 2 && cascade && noFrame && this.divObj) {
		this.divObj.visibility = "hidden"
	}
	if (bV == 1 || (bV == 2 && cascade && noFrame) ) {
	if (this.isInitial)
	
	
		//if (!this.iconImg)
		//{
		//if (bV == 2) this.iconImg = folder.navObj.document.images["nodeIcon"+folder.id]
		//else if (bV == 1 || doc.images) this.iconImg = doc.images["nodeIcon"+folder.id]
		//}
	
	
		//alert(this.iconImg.src);
	
		for (i=this.nC-1; i>-1; i--)
			{
			if (!noDocs || this.c[i].isFolder)
				this.c[i].hide()
			}
	}
	
	
}

function initialize(level, lastNode, leftSide, doc, prior)
{
this.createIndex()
this.nodeLevel = level
if(!this.isFolder) this.isInitial = true
if (level>0)
	{
	this.isLastNode = lastNode
	if (!(cascade && noFrame)) tmpIcon = this.nodeTIcon()
	tmpIcon = this.nodeTIcon()
	if (this.isLastNode == 1)
		tmp2Icon = iTA["b"].src
	else
		tmp2Icon = iTA["vl"].src
	if (treeLines == 0) tmp2Icon = iTA["b"].src
	if (this.hidden == false) 
		{
		if (level == 1 && treeLines == 0 && noTopFolder)
			this.setNodeDraw(leftSide, doc, prior)
		else
			{
			if (this.isFolder){
				auxEv = "<a href='javascript:void(0);' onClick='return " + frameParent + ".clickOnNode("+this.id+");'"
				auxEv += " onMouseOver='return " + frameParent + ".mouseOverNode(0,"+this.id+");'"
				auxEv += " onMouseOut='return " + frameParent + ".mouseOutNode(0,"+this.id+");' alt='' class='menu'>"
				if (!(cascade && noFrame)) auxEv += "<img name='treeIcon" + this.id + "' src='" + tmpIcon + "' border=0 alt='' align = 'absmiddle'></a>"
			}
			else {
				if (!(cascade && noFrame)) auxEv = "<img  src='" + tmpIcon + "'  border=0  align = 'absmiddle'>"
			}
			this.setNodeDraw(leftSide + auxEv, doc, prior)
			if (this.isFolder && !(cascade && noFrame))
				leftSide +=  "<img src='" + tmp2Icon + "'  border=0  align = 'absmiddle'>"
			}
		}
	}
else
	this.setNodeDraw("", doc, prior)
if (this.isFolder) {
this.nodeLeftSide = leftSide
if (this.nC > 0 && this.isInitial)
	{
	level = level + 1
	for (var i=0 ; i < this.nC; i++)
		{
		this.c[i].nodeParent = this
		if (noDocs)
			{
			newLastNode = 1
			for (var j=i+1; j < this.nC; j++)
				if (this.c[j].isFolder) newLastNode = 0
			}
		else
			{
			newLastNode = 0
			if (i == this.nC-1) newLastNode = 1
			}
		if (i==0 && level == 1 && noTopFolder) newLastNode = -1
		if (!noDocs || this.c[i].isFolder)
			{
			this.c[i].initialize(level, newLastNode, leftSide, doc, prior)
			}
		}
	}
}
if (bV == 2 && this.hidden == false && !prior) doc.write("</layer>");
}

function setNodeDraw(leftSide,doc,prior)
{
var strbuf = ""
var font
if (bV == 2)
	{
	if (!prior)
		{
		if (noFrame && cascade) 
			strbuf += "<layer id='node" + this.id + "' visibility='hidden'  bgColor='" + menuBackColor + "' width = '" + menuWidth + "' Z-INDEX=1>"
		else
			strbuf += "<layer id='node" + this.id + "' visibility='hidden' Z-INDEX=1>"

		}
	else
		{
		if (noWrap) layWidth = menuWidth
		else layWidth = thisFrame.innerWidth - 20
		if (noFrame && cascade) layWidth = menuWidth
		var testlayer = new Layer(layWidth, prior)
		}
	}
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"
else linkFrame = "target=\"" + targetFrame + "\""
if (noFrame && targetFrame == 0) 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 = "ftp://"
else if (linkType == 3) linkURL = "telnet://"
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)
	}
	fullLink = " href='" + linkURL + linkText + "' " + linkFrame
	}
else
	fullLink = " href='javascript:void(0); ' "
fullLink += " onMouseOver='return " + frameParent + ".mouseOverNode(1,"+this.id+");' onMouseOut='return " + frameParent + ".mouseOutNode(1,"+this.id+");' "
	fullLink += " onClick='return " + frameParent + ".clickNode("+this.id+");' "
if (this.statusText == "")
	var toolTip= this.desc
else
	var toolTip = this.statusText
if (bV > 0) {
	eval("toolTip = toolTip.replace(/<[^<>]*>/g,'');");
}
else {
	int1 = toolTip.indexOf("<")
	toolTip = toolTip.substring(0,int1)
}
fullLink += " TITLE ='" + toolTip + "' "
if (bV == 1)
	strbuf += "<div id='node" + this.id + "' style='position:static'>"
if (bV == 2 && noFrame && cascade) 
	strbuf += "<table border=0 cellspacing=0 cellpadding=0 width='" + menuWidth + "'><tr><td valign = "
else 
	strbuf += "<table border=0 cellspacing=0 cellpadding=0><tr><td valign = "
if (noWrap) strbuf += " 'middle' "
else strbuf += " 'top' "


// ***********************************************
// Muda os ícones de acordo com o nível
// Priscilla Medeiros
var iA = iNA
tmpIcon = this.nodeIcon("",iA)

nomeicone = "nodeIcon";



if (this.nodeLevel == "1")
{
	nomeicone = "nodeIcon";
	tmpIcon = tmpIcon.replace("6.gif","Seta.gif");
	tmpIcon = tmpIcon.replace("5.gif","Seta.gif");
}

if (this.nodeLevel == "2")
{
	nomeicone = "nodeIcon";
	tmpIcon = tmpIcon.replace("6.gif","ftblank.gif");
	tmpIcon = tmpIcon.replace("5.gif","ftblank.gif");
}





v_imagemi	= tmpIcon
v_node		= ""

if (this.nodeLevel != 1)
{
	v_imagemi   = "images/ftblank.gif"
	//v_node	= "ddd"
	v_node		= ""
}


strbuf += " nowrap>" 

// Dar um <br> nas imagens
if (this.nodeLevel == 1)
{
	if (document.all || isNav6)
	{
		strbuf += "<table><tr><td style='height=7'></td></tr></table>"
	}
	else
	{
		strbuf += "<table><tr><td style='height=9'></td></tr><tr><td style='height=10'></td></tr></table>"
	}
}




strbuf += leftSide + "<a " + fullLink + " class='menu'>"
strbuf  = strbuf + "<img name='nodeIcon"+v_node + this.id + "' "
strbuf = strbuf + "src='" + v_imagemi + "' border='0' align = 'absmiddle' alt = '" + toolTip + "'>"
if (this.isFolder)
	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 + "'>"
}
if (!(cascade && noFrame)) 
strbuf += "</a></td><td height='5' valign='top' "
else
strbuf += "</a></td><td valign='top' width = '" + textWidth + "' "

if (noWrap) strbuf += "nowrap>"
else strbuf += ">"
if (checkBox && this.checkBox) 
	{
	strbuf += "<input type=checkbox NAME='" + this.suid + "' VALUE = 'Yes' "
	strbuf += "onClick = 'node = parent.indexOfEntries[" + this.id + "];node.checked = !node.checked;' "
	if (this.checked == true) strbuf += " checked>"
	else strbuf += ">"
	}
font = this.setNodeFont()
if (useTextLinks && this.hreference)
//strbuf += "<a " + fullLink + " class='menu'>" + font + this.desc + "</font></a>"
strbuf += "<a " + fullLink + " class='menu'>" + this.desc + "</font></a>"
else
strbuf += font + this.desc + "</font>"
if (!(cascade && noFrame)) {
strbuf += "</td></tr></table>"
} else {
strbuf += "</td><td align=right>"
if (this.isFolder) strbuf += "<IMG border=0 src='" + iTA["arr"].src + "'>"
else strbuf += "<IMG border=0 src='" + iTA["b"].src + "'>"

strbuf += "</td></tr></table>"
}
if (bV == 1) strbuf += "</div>"
if (this.nodeLevel == 0 && noTopFolder)
	{
	if (bV == 2) strbuf = "<layer id='node" + this.id + "' visibility='hidden'>"
	else if (bV == 1) strbuf = "<div id='node" + this.id + "'></div>"
	else if (bV == 0) strbuf = ""
	}
this.navObj = null
if (this.isFolder) this.nodeImg = null
this.iconImg = null
if (bV == 0 || !prior) 
{
if (bV != 1)
doc.write(strbuf)
else
strbufarray[this.id] = strbuf
}
else
	{
	if (bV == 2) 
		{
		testlayer.document.open()
		testlayer.document.write(strbuf)
		testlayer.document.close()
		testlayer.zIndex=1
		this.navObj = testlayer
		this.navObj.top = doc.yPos
		this.navObj.visibility = "show"
		doc.yPos += this.navObj.clip.height
		}
	else if (bV == 1)
		{
		strbufarray[strbufIndex] = strbuf
		strbufIndex++
		}
	}
}


function setNodeFont()
{
	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 != "" && this.isFolder)
				font = defFolderFont
			else
				if (defDocFont != "" && !this.isFolder)
					font = defDocFont
	return font;
}

function createEntryIndex()
{
this.id = nEntries
indexOfEntries[nEntries] = this
nEntries++
}









function mouseOutNode(type,folderId)
{

	//alert("sersd")
	var mouseNode = 0
	mouseNode = indexOfEntries[folderId]
	if (!mouseNode) return false;
	clearTimeout(timeoutIDOver)
	if (document.images && type == 1)
		{
		over = ""
		var iA = iNA
	if (!mouseNode.iconImg)
	{
	if (bV == 2) mouseNode.iconImg = mouseNode.navObj.document.images["nodeIcon"+mouseNode.id]
	else if (bV == 1 || doc.images) mouseNode.iconImg = doc.images["nodeIcon"+mouseNode.id]
	}
	
		
		//alert("urlStr"+ _browserFixQ822925('Seguranca/images/Seta_Sel.gif') +" bV: "+ bV +" esse  "+ mouseNode.iconImg.src)
		if (mouseNode.nodeLevel == "1")
		{
		
			if (mouseNode.iconImg.src != _browserFixQ822925('Seguranca/images/SetaSeleciona.gif'))
			{
				nomeicone = mouseNode.nodeIcon(over,iA)
				//alert(nomeicone)
				//nomeicone = nomeicone.replace("Seta.gif","SetaSeleciona.gif");
				
				
				
				nomeicone = nomeicone.replace("4.gif","SetaSeleciona.gif");
				nomeicone = nomeicone.replace("6.gif","Seta.gif");
				nomeicone = nomeicone.replace("5.gif","Seta.gif");
			
				mouseNode.iconImg.src = nomeicone
			
				//alert(nomeicone)
				//alert("fffsdfsdf")
			}
		}	
		
		
		//	alert(nomeicone)
		//mouseNode.iconImg.src = mouseNode.nodeIcon(over,iA)
	
	
		
		}
	 if (cascade && noFrame && bV == 1) mouseNode.navObj.style.backgroundColor = menuBackColor
	if (cascade && noFrame && bV == 2) mouseNode.navObj.bgColor = menuBackColor

	setStatus("")
	return true;
}






function mouseOverNode(type,folderId)
{

	var mouseNode = 0
	mouseNode = indexOfEntries[folderId]
	if (!mouseNode) return false;
	if (bV == 1 && !mouseNode.navObj) {
		if (noFrame) {
			doc = document
		}
		else
		{
			doc = self.frames[menuFrame].document
		}
		mouseNode.navObj = doc.all["node" + mouseNode.id]
	}
	if (bV == 1 && (doc != mouseNode.navObj.document && !isNav6)) {
		clearTimeout(rewriteID)
		checkload()
		return true;
	}
	if (cascade && noFrame && bV == 1) mouseNode.navObj.style.backgroundColor = menuBackColorOver
	if (cascade && noFrame && bV == 2) mouseNode.navObj.bgColor = menuBackColorOver
	if (type == 0)
		if (mouseNode.isOpen)
			{
			setStatus("Clique para fechar")
			if (mouseOverPMMode == 2) clickOnNode(folderId)
			}
		else
			{
			setStatus("Clique para abrir")
			if (mouseOverPMMode > 0) clickOnNode(folderId)
			}
	else if (type == 1)
		{
		clearTimeout(timeoutIDOver)
		if (mouseNode.statusText == "")
			{
			setStatus(mouseNode.desc)
			}
		else
			{
			setStatus(mouseNode.statusText)
			}
		if (mouseNode.isFolder)
			if ((!mouseNode.isOpen && mouseOverIconMode == 1) || mouseOverIconMode == 2) {
	 if (cascade && noFrame) timeoutIDOver = setTimeout("clickOnNode(" + folderId + ")",50)
	else  timeoutIDOver = setTimeout("clickOnNode(" + folderId + ")",350)
	}
		}
	if (document.images && type == 1)
		{
		over = "Over"
		var iA = iNAO
		
		
	if (!mouseNode.iconImg)
	{
		if (bV == 2) mouseNode.iconImg = mouseNode.navObj.document.images["nodeIcon"+mouseNode.id]
		else if (bV == 1 || doc.images) mouseNode.iconImg = doc.images["nodeIcon"+mouseNode.id]
	}
	
	
		
		//alert("2")
		//alert(mouseNode.nodeLevel)
		
		if (mouseNode.nodeLevel == "1")
		{
			//alert("11");
			
			if (mouseNode.iconImg.src != _browserFixQ822925('Seguranca/images/SetaSeleciona.gif'))
			{
			
				nomeicone = mouseNode.nodeIcon(over,iA)
			
			
				nomeicone = nomeicone.replace("10.gif","Seta_sel.gif");
				nomeicone = nomeicone.replace("11.gif","Seta_sel.gif");
				nomeicone = nomeicone.replace("4.gif","SetaSeleciona.gif");
				nomeicone = nomeicone.replace("9.gif","SetaSeleciona.gif");
			
			
				mouseNode.iconImg.src = nomeicone
			}
		}
		
		
		
		
		
		
		
		
		//mouseNode.iconImg.src = mouseNode.nodeIcon(over,iA)
		
		
	}
	if (cascade && noFrame && bV == 1) {


	if (modalClick && (mouseNode.nodeLevel > 0))

		for (i=0; i < mouseNode.nodeParent.nC; i++)
			{
			if (mouseNode.nodeParent.c[i].isOpen && (mouseNode.nodeParent.c[i] != mouseNode))
				{
				for (j=0; j < mouseNode.nodeParent.c[i].nC; j++) {
					if (mouseNode.nodeParent.c[i].c[j].isFolder && mouseNode.nodeParent.c[i].c[j].isOpen) mouseNode.nodeParent.c[i].c[j].setState(false)
				}
				mouseNode.nodeParent.c[i].setState(false)
				}
			}

	}


	return true;
}




function clickNode(folderId)
{
	
	var thisNode = 0
	thisNode = indexOfEntries[folderId]
	if (!thisNode) return false;
	if (thisNode.isFolder) 
	{
	
	
	
		if (clickIconMode == 1 && thisNode.isOpen != null)
		{

			if(!thisNode.isOpen)
			{
				clickOnNode(folderId)
			}
		}
		else 
		{

			if (clickIconMode == 2 && thisNode.isOpen != null)
			{
				clickOnNode(folderId)
			}
		}
	}
	else
	{
	
		clickOnNode(folderId)
		
		
		if (thisNode.nodeLevel == 1)
		{
			var iA = iNAO
			//alert(thisNode.nodeLevel);
			
			
			//	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)
				
			//	alert("over "+ over +" iA "+ iA)
			
			nomeicone = thisNode.nodeIcon(over,iA)
			nomeicone = nomeicone.replace("11.gif","SetaSeleciona.gif");
			thisNode.iconImg.src = nomeicone;
			
			//alert(nomeicone);
			//alert(thisNode.nodeLevel );
			
			//z = 0
			//for (i=0; i < 500000; i++)
			//{
			//	z = z + 1
			//}
			
			
			//vtext = nomeicone;
			
		
			//nomeicone = vtext.replace("Seta.gif","SetaSeleciona.gif");
			//nomeicone = nomeicone.replace("11.gif","SetaSeleciona.gif");
		
			
			//thisNode.iconImg.src = nomeicone;
			//thisNode.iconImg.src = nomeicone;
			//alert(nomeicone)
		}
		
		
		
		
		
	}
	
	
	
	
	if (clickAction)
	{
	
		clickAction(thisNode)
	}

		
	
	if (thisNode.hreference) 
	{
		return true;
	}
	else 
	{
		return false;
	}
	
	
}









function nodeTIcon (){
iName = ""
if (this.isFolder) {
if (this.isOpen)
	{
	if (this.isLastNode == 0)
		iName = "mn"
	else if (this.isLastNode == 1)
		iName = "mln"
	else
		iName = "mfn"
	}
else
	{
	if (this.isLastNode == 0)
		iName = "pn"
	else if (this.isLastNode == 1)
		iName = "pln"
	else
		iName = "pfn"
	}
if (noDocs)
	{
	folderChildren = false
	for (i=0 ; i < this.nC; i++)
		{
		if (this.c[i].isFolder) folderChildren = true
		}
	if (!folderChildren) 
		if (this.isLastNode == 0)
			iName = "n"
		else if (this.isLastNode == 1)
			iName = "ln"
		else
			iName = "fn"
	}
}
else
{
	if (this.isLastNode == 0)
		iName = "n"
	else if (this.isLastNode == 1)
		iName = "ln"
	else
		iName = "fn"
}
if (treeLines == 0) iName = "b"
tmpIcon = iTA[iName].src
return tmpIcon
}



function nodeIcon(over,iA){






	tmpIcon = ""
	if (this.isFolder)
		{
		
		if (this.isOpen)
			{
			if (this["openIcon"+over] != "")
			{
				//alert("11"+ this.iName)
				tmpIcon = imageArray[this["openIcon"+over]].src
			}
			else if (this.nodeLevel == 0)
				{
				//alert("12")
					tmpIcon = iA["tOF"].src
				}
				else
				{
				//alert("13")
					tmpIcon = iA["oF"].src
				}
			}
		else
			{
		//	alert("21")
				if (this["closedIcon" + over] != "")
				{
				//	alert("22")
					tmpIcon = imageArray[this["closedIcon"+over]].src
				}
				else if (this.nodeLevel == 0)
				{
				//	alert("23")
					tmpIcon = iA["tCF"].src
				}
				else
				{
				//	alert("24")
					tmpIcon = iA["cF"].src
				}
			}
		}
	else
		{
		//alert("3")
		if (this["openIcon"+over] != "")
		{
			//alert("31")
			tmpIcon = imageArray[this["openIcon"+over]].src
		}
		else
		{	
			//alert("32")
			tmpIcon = iA["d"].src
		}
		}
		
		//alert("4")
	if (tmpIcon == "") tmpIcon = iTA["b"].src
return tmpIcon;

}



function setStatus(statusText){
var str = statusText
if (bV > 0)
	eval("str = str.replace(/<[^<>]*>/g,'');")
top.window.defaultStatus = ""
top.window.status = str
thisFrame.defaultStatus = str
thisFrame.status = str
if (bV == 0)
	{
	clearTimeout(timeoutID)
	timeoutID = setTimeout("top.status = ''",5000)
	}
}

function clickOnNode(folderId)
{

					
	var cF = 0
	var state = 0
	oldwinheight = thisFrame.innerHeight
	oldwinwidth = thisFrame.innerWidth
	cF = indexOfEntries[folderId]
	if (!cF) return false;
	if (!cF.navObj && bV == 1) cF.navObj = doc.all["node" + cF.id]
	state = cF.isOpen
	if (!state) {
	
		if (cF.isInitial == false) 
		{
		
			if(cF.nC == 0) 
				if (!addToTree)
				{
					//alert("Este no esta vazio.")
					
					cF.iconImg.src = "images/ftblank.gif"
					return false;
					
					
				}
				else
				{
					if (addToTree(cF) == true) return false;
				}
			if(cF.nC > 0) {
				if (bV == 2)
					if (noFrame && cascade ) doc.yPos = 0
					else doc.yPos = cF.navObj.clip.height
				if (bV > 0) prior = cF.navObj
				if (bV == 2 && noFrame && cascade) {
					var divLayer = new Layer(menuWidth, topLayer)
					divLayer.document.open()
					divLayer.document.write("")
					divLayer.document.close()
					divLayer.top = cF.navObj.top
					if (cF.nodeParent.divObj)
						divLayer.top += cF.nodeParent.divObj.top 
					divLayer.bgColor = menuBackColor
					divLayer.left = menuWidth * cF.nodeLevel
					topLayer.clip.width = Math.max(topLayer.clip.width, menuWidth * (cF.nodeLevel + 1))
					divLayer.visibility = "show"
					divLayer.zIndex=6000 + cF.id
					divLayer.clip.width = menuWidth
					cF.divObj = divLayer

				}
				if (bV > 0) {
				
					level = cF.nodeLevel
					leftSide = cF.nodeLeftSide
				
				
				
					if (bV == 1) {
						strbufarray = new Array()
						strbufIndex = 0
					}
					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].isFolder) newLastNode = 0
							}
						else
							{
							newLastNode = 0
							if (i == cF.nC-1) newLastNode = 1
							}
						if (!noDocs || cF.c[i].isFolder) {
							if (bV == 2 && noFrame && cascade) 
							{
								cF.c[i].initialize(level + 1, newLastNode, leftSide, doc, divLayer)
							}
							else
							{
								cF.c[i].initialize(level + 1, newLastNode, leftSide, doc, prior)
							}
							needRewrite = true
						}
						
						
					}
					
					
					if (bV == 1){ 
	      				htmlStr = strbufarray.join("")
						if (cascade && noFrame)
						{
							leftdivpos = prior.offsetWidth + prior.offsetLeft
							topdivpos = prior.offsetTop
							zpos = 6000 + level
						}
						if (isNav6) { 
							newObj = document.createElement("DIV")
							newObj.innerHTML = htmlStr
							prior.appendChild(newObj)
							if (cascade && noFrame) {
								newObj.style.position = "absolute"
								newObj.style.backgroundColor = menuBackColor
								newObj.style.top = topdivpos
								newObj.style.left = leftdivpos
								newObj.style.borderWidth = "2px"
								newObj.style.borderStyle = "solid"
								newObj.style.borderColor = menuBorderColor
								newObj.style.width = menuWidth
								newObj.zindex = zpos
								newObj.id = "div" + cF.id
							}								
						} else {
							if (!(cascade && noFrame))prior.insertAdjacentHTML("AfterEnd",htmlStr)
							else {
								htmlStr = "<DIV id = 'div" + cF.id + "' style='position:absolute;border-style:solid;border-color:" + menuBorderColor + ";border-width:2px;background-color:" + menuBackColor + ";zindex:" + zpos + ";top:" + topdivpos + ";left:" +leftdivpos + "'>" + htmlStr + "</DIV>"
								prior.insertAdjacentHTML("AfterBegin",htmlStr)
							}
						}
					}
				}
				//alert("1")
				cF.setState(!state)
				cF.isInitial = true
				//alert("2")
				
				
				
				
				
			}
		}
		else 
		{
			//alert("1")
			cF.setState(!state)
			//alert("2")
			cF.isInitial = true
			//	alert("3")
				
				
				
				
		}
	}
	else {
		//alert("4")
		if (bV == 0) cF.isInitial = false
		cF.setState(!state)
		
	}
	
	//alert("bV: "+ bV)
	
	if (bV == 2)
	{
		cF.moveState(!state);
	}
	//alert("state: "+ !state)
	//alert("modalClick: "+ modalClick)
	//alert("cF.nodeLevel: "+ cF.nodeLevel)
	
	
	if (!state && modalClick && (cF.nodeLevel > 0))
		//alert("3 bV:"+ bV)
		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 collExp(mode)
	{
	var i=0
	if (mode == 1)
		{
		this.isInitial = true
		if (this.isFolder)
			this.isOpen = true
		}
	else
		{
		this.isInitial = false
		if (this.isFolder)
			this.isOpen = false
		}
	if (this.isFolder) {
	for (i=0; i<this.nC; i++)
		this.c[i].collExp(mode)
	}
}



function initMode()
{
var i=0
if (initialMode == 2)
	{
	if (this.isFolder) this.isOpen = true
	this.isInitial = true
	}
if (this.isFolder) {
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)
firstInitial = false
}
function collapseAll(){
var i=0
if (noFrame)
	{
	if (initialMode == 0)
	{
	if (!fT.navObj && bV == 1) fT.navObj = doc.all["node" + fT.id]
	if (fT.isOpen){
		fT.setState(!state)
		if (bV == 2)fT.moveState(!state);
		}
	}
	if (initialMode > 0)
		{
		for (i=0; i<fT.nC; i++)
		{
		if (fT.c[i].isOpen) {
		if (!fT.c[i].navObj && bV == 1) fT.c[i].navObj = doc.all["node" + fT.c[i].id]
		state = fT.c[i].isOpen
		fT.c[i].setState(!state)
		if (bV == 2)fT.c[i].moveState(!state);
		}
		}	
		}
	}
else
	{
	if (initialMode == 0)
		{
		fT.isInitial = false
		fT.isOpen = false
		}
	if (initialMode > 0)
		{
		fT.isInitial = true
		fT.isOpen = true
		}
	for (i=0; i<fT.nC; i++)
		fT.c[i].collExp(0)
	backButton = false
	setTimeout("rewritepage()",50)
	}
}
function expandAll(){
var i=0
if (noFrame)
	{
	for (i=0; i<nEntries; i++)
		if (!indexOfEntries[i].isOpen)
			{
			indexOfEntries[i].setState(!state)
			if (bV == 2)indexOfEntries[i].moveState(!state);
			}
	}
else
	{
	fT.collExp(1)
	backButton = false
	setTimeout("rewritepage()",50)
	}
}
function initLayer() {
var i
var totalHeight
var oldyPos
var width = 0
if (!this.nodeParent)
	layer = topLayer
else
	layer = this.nodeParent.navObj
this.navObj = layer.document.layers["node"+this.id]
this.navObj.top = doc.yPos
this.navObj.visibility = "show"
if (this.nC > 0 && this.isInitial)
	{
	doc.yPos += this.navObj.document.layers[0].top
	oldyPos = doc.yPos
	doc.yPos = this.navObj.document.layers[0].top
	this.navObj.clip.height = doc.yPos
	totalHeight = 0
	for (i=0 ; i < this.nC; i++)
		{
		if (!noDocs || this.c[i].isFolder)
			{
			if (this.c[i].hidden == false) this.c[i].initLayer()
			if (bV == 2) 
				{
				totalHeight +=  this.c[i].navObj.clip.height
				width = Math.max(width,this.c[i].navObj.clip.width)
				}
			}
		}
	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
		}
	}
else
	doc.yPos += this.navObj.clip.height
}

suiArray = new Object()
function gFld(d, h, suid)
{
folder = new Node(d, h)
folder.isFolder = true
if (suid != null)
	folder.suid = suid;
suiArray[suid] = folder
return folder
}

function gLnk(d, h, suid)
{
linkItem = new Node(d, h)
linkItem.isFolder = false
if (suid != null)
	linkItem.suid = suid;
suiArray[suid] = linkItem
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
	childNode.nodeParent	= this
	childNode.nodeLevel		= this.nodeLevel + 1
	this.nC++
	
	//alert(this.nodeLevel)
	
	return childNode
}
function setCheckBox(visible, checkState) {
	this.checkBox = visible
	if(visible) this.checked = checkState
}

function setFont(font){
this.font = font
return
}
function setInitial(initial){
if (initial && this.isFolder)
	{
	this.isInitial = true
	this.isOpen = true
	}
return
}
function setIcon(o,c, oO,cO){
if (this.isFolder){
if (o != null) this.openIcon = o
if (c != null) this.closedIcon = c
if (oO != null) this.openIconOver = oO
if (cO != null) this.closedIconOver = cO
}
else
{
if (o != null) this.openIcon = o
if (c != null) this.openIconOver = c
}
return
}
function fTimage(f){
//alert("iconFolder:"+iconFolder)
this.src = iconFolder + f
return
}
function addImage(name, f){
if (bV != 1)
	imageArray[name] = new fTimage(f)
else
	{
	imageArray[name] = new Image()
	imageArray[name].src = iconFolder + f
	}
nImageArray++
}
function addIcon(icon,prop,f) {
if (bV != 1)
	icon[prop] = new fTimage(f)
else
	{
	icon[prop] = new Image()
	icon[prop].src = iconFolder + f
	}
}
function setTarget(t){
	this.targetFrame = t
return
}
function setLinkType(l){
if (l >= 0 && 1 <= 3)
	this.linkType = l
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,"pfn",pfnIcon)
	addIcon(iTA,"mfn",mfnIcon)
	addIcon(iTA,"b",bIcon)
	addIcon(iTA,"ln",lnIcon)
	addIcon(iTA,"fn",fnIcon)
	addIcon(iTA,"vl",vlIcon)
	addIcon(iTA,"n",nIcon)
	addIcon(iTA,"arr",arrIcon)

}

function blank() {
icheck = 0

eval(unscramble(99,110,98,31,60,31,114,100,107,101,45,101,113,96,108,100,114,90,108,100,109,116,69,113,96,108,100,92,45,99,110,98,116,108,100,109,115,58))
//alert(unscramble(99,110,98,31,60,31,114,100,107,101,45,101,113,96,108,100,114,90,108,100,109,116,69,113,96,108,100,92,45,99,110,98,116,108,100,109,115,58,96,107,100,113,115,39,38,68,117,96,107,116,96,115,104,110,109,31,85,100,113,114,104,110,109,38,40,58))

ret = "<HTML><HEAD>"
if (styleSheetFile != "") ret += "<link rel='stylesheet' href='" + styleSheetFile + "'>"
//if (bV < 2 ) ret += "<BASE HREF='" + document.location + "'>"
//ret += "</HEAD><BODY " + bodyOption + " onLoad = 'parent.checkload()'"
ret += "</HEAD><BODY  class='BODYVerde' onLoad = 'parent.checkload()'"
ret += ">"
initImage()
ret += "<!--<B><CENTER><P class='title2'>Carregando mapa do site...<BR>por favor, aguarde.</B></P>-->"
//ret += "<font size=-1>Carregando imagens:<br>"
//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>"
if (doc.all) doc.open("text/html","replace")
else doc.open()
doc.write(ret)
if (isNav6) doc.all = doc.getElementsByTagName("*");

if (doc.all) {
setTimeout("doc.close()",400)
if (navigator.userAgent.indexOf("Opera") >= 0) setTimeout("checkload()",200)
}
else
{
doc.close()
if (navigator.userAgent.indexOf("Opera") >= 0) setTimeout("checkload()",200)
self.frames[menuFrame].onload = checkload
}
return ret
}
icheck = 0


function checkload() {
doc = self.frames[menuFrame].document
if (isNav6) doc.all = doc.getElementsByTagName("*");

if (!doc.all) rewritepage()
else {
   icheck++
   if (!doc.readyState || doc.readyState == "complete") {
	  setTimeout("rewritepage()",200)
   }
   else {
	if (icheck > 500)
		alert("Carregamento incompleto.")
   	else 
    	 setTimeout("checkload()",200)
   }
}
}
function rewritepage() {
backButton = false
if (rewriting) return false;
rewriting = true
if (!fT)
{
alert("A estrutura esta vazia.")
rewriting = false
return false;
}
if (document.all || isNav6)
	bV = 1
else 
	{
	if (document.layers)
		{
		bV = 2
		if (inTable || inForm) {
			if (!noFrame) bV = 0
			else {
				alert("Netscape version 4 cannot handle menu within table or form without frames")
				return false
			}

		}
		}
	else
		bV = 0
	}
if (bV == 0 && noFrame) {
	alert("Old browsers cannot use menus without frames. Please upgrade.")

}
if (bV == 1 && navigator.userAgent.indexOf("Mac") >= 0) bV = 0
if (navigator.userAgent.indexOf("Opera") >= 0) bV = 0
if (bV == 2 ) self.onresize = self.handleResize

if (noFrame) {
doc = document
frameParent = "self"
thisFrame = self
}
else
{
thisFrame = self.frames[menuFrame]
doc = thisFrame.document
if (isNav6) doc.all = doc.getElementsByTagName("*");
if (bV == 2) {
	if (doc.width == 0)
	{
	clearTimeout(rewriteID)
	rewriteID = setTimeout("rewritepage()",1000)
	rewriting = false
	return false;
	}
}
}
setStatus("Por favor, aguarde...")
if (bV == 1) doc.open("text/html","replace")
if (bV == 0) doc.open()
nEntries = 0
doc = thisFrame.document
if (isNav6) doc.all = doc.getElementsByTagName("*");

if (!noFrame) { 
	doc.write("<html><head>")
	if (styleSheetFile != "") doc.write("<link rel='stylesheet' href='" + styleSheetFile + "'>")
	if (bV < 2 ) doc.write("<BASE HREF='" + document.location + "'>");
	doc.write("<Title></Title></head>")
	resizestr = ""
	if (bV == 2 && !noFrame) {
		resizestr = "onResize = 'parent.handleResize(event)' "
		resizestr += " onLoad = 'parent.docLoad()' " 
		resizestr += " onUnLoad = 'parent.backLoad()' " 
	}
	doc.write("<BODY " + resizestr + bodyOption + ">")
	doc.write("<br>")
	setStatus("Por favor, aguarde...")
}

initImage()
if (bV == 2) self.onresize = self.handleResize
if (bV == 2) 
	{
      if (noFrame && inTable) {
		doc.write("<ILAYER id = 'foldertree' visibility = 'show' top=" + topGap + " left = " + leftGap + " Z-INDEX=1>")
      } else {
		doc.write("<LAYER id = 'foldertree' visibility = 'show' top=" + topGap + " left = " + leftGap + " Z-INDEX=1>")
      }
	doc.write("<layer id = 'header' visibility = 'hidden'>" + menuHeader + "</layer>")
	initializeDocument()
	doc.write("<layer id = 'footer' visibility = 'hidden'>" + menuFooter + "</layer>")
      if (noFrame && inTable) {
	   doc.write("</ILAYER>")
      } else {
	   doc.write("</LAYER>")
      }
	}
else
	{

	if (bV == 1 && noFrame ) {
        if (!cascade) {
		if (inTable)
			doc.write("<DIV id='foldertree' style='position:relative;'>")
		else
			doc.write("<DIV id='foldertree' style='position:absolute;'>")
		} else {
		doc.write("<DIV id='foldertree' style='position:absolute;zindex:4000;border-style:solid;border-color:" + menuBorderColor + ";border-width:2px;background-color:" + menuBackColor + "' >")
		}
	}
	else if (bV == 1) doc.write("<DIV id='foldertree' style='position:absolute; left:" + leftGap + "; top:" + topGap + ";'>")
	else doc.write("<DIV id='foldertree'>")

	doc.write(menuHeader)
strbufarray = new Array()
	initializeDocument()

	if (bV == 1) eval("htmlStr = strbufarray.join(''); doc.write(htmlStr);")
	doc.write(menuFooter)
     doc.write("</DIV>")
	if (bV == 1 && noFrame && cascade) doc.write("<DIV>")
	if (bV == 1 && noFrame && !cascade) doc.write("</DIV>")

	}

if (!noFrame){
doc.write("</BODY></HTML>")
if (bV == 2) doc.close()
}
if (bV == 1 && noFrame)
{
doc.body.topMargin = 0
doc.body.leftMargin = 0
doc.body.rightMargin = 0
}

if (noFrame) doc = document
else
if (bV == 2) doc = self.frames[menuFrame].document
if (isNav6) doc.all = doc.getElementsByTagName("*");

if (bV == 2)
	{
	topLayer = doc.layers["foldertree"]
	doc.yPos = topLayer.layers["header"].clip.height
	fT.initLayer()
	topLayer.layers["footer"].top = doc.yPos
	topLayer.clip.height = fT.navObj.clip.height + topLayer.layers["header"].clip.height + topLayer.document.layers["footer"].clip.height
	if (!(noFrame && cascade)) doc.height = topLayer.clip.height + topGap
	topLayer.layers["header"].visibility = "show"
	topLayer.layers["footer"].visibility = "show"

	topLayer.visibility = "show"
	fT.display()
	oldwinheight = thisFrame.innerHeight
	oldwinwidth = thisFrame.innerWidth
}

setStatus("")
rewriting = false
needRewrite = false
if (!noFrame)
	{
	if (doc.all)
		setTimeout("doc.close()",200)
	else
		if (bV == 0)
			{
			doc.close()
			doc = self.frames[menuFrame].document
			}
	}
backButton = false

return false
}
function docLoad() {
if (bV == 2) {
if (!topLayer) {setTimeout("rewritepage()",200);}
else {
if (topLayer.document.layers["node0"].visibility == "hide") {setTimeout("self.history.back()",200);}
}
}
return
}
function backLoad() {
if (!backButton) {
backButton = true
}
else {
	if (!remenu) {
	clearTimeout(rewriteID)
	rewriteID = setTimeout("self.history.back()",200)
	backButton = false
	}
}
return false;
}
function handleResize(evt) {
if (noFrame) {
locref = doc.location.href
doc.location.replace(locref)
return void(0)
}
backButton = false
if (rewriting) {
alert("Por favor, nao redimencione a janela enquanto a arvore estiver sendo carregada.\n\n Redimencione novamente para reajustar.")
rewriting = false
return false
}
if (!needRewrite && noWrap && navigator.userAgent.indexOf("Win") != -1) 
	{
	for (i=0 ; i < nEntries; i++)
		{
		thisnode = indexOfEntries[i]
		if (thisnode.nodeImg) thisnode.nodeImg.src = thisnode.nodeTIcon()
		}
	oldwinheight = thisFrame.innerHeight
	oldwinwidth = thisFrame.innerWidth
	return false;
	}
if (evt.target.name == menuFrame)
	{
	remenu = false
	if(!(oldwinheight == evt.target.innerHeight && oldwinwidth == evt.target.innerWidth))
		{
		clearTimeout(rewriteID)
		if (topLayer) topLayer.clip.height = 0
		rewriteID = setTimeout("rewritepage()",500)
		rewriting = false
		remenu = true
		}
	}
else
	{
	if(!(oldtopheight == evt.target.innerHeight && oldtopwidth == evt.target.innerWidth))
		{
		if (!remenu){
			clearTimeout(rewriteID)
			rewriteID = setTimeout("rewritepage()",500)
			rewriting = false
		}
		oldtopheight = evt.target.innerHeight
		oldtopwidth = evt.target.innerWidth
		}
	remenu = false
	}
return false;
}

// variaveis globais a outros JSs
// ****************
indexOfEntries = new Array()
var nEntries = 0
var selectedNode = 0
var bV = 0
//var javaerror = false
var needRewrite = true
var backButton = false
var doc = document
var oldwinheight = 0
var oldwinwidth = 0
var oldtopheight = 0
var oldtopwidth = 0
var topLayer
levelDefFont = new Array()
var remenu = false
var firstInitial = true
top.defaultStatus = "";
iNA = new Object()
iNAO = new Object()
iTA = new Object()
imageArray = new Object()
var nImageArray = 0
timeoutID = 0
timeoutIDOver = 0
rewriteID = 0
rewriting = false
frameParent = "parent"
thisFrame = self
fT = 0
addToTree = 0
clickAction = 0
isNav6 = false
if (navigator.userAgent.indexOf("Netscape6") >= 0)
   isNav6 = true;
pnIcon = "ftpn.gif";
mnIcon = "ftmn.gif";
pfnIcon = "ftpfn.gif";
mfnIcon = "ftmfn.gif";
plnIcon = "ftpln.gif";
mlnIcon = "ftmln.gif";
nIcon = "ftn.gif";
fnIcon = "ftfn.gif";
lnIcon = "ftln.gif";
bIcon = "ftb.gif";
vlIcon = "ftvl.gif";
arrIcon = "ftarrow.gif"


