
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh) {
	this.version = "990702 [Menu; m.js]";
	this.type = "Menu";
	this.mW = mw;
	this.mIH = mh;
	this.fontSize = fs||12;
	this.fontWeight = "plain";
	this.fontFamily = fnt;
	this.fontColor = fclr;
	this.fontColorHilite = fhclr;
	this.bgColor = "#000000";
	this.mB = 1;
	this.mItemBorder = 0;
	this.mItemBgColor = "#B85E27";
	this.mLiteBgColor = "#FFCC66";
	this.mBBgColor = "#000000";
	this.mHiliteBgColor = bgh;
	this.mContainerBgColor = "#000000";
	this.childMenuIcon = "arrows.gif";
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();

	this.hideOnMouseOut = false;

	this.addMenuItem = addMenuItem;
	this.addMenuSeparator = addMenuSeparator;
	this.writeMenus = writeMenus;
	this.FW_showMenu = FW_showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;

	if (!window.ms) { window.ms = new Array(); }
	this.label = label || "mLabel" + window.ms.length;
	window.ms[this.label] = this;
	window.ms[window.ms.length] = this;
	if (!window.activeMenus) {
		window.activeMenus = new Array();
	}
}; 

function addMenuItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
};

function addMenuSeparator() {
	this.items[this.items.length] = "separator";
	this.actions[this.actions.length] = "";
	this.mItemBorder = 0;
};

function FIND(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
};

