/*
 Menu Tree v1.5b
 
 Copyright (C) 2001  e.magination network, llc.  All Rights Reserved.
   Feel free to reuse or modify this code,
   provided this header remains in tact.
   http://www.emagination.com
   jibba jabba strikes again.
   required JavaScript files:
     resizefix.js
     dynlayer.js

*** modified for NAPA only ***

*/

function NavTree() {
	if (typeof _aryNavTree == 'undefined') _aryNavTree = new Array();
	var NTCount = _aryNavTree.length;
	var strPrefix = _aryNavTree[NTCount] = 'NT' + (NTCount+1);
	this.nodes = new Array();
	this.nodes['_root'] = new NavNode('_root', '_root')
	this.nameToID = new Array();
	this.root = this.nodes['_root'];
	this.addNavChild = addNavChild;
	this.divPrefix = strPrefix;
	this.ImageSrcBlank = '_images/menutree/blank.gif';
	this.ImageWidth = 18;
	this.ImageHeight = 16;
	this.styleClasses = null;
	this.useLeafImages = true;
	this.leftHTML = '';
	this.highlightNode = null;
}//NavTree

function addNavChild(strParentName, strNodeName, strText, strURL, strClassName, strTitle, strTarget, strFeatures) {
	var nodeParent = this.nodes[strParentName];
	//if no children, create children array
	if (!nodeParent.childNodes)	nodeParent.childNodes = new Array();
	var objChildNode = new NavNode(strParentName, strNodeName, strText, strURL, strClassName, strTitle, strTarget, strFeatures);
	//pointer to navigation tree
	objChildNode.navTree = this;
	//point child to parent
	objChildNode.parent = nodeParent;
	//point child to root
	objChildNode.root = this.nodes['_root'];
	//add to node list
	this.nodes[strNodeName] = objChildNode;
	//add child to parent
	nodeParent.childNodes[nodeParent.childNodes.length] = objChildNode;
	//set name to id relation
	this.nameToID[strNodeName] = objChildNode.id = nodeParent.id + '_' + nodeParent.childNodes.length;
}//addNavChild

function NavNode() {
	var strParentName = arguments[0];
	var strNodeName = arguments[1];
	var strInnerHTML = arguments[2];
	var strURL = arguments[3];
	var strClassName = arguments[4];
	var strTitle = arguments[5];
	var strTarget = arguments[6];
	var strFeatures = arguments[7];

	this.navTree = null;
	this.parent = null;
	this.root = null;
	this.id = '';
	this.parentName = strParentName;
	this.name = strNodeName;
	this.innerHTML = strInnerHTML;
	this.URL = strURL;
	this.className = strClassName;
	this.title = strTitle;
	this.target = strTarget;
	this.features = strFeatures;
}//NavNode


NavTree.prototype.writeHTMLForMenuTree = writeHTMLForMenuTree;

