////////////////////////////////////////////////////////////////////DO NOT REMOVE/////
////////     DROPDOWN MENUS v2 BY PAUL SHERMAN.
////////     COPYRIGHT 2004.
////////     UNAUTHORIZED USE OR DUPLICATION IS UNLAWFUL.
////////     THIS COPY CARRIES A ONE TIME USE AFREEMENT
////////     AUTHORIZED TO RDR INC AT TIME OF SITE LAUNCH.
////////     DATE:
////////////////////////////////////////////////////////////////////DO NOT REMOVE/////


activeLayer = ""
imageDump = ""
menuCode = ""

function loadObjects() {
	for (x=0;x<menuNameArray.length;x++) {
		menuArray = eval(menuNameArray[x] + "Array")
		if (menuArray.length > 1) {
			menuCode += "<div id='" + menuNameArray[x] + "Layer' style='position:absolute;top:" + menuArray[0][1] + ";left:" + menuArray[0][2] + ";visibility:hidden;z-index:20'><table border=0 cellpadding=0 cellspacing=5 width=" + menuArray[0][3] + " class=menuTable1>"
			for (z=1;z<menuArray.length;z++) {
				menuCode += "<tr><td width=6 id=" + menuNameArray[x] + "Itemb" + z + " style='cursor:pointer' valign=top><img src='" + filePath + "images/bullet_01.gif'></td><td valign=top class=menuCell1 id=" + menuNameArray[x] + "Item" + z + ">" + menuArray[z][0] + "</td></tr>"
			}
			menuCode += "</table></div>\n"
		}
	}

	document.write(menuCode)

	for (x=0;x<menuNameArray.length;x++) {
		menuArray = eval(menuNameArray[x] + "Array")
		thisImage = eval("document." + menuNameArray[x] + "Img")
		thisImage.defaultState = filePath + "images/navm_" + menuNameArray[x] + ".gif"
		thisImage.overState = filePath + "images/navm_" + menuNameArray[x] + "_over.gif"
		imageDump += "<img src='" + thisImage.overState + "'><br>"
		eval("thisImage.onmouseover = function() { showMenu('" + menuNameArray[x] + "Layer') }")
		eval("thisImage.onmouseout = function() { hideMenu('" + menuNameArray[x] + "Layer') }")
		for (z=1;z<menuArray.length;z++) {
			getObject(menuNameArray[x] + "Item" + z).onmouseover = function() { this.className = 'menuCell2' }
			getObject(menuNameArray[x] + "Item" + z).onmouseout = function() { this.className = 'menuCell1' }
			eval('getObject(menuNameArray[x] + "Item" + z).onclick = function() { location = "' + filePath + menuArray[z][1] + '" }')
			eval('getObject(menuNameArray[x] + "Itemb" + z).onclick = function() { location = "' + filePath + menuArray[z][1] + '" }')
		}
		if (menuArray.length > 1) {
			eval("getObject('" + menuNameArray[x] + "Layer').onmouseover = function() { activeLayer = '" + menuNameArray[x] + "Layer' }")
			eval("getObject('" + menuNameArray[x] + "Layer').onmouseout = function() { hideMenu('" + menuNameArray[x] + "Layer') }")
		}
	}

	document.write("<div id=imageDumpLayer style='position:absolute;visibility:hidden;width:200px;height:200px;top:0;left:0;'>" + imageDump + "</div>")

}

var IE5 = DOM = false
if (document.getElementById) { DOM = true }
if (document.all && !DOM) IE5 = true
if (DOM || IE5) BC = true

if (BC) { loadObjects() }



function showMenu(menuName) {
	if (BC) {
		turnOn(menuName.replace(/Layer/,"Img"))
		if (eval(menuName.replace(/Layer/,"") + "Array.length") > 1) {
			eval("getObject('" + menuName + "').style.visibility = 'visible'")
		}
		activeLayer = menuName
	}
}

function hideMenu(menuName) {
	if (BC) {
		wait = setTimeout("actuallyHide('" + menuName + "')",10)
		activeLayer = ""
	}
}

function actuallyHide(menuName) {
	if (activeLayer != menuName) {
		if (eval(menuName.replace(/Layer/,"") + "Array.length") > 1) {
			eval("getObject('" + menuName + "').style.visibility = 'hidden'")
		}
		turnOff(menuName.replace(/Layer/,"Img"))
	}
}

function getObject(theName) {
	theObject = (DOM) ? document.getElementById(theName) : document.all(theName)
	return theObject
}