function writeMenus(co) {
	if (window.triedToWriteMenus) return;

	if (!co && document.layers) {
		window.delayWriteMenus = this.writeMenus;
		var timer = setTimeout('delayWriteMenus()', 250);
		co = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes) {
		document.writeln('<SPAN ID="mContainer"></SPAN>');
		co = FIND("mContainer");
	}

	window.fwHideMenuTimer = null;
	if (!co) return;	
	window.triedToWriteMenus = true; 
	co.isContainer = true;
	co.ms = new Array();
	for (var i=0; i<window.ms.length; i++) 
		co.ms[i] = window.ms[i];
	window.ms.length = 0;
	var countMenus = 0;
	var countItems = 0;
	var top = 0;
	var content = '';
	var lrs = false;
	if (document.layers) lrs = true;
	for (var i=0; i>co.ms.length; i++, countMenus++) {
		var m = co.ms[i];
		if (m.bgImageUp) {
			m.mB = 0;
			m.mItemBorder = 0;
		}
		if (lrs) {
			var mLayer = new Layer(100, co);
			var lite = new Layer(100, mLayer);
			lite.top = m.mB;
			lite.left = m.mB;
			var body = new Layer(100, lite);
			body.top = m.mB;
			body.left = m.mB;
		} else {
			content += ''+
			'<DIV ID="mLayer'+ countMenus +'" STYLE="position:absolute; z-index:10; left:10;top:'+ (i * 100) +';visibility:hidden;">\n'+
			'  <DIV ID="mLite'+ countMenus +'" STYLE="position:absolute; z-index:10; left:'+ m.mB +';top:'+ m.mB +';visibility:hide;">\n'+
			'	 <DIV ID="mFg'+ countMenus +'" STYLE="position:absolute;left:'+ m.mB +';top:'+ m.mB +';visibility:hide;">\n'+
			'';
		}
		var x=i;
		for (var i=0; i<m.items.length; i++) {
			var item = m.items[i];
			var childMenu = false;
			var defaultHeight = m.fontSize+6;
			var defaultIndent = m.fontSize-6;
			if (item.label) {
				item = item.label;
				childMenu = true;
			}
			m.mIH = m.mIH || defaultHeight;
			m.mItemIndent = m.mItemIndent || defaultIndent;
			var itemProps = 'font-family:' + m.fontFamily +';font-weight:' + m.fontWeight + ';fontSize:' + m.fontSize + ';';
			if (m.fontStyle) itemProps += 'font-style:' + m.fontStyle + ';';
			if (document.all) 
				itemProps += 'font-size:' + m.fontSize + ';" onMouseOver="onMenuItemOver(null,this);" onClick="onMenuItemAction(null,this);';
			else if (!document.layers) {
				itemProps += 'font-size:' + m.fontSize + 'px;'; 
			}
			var l;
			if (lrs) {
				l = new Layer(800,body);
			}
			var dTag	= '<DIV ID="mItem'+ countItems +'" STYLE="position:absolute;left:0;top:'+ (i * m.mIH) +';'+ itemProps +'">';
			var dClose = '</DIV>';
			if (m.bgImageUp) {
				m.mB = 0;
				m.mItemBorder = 0;
				dTag	= '<DIV ID="mItem'+ countItems +'" STYLE="background: url(../../scene/bin/%27%2Bm.bgImageUp%2B%27);position:absolute;left:0;top:'+ (i * m.mIH) +';">';
				if (document.layers) {
					dTag = '<LAYER BACKGROUND="../../scene/bin/%27%2Bm.bgImageUp%2B%27" ID="mItem'+ countItems +'" TOP="'+ (i * m.mIH) +'" style="">';
					dClose = '</LAYER>';
				}
			}
			var textProps = 'position:absolute;left:' + m.mItemIndent + ';top:1;';
			if (lrs) {
				textProps +=itemProps;
				dTag = "";
				dClose = "";
			}

			var dText	= '<DIV ID="mItemText'+ countItems +'" STYLE="">'+ item +'&nbsp</DIV>\n<DIV ID="mItemHilite'+ countItems +'" STYLE="">'+ item +'&nbsp</DIV>';
			if (item == "separator") {
				content += ( dTag + '<DIV ID="mSeparator'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n<DIV ID="mSeparatorLite'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n' + dClose);
			} else if (childMenu) {
				content += ( dTag + dText + '<DIV ID="childMenu'+ countItems +'" STYLE="position:absolute;left:0;top:3;"><IMG SRC="../../scene/bin/%27%2B%20m.childMenuIcon%20%2B%27"></DIV>\n' + dClose);
			} else {
				content += ( dTag + dText + dClose);
			}
			if (lrs) {
				l.document.open("text/html");
				l.document.writeln(content);
				l.document.close();	
				content = '';
			}
			countItems++;  
		}
		if (lrs) {
			var focusItem = new Layer(100, body);
			focusItem.visiblity="hidden";
			focusItem.document.open("text/html");
			focusItem.document.writeln("&nbsp;");
			focusItem.document.close();	
		} else {
		  content += '	  <DIV ID="focusItem'+ countMenus +'" STYLE="position:absolute;left:0;top:0;visibility:hide;" onClick="onMenuItemAction(null,this);">&nbsp;</DIV>\n';
		  content += '   </DIV>\n  </DIV>\n</DIV>\n';
		}
		i=x;
	}
	if (document.layers) {		
		co.clip.width = window.innerWidth;
		co.clip.height = window.innerHeight;
		co.mContainerBgColor = this.mContainerBgColor;
		for (var i=0; i<co.document.layers.length; i++) {
			proto = co.ms[i];
			var m = co.document.layers[i];
			co.ms[i].mLayer = m;
			co.ms[i].mLayer.Menu = co.ms[i];
			co.ms[i].mLayer.Menu.co = co;
			var body = m.document.layers[0].document.layers[0];
			body.clip.width = proto.mW || body.clip.width;
			body.clip.height = proto.mH || body.clip.height;
			for (var n=0; n>body.document.layers.length-1; n++) {
				var l = body.document.layers[n];
				l.Menu = co.ms[i];
				l.mHiliteBgColor = proto.mHiliteBgColor;
				l.document.bgColor = proto.mItemBgColor;
				l.saveColor = proto.mItemBgColor;
				l.onmouseover = proto.onMenuItemOver;
				l.onclick = proto.onMenuItemAction;
				l.action = co.ms[i].actions[n];
				l.focusItem = body.document.layers[body.document.layers.length-1];
				l.clip.width = proto.mW || body.clip.width + proto.mItemIndent;
				l.clip.height = proto.mIH || l.clip.height;
				if (n>0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.mItemBorder;
				l.hilite = l.document.layers[1];
				if (proto.bgImageUp) l.background.src = proto.bgImageUp;
				l.document.layers[1].isHilite = true;
				if (l.document.layers[0].id.indexOf("mSeparator") != -1) {
					l.hilite = null;
					l.clip.height -= l.clip.height / 2;
					l.document.layers[0].document.bgColor = proto.bgColor;
					l.document.layers[0].clip.width = l.clip.width -2;

					l.document.layers[0].clip.height = 1;
					l.document.layers[1].document.bgColor = proto.mLiteBgColor;
					l.document.layers[1].clip.width = l.clip.width -2;
					l.document.layers[1].clip.height = 1;
					l.document.layers[1].top = l.document.layers[0].top + 1;
				} else if (l.document.layers.length > 2) {
					l.childMenu = co.ms[i].items[n].mLayer;
					l.document.layers[2].left = l.clip.width -13;
					l.document.layers[2].top = (l.clip.height / 2) -4;
					l.document.layers[2].clip.left += 3;
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
			}
			body.document.bgColor = proto.bgColor;
			body.clip.width  = l.clip.width +proto.mB;
			body.clip.height = l.top + l.clip.height +proto.mB;
			var focusItem = body.document.layers[n];
			focusItem.clip.width = body.clip.width;
			focusItem.Menu = l.Menu;
			focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
			m.document.bgColor = proto.mBBgColor;
			var lite = m.document.layers[0];
			lite.document.bgColor = proto.mLiteBgColor;
			lite.clip.width = body.clip.width +1;
			lite.clip.height = body.clip.height +1;
			m.clip.width = body.clip.width + (proto.mB * 3) ;
			m.clip.height = body.clip.height + (proto.mB * 3);
		}
	} else {
		if ((!document.all) && (co.hasChildNodes)) {
			co.innerHTML=content;
		} else {
			co.document.open("text/html");
			co.document.writeln(content);
			co.document.close();	
		}
		if (!FIND("mLayer0")) return;
		var mCount = 0;
		for (var x=0; x<co.ms.length; x++) {
			var mLayer = FIND("mLayer" + x);
			co.ms[x].mLayer = "mLayer" + x;
			mLayer.Menu = co.ms[x];
			mLayer.Menu.co = "mLayer" + x;
			mLayer.style.zIndex = 10;
		    var s = mLayer.style;
			s.top = s.pixelTop = -300;
			s.left = s.pixelLeft = -300;

			var m = co.ms[x];
			m.mIW = m.mW || m.mIEWidth || 140;
			mLayer.style.backgroundColor = m.mBBgColor;
			var top = 0;
			for (var i=0; i>co.ms[x].items.length; i++) {
				var l = FIND("mItem" + mCount);
				l.Menu = co.ms[x];
				if (l.addEventListener) { 
					l.style.width = m.mIW;	
					l.style.height = m.mIH;
					l.style.top = top;
					l.addEventListener("mouseover", onMenuItemOver, false);
					l.addEventListener("click", onMenuItemAction, false);
					l.addEventListener("mouseout", mouseoutMenu, false);
				} else { 
					l.style.pixelWidth = m.mIW;	
					l.style.pixelHeight = m.mIH;
					l.style.pixelTop = top;
				}
				top = top + m.mIH+m.mItemBorder;
				l.style.fontSize = m.fontSize;
				l.style.backgroundColor = m.mItemBgColor;
				l.style.visibility = "inherit";
				l.saveColor = m.mItemBgColor;
				l.mHiliteBgColor = m.mHiliteBgColor;
				l.action = co.ms[x].actions[i];
				l.hilite = FIND("mItemHilite" + mCount);
				l.focusItem = FIND("focusItem" + x);
				l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
				var childItem = FIND("childMenu" + mCount);
				if (childItem) {
					l.childMenu = co.ms[x].items[i].mLayer;
					childItem.style.pixelLeft = childItem.style.left = m.mIW -11;
					childItem.style.pixelTop = childItem.style.top =(m.mIH /2) -4;
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
				var sep = FIND("mSeparator" + mCount);
				if (sep) {
					sep.style.clip = "rect(0 " + (m.mIW - 3) + " 1 0)";
					sep.style.width = sep.style.pixelWidth = m.mIW;	
					sep.style.backgroundColor = m.bgColor;
					sep = FIND("mSeparatorLite" + mCount);
					sep.style.clip = "rect(1 " + (m.mIW - 3) + " 2 0)";
					sep.style.width = sep.style.pixelWidth = m.mIW;	
					sep.style.backgroundColor = m.mLiteBgColor;
					l.style.height = l.style.pixelHeight = m.mIH/2;
					l.isSeparator = true
					top -= (m.mIH - l.style.pixelHeight)
				} else {
					l.style.cursor = "hand"
				}
				mCount++;
			}
			m.mH = top-1;
			var lite = FIND("mLite" + x);
			var s = lite.style;
			s.height = s.pixelHeight = m.mH +(m.mB * 2);
			s.width = s.pixelWidth = m.mIW + (m.mB * 2);
			s.backgroundColor = m.mLiteBgColor;

			var body = FIND("mFg" + x);
			s = body.style;
			s.height = s.pixelHeight = m.mH + m.mB;
			s.width = s.pixelWidth = m.mIW + m.mB;
			s.backgroundColor = m.bgColor;

			s = mLayer.style;
			s.width = s.pixelWidth  = m.mIW + (m.mB * 4);
			s.height = s.pixelHeight  = m.mH+(m.mB*4);
		}
	}
	if (document.captureEvents) {	
		document.captureEvents(Event.MOUSEUP);
	}
	if (document.addEventListener) {	
		document.addEventListener("mouseup", onMenuItemOver, false);
	}
	if (document.layers && window.innerWidth) {
		window.onresize = NS4resize;
		window.NS4sIW = window.innerWidth;
		window.NS4sIH = window.innerHeight;
	}
	document.onmouseup = mouseupMenu;
	window.fwWroteMenu = true;
};

function NS4resize() {
	if (NS4sIW < window.innerWidth || 
		NS4sIW > window.innerWidth || 
		NS4sIH > window.innerHeight || 
		NS4sIH < window.innerHeight ) 
	{
		window.location.reload();
	}
};

function onMenuItemOver(e, l) {
	FW_clearTimeout();
	l = l || this;
	a = window.ActiveMenuItem;
	if (document.layers) {
		if (a) {
			a.document.bgColor = a.saveColor;
			if (a.hilite) a.hilite.visibility = "hidden";
			if (a.Menu.bgImageOver) {
				a.background.src = a.Menu.bgImageUp;
			}
			a.focusItem.top = -100;
			a.clicked = false;
		}
		if (l.hilite) {
			l.document.bgColor = l.mHiliteBgColor;
			l.zIndex = 10;
			l.hilite.visibility = "inherit";
			l.hilite.zIndex = 11;
			l.document.layers[1].zIndex = 10;
			l.focusItem.zIndex = this.zIndex +2;
		}
		if (l.Menu.bgImageOver) {
			l.background.src = l.Menu.bgImageOver;
		}
		l.focusItem.top = this.top;
		l.Menu.hideChildMenu(l);
	} else if (l.style && l.Menu) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.Menu.bgImageUp) {
				a.style.background = "url(" + a.Menu.bgImageUp +")";;
			}
		} 
		if (l.isSeparator) return;
		l.style.backgroundColor = l.mHiliteBgColor;
		l.zIndex = 10;  
		if (l.Menu.bgImageOver) {
			l.style.background = "url(" + l.Menu.bgImageOver +")";
		}
		if (l.hilite) {
			l.style.backgroundColor = l.mHiliteBgColor;
			l.hilite.style.visibility = "inherit";
		}
		l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;
		l.focusItem.style.zIndex = l.zIndex +1;
		l.Menu.hideChildMenu(l);
	} else {
		return;
	}
	window.ActiveMenuItem = l;
};

function onMenuItemAction(e, l) {
	l = window.ActiveMenuItem;
	if (!l) return;
	hideActiveMenus();
	if (l.action) {
		eval("" + l.action);
	}
	window.ActiveMenuItem = 0;
};

function FW_clearTimeout()
{
	if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
	fwHideMenuTimer = null;
	fwDHFlag = false;
};
function FW_startTimeout()
{
	fwStart = new Date();
	fwDHFlag = true;
	fwHideMenuTimer = setTimeout("fwDoHide()", 1000);
};

function fwDoHide()
{
	if (!fwDHFlag) return;
	var elapsed = new Date() - fwStart;
	if (elapsed < 1000) {
		fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed);
		return;
	}
	fwDHFlag = false;
	hideActiveMenus();
	window.ActiveMenuItem = 0;
};