function writeHTMLForMenuTree(objNode, strPrefix, intLevel) {

	var imgSrcBlank = this.ImageSrcBlank;
	var intWidth = this.ImageWidth;
	var intHeight = this.ImageHeight;
	if (!objNode) objNode = this.root;
	if (!strPrefix) strPrefix = '';
	if (!intLevel) intLevel = 0;
	for (var i in objNode.childNodes) {
		var objChildNode = objNode.childNodes[i];
		var hasChildren = (objChildNode.childNodes);
		var useJustHTML = (objChildNode.name.match(/^_/)) ? true : false;
		
		var strChildPrefix = strPrefix + '_' + (parseInt(i)+1);
		//base name
		var strBaseName = this.divPrefix + strChildPrefix;
		//write layer
		//div tag
		document.write('<div id="' + strBaseName + 'Div"');
		//class
		//user specified
		var strStyleClass='';
		var strStyle='';
		//explicit class
		if (objChildNode.className && objChildNode.className != '') {
			strStyleClass = objChildNode.className;
			strStyle = ' class="' + strStyleClass + '"';
		}
		//array specified, default level class
		else if (this.styleClasses && this.styleClasses.join && this.styleClasses[intLevel]) {
			strStyleClass = this.styleClasses[intLevel];
			strStyle = ' class="' + strStyleClass + '"';
		}
		//one class specified
		else if (this.styleClasses && this.styleClasses != '') {
			strStyleClass = this.styleClasses;
			strStyle = ' class="' + strStyleClass + '"';
		}
		//none specified
		else strStyle = ' style="position: absolute;"';
		//highlight class
		if (this.highlightNode && this.highlightNode==objChildNode.name) {
			if (strStyle.indexOf('class=')>=0) {
				strStyle = strStyle.replace(/"$/, 'Highlight"'); 
			}
		}
		document.write(strStyle);
		document.write('>');

		document.write('<table border="0" cellspacing="0" cellpadding="0" align="left">')
		document.write('<tr><td nowrap="nowrap">');

		//CUSTOM HEIGHT CHANGES
		//change height if necessary
		var intHeight = this.ImageHeight;
		var intLeftHeight = intHeight;
		var blnChange = false;
		//override intHeight when necessary (noted by style class)
		if (strStyleClass.match(/0Class$/)) {
			intHeight = 13;
			blnChange = true;
		}

		//left image
		if (!useJustHTML && objChildNode.navTree.leftHTML) {
			//CUSTOM HEIGHT CHANGES
			var strLeftHTML = objChildNode.navTree.leftHTML;
			if (strStyleClass.match(/0Class$/)) {
				intLeftHeight = 13;
				blnChange = true;
			}
			else if (strStyleClass.match(/3Class$/)) {
				intLeftHeight = 18;
				blnChange = true;
			}
			else if (strStyleClass.match(/0Class2$/)) {
				intLeftHeight = 22;
				blnChange = true;
			}
			else if (strStyleClass.match(/Class2[Highlight]?$/)) {
				intLeftHeight = 28;
				blnChange = true;
			}
			if (blnChange) {
				strLeftHTML = strLeftHTML.replace(/height="\d+"/, 'height="'+intLeftHeight+'"');
			}
			document.write(strLeftHTML);
		}

		//line images
		for (var j=1; j<=intLevel; j++) {
			var strImgName = strBaseName + 'Img' + j;
			document.write('<img src="' + imgSrcBlank + '" name="' + strImgName + '" id="' + strImgName + '" width="'+intWidth+'" height="'+intHeight+'" alt="" border="0" align="top" />')
		}//for


		//Node names that begin with an underscore do not need any images
		if (useJustHTML) {
			document.write(objChildNode.innerHTML);
			document.write('</td></tr></table>');
		}
		else {

			//node image
			var strImgName = strBaseName + 'Img' + 'Node';
			var strOnClick = '//';
			if (hasChildren) {
				strOnClick = this.divPrefix + ".MTclickBranch('" + strChildPrefix + "');";
				document.write('<a href="JavaScript://" onclick="' + strOnClick + '">');
				document.write('<img src="' + imgSrcBlank + '" name="' + strImgName + '" id="' + strImgName + '" width="'+intWidth+'" height="'+intHeight+'" alt="" title="click to expand/collapse" border="0" align="top" />')
				document.write('</a>');
			}
			else {
				document.write('<img src="' + imgSrcBlank + '" name="' + strImgName + '" id="' + strImgName + '" width="'+intWidth+'" height="'+intHeight+'" alt="" border="0" align="top" />')
			}

			//leaf image
			var strImgName = strBaseName + 'Img' + 'Leaf';
			var strHref = "JavaScript://";
			var strOnClick = null;
			var strTarget = null;
			var strLink = '';
			var isBlankWithFeatures = false;
			if (objChildNode.URL && objChildNode.URL != '') {
				//get URL
				strHref = objChildNode.URL;
				strLink = strHref;
				if (objChildNode.target && objChildNode.target != '') {
					//get target
					strTarget = objChildNode.target;
					if (strTarget != '_self' && 
							strTarget != '_top' && 
							strTarget != '_parent' &&
							objChildNode.features && 
							objChildNode.features != '') {
						var strOpenURL = '';
						//if blank, remove link from href and put into open url
						if (strTarget == '_blank') {
							strTarget = null;
							strOpenURL = strHref;
							strHref = "JavaScript://";
							isBlankWithFeatures = true;
						}
						strOnClick = "window.open('"+strOpenURL+"', '" + objChildNode.target + "', '" + objChildNode.features + "');";
					}
				}
			}
			//anchor link tag
			var strATag = '';
			strATag = '<a href="'+strHref+'"';
			//target
			if (strTarget) strATag += ' target="'+strTarget+'"';
			//onclick
			if (strOnClick) strATag += ' onclick="' + strOnClick + '"';
			//rollover images
			if (!hasChildren) {
				var strOnMouseOver='';
				var strOnMouseOut='';
				if (objChildNode.navTree.useLeafImages) {
					strOnMouseOver = this.divPrefix + ".MTswapImages('" + strBaseName + "ImgLeaf', " + this.divPrefix + ".ImageSrc['DocOver']);";
					strOnMouseOut = this.divPrefix + ".MTswapImages('" + strBaseName + "ImgLeaf', " + this.divPrefix + ".ImageSrc['Doc']);";
				}
				//show status if target is _blank and features stated
				if (isBlankWithFeatures) {
					strOnMouseOver += " window.status='"+strLink+"'; return true;";
					strOnMouseOut += " window.status=window.defaultStatus; return true;";
				}
				strATag += ' onmouseover="' + strOnMouseOver + '"';
				strATag += ' onmouseout="' +  strOnMouseOut + '"';
			}
			//title
			if (objChildNode.title && objChildNode.title != '')
				strATag += ' title="' + objChildNode.title + '"';
			
			strATag += '>';
			document.write(strATag);
			//show leaf if desired
			if (objChildNode.navTree.useLeafImages) {
				document.write('<img src="' + imgSrcBlank + '" name="' + strImgName + '" id="' + strImgName + '" width="'+intWidth+'" height="'+intHeight+'" alt="" border="0" align="top" />');
			}
			document.write('</a>');
			document.write('</td></tr></table>');
			document.write(strATag);
			//text
			document.write(objChildNode.innerHTML + '</a>');
		}//if match(/^_/) ... else

		document.writeln('</div>');
		this.writeHTMLForMenuTree(objChildNode, strChildPrefix, intLevel+1);
	}//for
}//writeHTMLForMenuTree



function createMenuTree(objNavTree, intLeft, intTop, strImageDir, strInitNodeName , blnAutoClose, blnOpenInitChildren) {
	if (!intLeft) intLeft=0;
	if (!intTop) intTop=0;
	if (!strImageDir) strImageDir='_images/menutree';
	if (!blnAutoClose) blnAutoClose=false;
	if (!blnOpenInitChildren) blnOpenInitChildren=false;
	var strInitNodeID = (strInitNodeName) ? 
		objNavTree.nameToID[strInitNodeName] : '';
	var strPrefix = objNavTree.divPrefix;
	eval(strPrefix + " = new MenuTree('"+strPrefix+"', "+intLeft+", "+intTop+", '"+strImageDir+"', '"+strInitNodeID+"', " + blnAutoClose + ", " + blnOpenInitChildren + ")");
	//point menu tree object to nav tree object
	eval(strPrefix).NavTree = objNavTree;
	//point nav tree object to menu tree object
	objNavTree.MenuTree = eval(strPrefix);
}//createMenuTree


function MenuTree(strPrefix, intLeft, intTop, strImageDir, strInitNodeID, blnAutoClose, blnOpenInitChildren) {
	this.MTprefix = strPrefix;
	this.MTlayerExists = MTlayerExists;
	this.MTgetLayer = MTgetLayer;
	this.MTgetImage = MTgetImage;
	this.MTdrawNodeAndLeaf = MTdrawNodeAndLeaf;
	this.MTinitDrawLines = MTinitDrawLines;
	this.MTredraw = MTredraw;
	this.MTdrawLines = MTdrawLines;
	this.MTclickBranch = MTclickBranch;
	this.MTfixScrollbars = MTfixScrollbars;
	this.MThideNode = MThideNode;
	this.MTshowNode = MTshowNode;
	this.MThideBranch = MThideBranch;
	this.MTopenOnly = MTopenOnly;
	this.MTtoggleChildNodes = MTtoggleChildNodes;
	this.MTcacheImages = MTcacheImages;
	this.MTswapImages = MTswapImages;
	this.MTautoClose = (blnAutoClose);//auto close is mode where all nodes close except for clicked node
	this.MTshowBranch = MTshowBranch;
	this.openInitChildren = (blnOpenInitChildren);
	//dimension variables
	this.MTheight = 0;
	this.MTwidth = 0;

	//position
	this.posLeft = (intLeft) ? intLeft : 0;
	this.posTop = (intTop) ? intTop : 0;

	//images
	this.ImageDir = (strImageDir) ? strImageDir.replace(/\/$/,'') : this.ImageDir;
	this.ImageSrc = new Array();
	this.ImageSrc['Blank'] = this.ImageDir+'/blank.gif';
	this.ImageSrc['Plus'] = this.ImageDir+'/plus.gif';
	this.ImageSrc['PlusTop'] = this.ImageDir+'/plustop.gif';
	this.ImageSrc['PlusBottom'] = this.ImageDir+'/plusbottom.gif';
	this.ImageSrc['Minus'] = this.ImageDir+'/minus.gif';
	this.ImageSrc['MinusTop'] = this.ImageDir+'/minustop.gif';
	this.ImageSrc['MinusBottom'] = this.ImageDir+'/minusbottom.gif';
	this.ImageSrc['Line'] = this.ImageDir+'/line.gif';
	this.ImageSrc['Join'] = this.ImageDir+'/join.gif';
	this.ImageSrc['JoinTop'] = this.ImageDir+'/jointop.gif';
	this.ImageSrc['JoinBottom'] = this.ImageDir+'/joinbottom.gif';
	this.ImageSrc['FolderOpen'] = this.ImageDir+'/folderopen.gif';
	this.ImageSrc['FolderClosed'] = this.ImageDir+'/folderclosed.gif';
	this.ImageSrc['Doc'] = this.ImageDir+'/document.gif';
	this.ImageSrc['DocOver'] = this.ImageDir+'/document_mo.gif';
	
	//init functions
	this.MTcacheImages();
	this.MTinitDrawLines();
	this.MTlastAccessedNode = strInitNodeID;
	this.MTopenOnly(strInitNodeID);
	this.MTredraw();
}//MenuTree


function MThideBranch(strPrefix) {
	if (!strPrefix) strPrefix = this.MTprefix;
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var strChildPrefix = strPrefix + '_' + i;
		var objLayer = eval(strChildPrefix);
		objLayer.childNodesAreVisible = false;
		objLayer.hide();
		this.MThideBranch(strChildPrefix);
	}//for	
}//MThideBranch


function MTshowBranch(strPrefix) {
	if (!strPrefix) return;
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var strChildPrefix = strPrefix + '_' + i;
		var objLayer = eval(strChildPrefix);
		objLayer.childNodesAreVisible = true;
		objLayer.show();
		this.MTshowBranch(strChildPrefix);
	}//for	
}//MTshowBranch


function MTopenOnly(strNode) {
	this.MThideBranch();
	var strPrefix = this.MTprefix;
	//always show root level elements
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var objLayer = eval(strPrefix +'_' + i);
		objLayer.childNodesAreVisible = false;
		objLayer.show();//set visible in css.visibility property
	}//for
	//open if exists
	if (this.MTlayerExists(strPrefix + strNode + 'Div')) {

		//cheated here; should explicitly use MinusTop or MinusBottom if necessary
		//but ok here since images are equivalent
		var strParentName = strPrefix + strNode.replace(/_\d$/, '');
		if (strParentName != strPrefix) {
			var objParentLayer = eval(strParentName);
			objParentLayer.childNodesAreVisible = true;
			this.MTswapImages(strParentName + 'Img' + 'Node', this.ImageSrc['Minus']);
		}

		this.MTshowNode(eval(strPrefix + strNode));
		this.MTtoggleChildNodes(strNode, 'show');
		//children
		if (this.openInitChildren) {
			this.MTshowBranch(strPrefix + strNode);
		}
	}
}//MTopenOnly