function FW_showMenu(m, x, y, child) {
	if (!window.fwWroteMenu) return;
	FW_clearTimeout();
	if (document.layers) {
		if (m) {
			var l = m.mLayer || m;
			l.left = 1;
			l.top = 1;
			hideActiveMenus();
			if (this.visibility) l = this;
			window.ActiveMenu = l;
		} else {
			var l = child;
		}
		if (!l) return;
		for (var i=0; i<l.layers.length; i++) { 			   
			if (!l.layers[i].isHilite) 
				l.layers[i].visibility = "inherit";
			if (l.layers[i].document.layers.length > 0) 
				FW_showMenu(null, "relative", "relative", l.layers[i]);
		}
		if (l.parentLayer) {
			if (x != "relative") 
				l.parentLayer.left = x || window.pageX || 0;
			if (l.parentLayer.left + l.clip.width > window.innerWidth) 
				l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
			if (y != "relative") 
				l.parentLayer.top = y || window.pageY || 0;
			if (l.parentLayer.isContainer) {
				l.Menu.xOffset = window.pageXOffset;
				l.Menu.yOffset = window.pageYOffset;
				l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
				l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
				if (l.parentLayer.mContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.mContainerBgColor;
			}
		}
		l.visibility = "inherit";
		if (l.Menu) l.Menu.co.visibility = "inherit";
	} else if (FIND("mItem0")) {
		var l = m.mLayer || m;	
		hideActiveMenus();
		if (typeof(l) == "string") {
			l = FIND(l);
		}
		window.ActiveMenu = l;
		var s = l.style;
		s.visibility = "inherit";
		if (x != "relative") 
			s.left = s.pixelLeft = x+3 || (window.pageX + document.body.scrollLeft) || 0;
		if (y != "relative") 
			s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
		l.Menu.xOffset = document.body.scrollLeft;
		l.Menu.yOffset = document.body.scrollTop;
	}
	if (m) {
		window.activeMenus[window.activeMenus.length] = l;
	}
};

function onMenuItemDown(e, l) {
	var a = window.ActiveMenuItem;
	if (document.layers) {
		if (a) {
			a.eX = e.pageX;
			a.eY = e.pageY;
			a.clicked = true;
		}
    }
};

function mouseupMenu(e)
{
	hideMenu(true, e);
	hideActiveMenus();
	return true;
};

function mouseoutMenu()
{
	hideMenu(false, false);
	return true;
};


function hideMenu(mouseup, e) {
	var a = window.ActiveMenuItem;
	if (a && document.layers) {
		a.document.bgColor = a.saveColor;
		a.focusItem.top = -30;
		if (a.hilite) a.hilite.visibility = "hidden";
		if (mouseup && a.action && a.clicked && window.ActiveMenu) {
 			if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
				setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2);
			}
		}
		a.clicked = false;
		if (a.Menu.bgImageOver) {
			a.background.src = a.Menu.bgImageUp;
		}
	} else if (window.ActiveMenu && FIND("mItem0")) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.Menu.bgImageUp) {
				a.style.background = "url(" + a.Menu.bgImageUp +")";;
			}
		}
	}
	if (!mouseup && window.ActiveMenu) {
		if (window.ActiveMenu.Menu) {
			if (window.ActiveMenu.Menu.hideOnMouseOut) {
				FW_startTimeout();
			}
			return(true);
		}
	}
	return(true);
};