function MTcacheImages() {
	var aryImageSrc = new Array();
	for (var i in this.ImageSrc) {
		aryImageSrc[i] = new Image;
		aryImageSrc[i].src = this.ImageSrc[i];
	}//for
}//MTcacheImages	


function MTdrawNodeAndLeaf(strPrefix, strMode) {
	if (!strMode) strMode = 'hide';

	//point to DynLayer object
	var objLayer = eval(strPrefix);

	with (objLayer) {

		var strSrcNodeImage;
		var strSrcLeafImage;
		//flag to denote root level
		eval("var rePattern = /" + this.MTprefix + "_1Div/");
		var blnOnRootLevel = (objLayer.id.match(rePattern)) ? true : false;
		if (hasChildren) {
			if (strMode=='show') {
				//node
				//special case: root level, first node
				if (isFirstSibling && blnOnRootLevel) strSrcNodeImage = this.ImageSrc['MinusTop'];
				else if (isLastSibling) strSrcNodeImage = this.ImageSrc['MinusBottom'];
				else strSrcNodeImage = this.ImageSrc['Minus'];
				//leaf
				strSrcLeafImage = this.ImageSrc['FolderOpen'];
			}
			else {
				//node
				//special case: root level, first node
				if (isFirstSibling && blnOnRootLevel) strSrcNodeImage = this.ImageSrc['PlusTop'];
				else if (isLastSibling) strSrcNodeImage = this.ImageSrc['PlusBottom'];
				else strSrcNodeImage = this.ImageSrc['Plus'];
				//leaf
				strSrcLeafImage = this.ImageSrc['FolderClosed'];
			}
		}
		else {
			//node
			if (isLastSibling) strSrcNodeImage = this.ImageSrc['JoinBottom'];
			else if (isFirstSibling && blnOnRootLevel) strSrcNodeImage = this.ImageSrc['JoinTop'];
			else strSrcNodeImage = this.ImageSrc['Join'];
			//leaf
			strSrcLeafImage = this.ImageSrc['Doc'];
		}

		this.MTswapImages(strPrefix + 'Img' + 'Node', strSrcNodeImage);
		if (this.useLeafImages)
			this.MTswapImages(strPrefix + 'Img' + 'Leaf', strSrcLeafImage);

	}//with

}//MTdrawNodeAndLeaf


function MTinitDrawLines(strPrefix, intLevel) {
	if (!strPrefix) strPrefix = this.MTprefix;
	if (!intLevel) intLevel = 0;
	
	//count siblings
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {}
	var countSiblings = --i;
	for (var i=1; i<=countSiblings; i++) {
		var strSubPrefix = strPrefix + '_' + i;

		//point to DynLayer object
		var objSubLayer = eval(strSubPrefix);
		//new properties	
		objSubLayer.hasChildren = (this.MTlayerExists(strSubPrefix + '_1Div')) ? true : false;
		objSubLayer.isFirstSibling = (i==1);
		objSubLayer.isLastSibling = (i==countSiblings);

		//draw vertical lines
		var strSrcLineImage = (objSubLayer.isLastSibling) ? this.ImageSrc['Blank'] : this.ImageSrc['Line'];
		this.MTdrawLines(strSubPrefix, intLevel + 1, strSrcLineImage);

		//draw node and leaf
		this.MTdrawNodeAndLeaf(strSubPrefix);

		//recurse this
		this.MTinitDrawLines(strSubPrefix, intLevel + 1);
	}//for
}//MTinitDrawLines


function MTdrawLines(strPrefix, intLevel, strSrcLineImage) {
	//children
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var strSubPrefix = strPrefix + '_' + i;
		this.MTswapImages(strSubPrefix + 'Img' + intLevel, strSrcLineImage);
		this.MTdrawLines(strSubPrefix, intLevel, strSrcLineImage);
	}//for
}//MTdrawLines


function MThideNode(objLayer) {
	objLayer.hide();
	objLayer.childNodesAreVisible = false;
	var strPrefix = objLayer.id.replace(/Div$/, '');
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var objSubLayer = eval(strPrefix + '_' + i);
		this.MThideNode(objSubLayer);
	}//for
}//MThideNode


function MTshowNode(objLayer) {
	var strPrefix = objLayer.id.replace(/_\dDiv$/, '');
	var intItem = objLayer.id.replace(/^.*_(\d)Div$/, '$1');

	//show siblings
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var objSiblingLayer = eval(strPrefix + '_' + i);
		objSiblingLayer.show();
		if (i == intItem) objSiblingLayer.childNodesAreVisible = true;//self
	}//for
	//show parent
	var strParentPrefix = strPrefix;
	if (strParentPrefix.match(/_\d$/)) {
		objParentLayer = eval(strParentPrefix);
		objLayer.childNodesAreVisible = true ;
		this.MTshowNode(objParentLayer);//recurse 
	} 
}//MTshowNode


function MTclickBranch(strNode, strState) {
	var objLayer = eval(this.MTprefix + strNode);
	if ((this.MTautoClose && !this.openInitChildren) || 
			(this.MTautoClose && this.openInitChildren && (strNode.match(/^_\d+$/)!=null))) {
		if (this.MTlastAccessedNode == strNode) {
			//toggle
			var objLayer = eval(this.MTprefix + strNode);
			if (objLayer.childNodesAreVisible) this.MTtoggleChildNodes(strNode, 'hide');
			else this.MTtoggleChildNodes(strNode, 'show');
		}
		//case clicked on parent of visible child
		else if ( (this.MTprefix+this.MTlastAccessedNode).indexOf(this.MTprefix+strNode)>=0 ) {
			this.MTtoggleChildNodes(strNode, 'hide');
		}
		else {
			this.MTopenOnly(strNode);
			this.MTredraw();
		}
	}
	else this.MTtoggleChildNodes(strNode, strState);
	this.MTlastAccessedNode = strNode;
	//scrollbar bug on NS4
	this.MTfixScrollbars();
}//MTclickBranch