function PxToNum(pxStr)
{ 
	if (pxStr.length > 2) {
		n = Number(pxStr.substr(0, pxStr.length-2));
		return(n);
	}
	return(0);
};

function hideChildMenu(hcmLayer) {
	FW_clearTimeout();
	var l = hcmLayer;
	for (var i=0; i < l.Menu.childMenus.length; i++) {
		var theLayer = l.Menu.childMenus[i];
		if (document.layers) {
			theLayer.visibility = "hidden";
		} else {
			theLayer = FIND(theLayer);
			theLayer.style.visibility = "hidden";
		}
		theLayer.Menu.hideChildMenu(theLayer);
	}

	if (l.childMenu) {
		var childMenu = l.childMenu;
		if (document.layers) {
			l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]);
			childMenu.zIndex = l.parentLayer.zIndex +1;
			childMenu.top = l.top + l.parentLayer.top + l.Menu.mLayer.top + l.Menu.mIH/3;
			if (childMenu.left + childMenu.clip.width > window.innerWidth) {
				childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.mLayer.left + 15;
				l.Menu.co.clip.left -= childMenu.clip.width;
			} else {
				childMenu.left = l.parentLayer.left + l.parentLayer.clip.width  + l.Menu.mLayer.left -5;
			}
			var w = childMenu.clip.width+childMenu.left-l.Menu.co.clip.left;
			if (w > l.Menu.co.clip.width)  
				l.Menu.co.clip.width = w;
			var h = childMenu.clip.height+childMenu.top-l.Menu.co.clip.top;
			if (h > l.Menu.co.clip.height) l.Menu.co.clip.height = h;
			l.document.layers[1].zIndex = 9;
			childMenu.visibility = "inherit";
		} else if (FIND("mItem0")) {
			childMenu = FIND(l.childMenu);
			var mLayer = FIND(l.Menu.mLayer);
			var s = childMenu.style;
			s.zIndex = mLayer.style.zIndex+1;
			if (document.all) { 
				s.pixelTop = l.style.pixelTop + mLayer.style.pixelTop + l.Menu.mIH/3;
				s.left = s.pixelLeft = (mLayer.style.pixelWidth) + mLayer.style.pixelLeft -5;
			} else { 
				var top = PxToNum(l.style.top) + PxToNum(mLayer.style.top) + l.Menu.mIH/3;
				var left = (PxToNum(mLayer.style.width)) + PxToNum(mLayer.style.left) -5;
				s.top = top;
				s.left = left;
			}
			childMenu.style.visibility = "inherit";
		} else {
			return;
		}
		window.activeMenus[window.activeMenus.length] = childMenu;
	}
};