function MTfixScrollbars() {
	if (!is.ns4) return;
	var intRight = this.posLeft + this.MTwidth;
	var intBottom = this.posTop + this.MTheight;
	document.width = Math.max(document.width, intRight);
	document.height = Math.max(document.height, intBottom);
}//MTfixScrollbars

function MTtoggleChildNodes(strNode, strState) {
	var strPrefix = this.MTprefix + strNode;
	var objLayer = eval(strPrefix);
	if (typeof(strState)=='undefined') {
		//check first child node
		var strSubLayer = strPrefix + '_1' + 'Div';
		var objSubLayer = eval(strPrefix + '_1');
		strState = (this.MTlayerExists(strSubLayer) && objSubLayer.isVisible()) ? 'hide' : 'show';
	}
	if (strState == 'show') objLayer.childNodesAreVisible = false;
	else if (strState == 'hide') objLayer.childNodesAreVisible = true;
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var objSubLayer = eval(strPrefix + '_' + i);
		if (objLayer.childNodesAreVisible) this.MThideNode(objSubLayer);
		else objSubLayer.show();
	}//for
	objLayer.childNodesAreVisible = !objLayer.childNodesAreVisible;
	this.MTredraw();
}//MTtoggleChildNodes

function MTredraw(strPrefix, intHeight) {
	if (!strPrefix) strPrefix = this.MTprefix;
	if (!intHeight) intHeight = 0;
	//plus/minus
	if (strPrefix != this.MTprefix && this.MTlayerExists(strPrefix + '_1Div')) {//if child exists
		//plus-minus image
		var strMode = 
			(eval(strPrefix).childNodesAreVisible) ? 'show' : 'hide';
		this.MTdrawNodeAndLeaf(strPrefix, strMode);
	}
	//children
	for (var i=1; this.MTlayerExists(strPrefix + '_' + i + 'Div'); i++) {
		var strSubPrefix = strPrefix + '_' + i;
		var objSubLayer = eval(strSubPrefix);
		var intHeightCompensation = (is.ie) ? 0 : 0;
		objSubLayer.moveTo(this.posLeft, this.posTop + intHeight + intHeightCompensation);
		if (objSubLayer.isVisible()) intHeight += objSubLayer.h + intHeightCompensation;
		intHeight = this.MTredraw(strSubPrefix, intHeight);//recurse

		//store for reference
		this.MTheight = intHeight;
		this.MTwidth = Math.max(this.MTwidth, objSubLayer.w);
	}//for


	return intHeight;
}//MTredraw

function MTlayerExists(id) {
	return (this.MTgetLayer(id));
}//MTlayerExists

function MTgetLayer(id) {
	var obj;
	if (is.ns4) obj = document.layers[id];//findLayerObject(id);
	else if (is.ns) obj = document.getElementById(id);//is.ns5
	else if (is.ie) obj = document.all[id];
	return obj;
}//MTgetLayer

function MTgetImage(nest, doc) {
	var obj;
	if (!doc) doc = document;
	if (!(obj=doc[nest]) && doc.all) obj = doc.all[nest];
	for(var i=0; !obj && !doc.getElementById && doc.layers && i<doc.layers.length; i++)
		obj = this.MTgetImage(nest, doc.layers[i].document);
	return obj;
}//MTgetImage

function MTswapImages() {
	for (var i=0; i<arguments.length; i+=2) {
		var strImgName = arguments[i];
		var strImgSrc = arguments[i+1];
		var objImg = this.MTgetImage(strImgName);
		if (typeof(objImg)=='object') {
			objImg.src = strImgSrc;
		}
		else {
			//alert('No image named: ' + strImgName);
		}
	}//for
}//MTswapImages

function isVisible() {
	return (this.css.visibility == 'visible' || this.css.visibility == 'show');
}//isVisible

DynLayer.prototype.isVisible = isVisible;