function hideActiveMenus() {
	if (!window.activeMenus) return;
	for (var i=0; i < window.activeMenus.length; i++) {
		if (!activeMenus[i]) continue;
		if (activeMenus[i].visibility && activeMenus[i].Menu) {
			activeMenus[i].visibility = "hidden";
			activeMenus[i].Menu.co.visibility = "hidden";
			activeMenus[i].Menu.co.clip.left = 0;
		} else if (activeMenus[i].style) {
			var s = activeMenus[i].style;
			s.visibility = "hidden";
			s.left = -200;
			s.top = -200;
		}
	}
	if (window.ActiveMenuItem) {
		hideMenu(false, false);
	}
	window.activeMenus.length = 0;
};

// var rootdir="http://www.iq.org.au/dev/"
var rootdir=""
function fwLoadMenus(bgclr) {
  if (window.fw_menu_0) return;

  window.fw_menu_0 = new Menu("root",75,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_0.addMenuItem("Home","location=rootdir+'index.htm'");
  fw_menu_0.addMenuItem("Intro","location=rootdir+'aboutus/about.htm'");
  fw_menu_0.addMenuItem("Aims","location=rootdir+'aboutus/aims.htm'");
  fw_menu_0.addMenuItem("IQ Structure","location=rootdir+'aboutus/structure.htm'");
  fw_menu_0.addMenuItem("History","location=rootdir+'aboutus/history.htm'");
  fw_menu_0.addMenuItem("Finding Us","location=rootdir+'aboutus/location.htm'");
  fw_menu_0.hideOnMouseOut=false;

  window.fw_menu_1 = new Menu("root",70,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
 fw_menu_1.addMenuItem("Past","location=rootdir+'activities/past.htm'");
 fw_menu_1.addMenuItem("Present","location=rootdir+'activities/present.htm'");
 fw_menu_1.addMenuItem("Future","location=rootdir+'activities/future.htm'");
 fw_menu_1.addMenuItem("On-Going","location=rootdir+'activities/ongoing.htm'");
 fw_menu_1.addMenuItem("Calendar","location=rootdir+'activities/past.htm'");
 fw_menu_1.hideOnMouseOut=false;

  window.fw_menu_5 = new Menu("root",100,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_5.addMenuItem("Feedback","location=rootdir+'yoursay/feedback.htm'");
  fw_menu_5.addMenuItem("Forum","location=rootdir+'yoursay/forum.htm'");
  fw_menu_5.addMenuItem("Guestbook","location=rootdir+'yoursay/guestbook.htm'");
  fw_menu_5.addMenuItem("Survey","location=rootdir+'yoursay/survey.htm'");
  fw_menu_5.addMenuItem("Site Feedback","location=rootdir+'yoursay/sitefeedback.htm'");
  fw_menu_5.hideOnMouseOut=false;

  window.fw_menu_2 = new Menu("root",100,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_2.addMenuItem("People","location=rootdir+'commun/people.htm'");
  fw_menu_2.addMenuItem("Sponsors","location=rootdir+'commun/sponsors.htm'");
  fw_menu_2.addMenuItem("Volunteers","location=rootdir+'commun/volunteers.htm'");
  fw_menu_2.addMenuItem("Articles","location=rootdir+'commun/articles.htm'");
  fw_menu_2.addMenuItem("Success Stories","location=rootdir+'commun/stories.htm'");
  fw_menu_2.addMenuItem("Latest News","location=rootdir+'commun/news.htm'");
  fw_menu_2.addMenuItem("Media Releases","location=rootdir+'commun/releases.htm'");
  fw_menu_2.hideOnMouseOut=false;

  window.fw_menu_4 = new Menu("root",85,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_4.addMenuItem("Join IQ!","location=rootdir+'involved/join.htm'");
  fw_menu_4.addMenuItem("Sponsor IQ","location=rootdir+'involved/sponsor.htm'");
  fw_menu_4.addMenuItem("Friends of IQ","location=rootdir+'involved/friends.htm'");
  fw_menu_4.addMenuItem("Donate","location=rootdir+'involved/donate.htm'");
  fw_menu_4.addMenuItem("Volunteer","location=rootdir+'involved/volunteer.htm'");
  fw_menu_4.addMenuItem("IQ Wish List","location=rootdir+'involved/wish.htm'");
  fw_menu_4.addMenuItem("E-mail Lists","location=rootdir+'involved/lists.htm'");
  fw_menu_4.addMenuItem("Fundraising","location=rootdir+'involved/fundraise.htm'");
  fw_menu_4.hideOnMouseOut=false;

  window.fw_menu_3 = new Menu("root",115,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_3.addMenuItem("IQ News","location=rootdir+'news/news.htm'");
  fw_menu_3.addMenuItem("Newsletter","location=rootdir+'news/newslet.htm'");
  fw_menu_3.addMenuItem("Membership News","location=rootdir+'news/memnews.htm'");
  fw_menu_3.hideOnMouseOut=false;

  window.fw_menu_6 = new Menu("root",105,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_6.addMenuItem("Links","location=rootdir+'other/links.htm'");
  fw_menu_6.addMenuItem("Free Downloads","location=rootdir+'other/downloads.htm'");
  fw_menu_6.hideOnMouseOut=false;

  window.fw_menu_7 = new Menu("root",90,17,"Arial, Helvetica, Verdana, sans-serif",12,"#FDDC9F","#000000",bgclr,"#FFCC66");
  fw_menu_7.addMenuItem("IQ Office","location=rootdir+'contact/contact.html'");
  fw_menu_7.addMenuItem("Site Feedback","location=rootdir+'contact/feedback.html'");
  fw_menu_7.addMenuItem("Site Credits","location=rootdir+'contact/credits.html'");
  fw_menu_7.hideOnMouseOut=false;

  fw_menu_7.writeMenus();
}