// ------------- SETTINGS ------------- //

cVertical = false;
cCellWidth = 125;
cMyCellWidth = 200;
//cRootFontStyle = "font-family : verdana ; font-size : 10px ; color : #ffffff";
cRootFontStyle = "font-family: Arial, Helvetica, sans-serif; font-size: 11px;font-weight: bold;color: #002473; height:18px; text-align: center; ";
cFontStyle = "font-family: Arial, Helvetica, sans-serif; font-size: 11px;font-weight: normal;color: #002473;	padding-left: 5px; border-top: 1px solid #002473; border-right: 1px solid #002473;border-left: 1px solid #002473; background-color: #ffffff;height:18px;"
cTextCellPadding = 1;

cRootBGColor = "#ffffff";
cRootHoverColor = "#2875E6";
cRootHoverTextColor =  "#ffffff";
cRootOutTextColor =  "#002473";


cBGColor = "#ffffff";
cHoverColor = "#2875E6";
cHoverTextColor =  "#ffffff";
cOutTextColor =  "#002473";

cBorderColor = "#002473";
cArrow = "images/spacer.gif";
cArrowOver = "images/spacer.gif";
cSpacerImage = "images/spacer.gif";

// ----------------------------------- //


if (navigator.userAgent.indexOf("MSIE") != -1) cHoverCursor = "hand";
else cHoverCursor = "pointer";

function fnMenuClick(arg,pageid,xtarget)
	{
	for (cnt = 1 ; cnt < aTables.length ; cnt++)
		{
		oTable = eval("document.getElementById(\"oNavTable" + aTables[cnt] + "\")");
		oTable.style.visibility = "hidden";
		}
	if (arg != "*")
		{
	//	window.location.href = "?page=" + arg ;
		window.location.target=xtarget;
		window.location.href = "Page.asp?PageID=" + pageid;		
		}
	}

function fnInArray(array,string)
	{
	var isTrue;
	isTrue = 0;
	for (inArrayCnt = 0 ; inArrayCnt < array.length ; inArrayCnt ++)
		{
		if (array[inArrayCnt] == string)
			{
			isTrue = 1;
			break;
			}
		}
	if (isTrue == 1) return true;
	else return false;
	}

function fnXOffset(obj)
	{
	var iXValue;
	iXValue = -1;
	while (obj)
		{
		iXValue += obj.offsetLeft;
		obj = obj.offsetParent;
		}
	return iXValue;
	}
	
function fnYOffset(obj)
	{
	var iYValue;
	iYValue = 0;
	while (obj)
		{
		iYValue += obj.offsetTop;
		obj = obj.offsetParent;
		}
	return iYValue;
	}
	
	
function fnCellOver(id,source)
{
	if (aNavData[id][0] == 0) 
	{	
		source.style.color = cRootHoverTextColor;
		source.style.backgroundColor= cRootHoverColor;
	}
	else 
	{
		source.style.color = cHoverTextColor;
		source.style.backgroundColor= cHoverColor;		
	}
}

function fnCellOut(id,source)
{
	if (aNavData[id][0] == 0) 
	{	
		source.style.color = cRootOutTextColor;
		source.style.backgroundColor= cRootBGColor;		
	}
	else 
	{
		source.style.color = cOutTextColor;
		source.style.backgroundColor= cBGColor;		
	}
}

	
function fnMenuOver(id,source)
	{
	source.style.cursor = cHoverCursor;

	if (!window.inTimer) window.inTimer = window.setInterval("fnCloser()",100);

	iCell = id;
	iPanel = aNavData[id][0];
	clearTimeout(window.toPanel);
	
	if (aNavData[iCell][3])
		{
		document.getElementById("navDescript").innerHTML = aNavData[iCell][3];
		}
	
	if(fnInArray(aTables,iCell))
		{
		oTable = eval("document.getElementById(\"oNavTable" + id + "\")");
		
		if (oTable.style.visibility == "hidden")
			{
			if ((cVertical == false)&&(iPanel == 0))
				{
				oTable.style.left = (fnXOffset(source) - 0);
				oTable.style.top = (fnYOffset(source) + source.offsetHeight);
				}
			else
				{
				oTable.style.top = (fnYOffset(source) - 0);

				if ((fnXOffset(source) + source.offsetWidth + oTable.offsetWidth) > document.body.clientWidth)
					{
					oTable.style.left = (fnXOffset(source) - oTable.offsetWidth);
					oTable.style.top = (fnYOffset(source) + 3);
					}
				else
					{
					oTable.style.left = (fnXOffset(source) + source.offsetWidth);
					oTable.style.top = (fnYOffset(source) - 0);
					}
				}
			if (window.toFirsttime) clearTimeout(window.toFirsttime);
			window.toFirsttime = window.setTimeout("document.getElementById(\"oNavTable" + id + "\").style.visibility = \"visible\"",100);
			

			
			}
		}
		
		source.style.backgroundColor = cRootHoverColor;

	if (eval("document.getElementById(\"oMenuArrow" + id + "\")"))
		{
		eval("document.getElementById(\"oMenuArrow" + id + "\").src = \"" + cArrowOver + "\"");
		}		
	}

function fnMenuOut(out,source)
	{
	if (eval("document.getElementById(\"oMenuArrow" + out + "\")"))
		{
		eval("document.getElementById(\"oMenuArrow" + out + "\").src = \"" + cArrow + "\"");
		}
	if (window.toFirsttime) clearTimeout(window.toFirsttime);	

	if (aNavData[out][0] == 0) 
	{
		source.style.backgroundColor = cRootBGColor;
	}
	else 
	{
		source.style.backgroundColor = cBGColor;
	}
	window.toPanel = window.setTimeout("iPanel = -1",300);
	}

function fnCloser()
	{
	if (iPanel == -1)
		{
		for (cnt = 1 ; cnt < aTables.length ; cnt++)
			{
			oTable = eval("document.getElementById(\"oNavTable" + aTables[cnt] + "\")");
			oTable.style.visibility = "hidden";
			}
		}
	else
		{
		for (cnt = 1 ; cnt < aTables.length ; cnt++)
			{
			if (!fnInArray(aNavData[iCell][13],aTables[cnt]))
				{
				oTable = eval("document.getElementById(\"oNavTable" + aTables[cnt] + "\")");
				oTable.style.visibility = "hidden";				
				}
			}
		}
	}

var aTables, aTableData, iCell, iPanel, oSource, strTemp;

aTables = Array();
aTableData = Array();

for (cnt = 1 ; cnt < aNavData.length ; cnt++)
	{
	if (aNavData[cnt])
		{
		if (!fnInArray(aTables,aNavData[cnt][0]))
			{
			aTables[aTables.length] = aNavData[cnt][0];
			strTemp = "";
			if (aNavData[cnt][0] != 0)strTemp += "<table cellpadding=\"0\" cellspacing=\"0\"  style=\"border-bottom: 1px solid #002473; position : absolute ; visibility : hidden ; \" border=\"0\" width=\"" + cMyCellWidth + "\"";
			else strTemp += "<table cellpadding=\"0\" bgcolor=\"#002473\"cellspacing=\"1\" border=\"0\"  height=\"18\" width=\"" + cMyCellWidth + "\"";
			
			strTemp += " id=\"oNavTable" + aNavData[cnt][0] + "\">";
			if ((cVertical == false)&&(aNavData[cnt][0] == 0)) strTemp += "<tr>";
			aTableData[aNavData[cnt][0]] = strTemp;
			}
		}	
	}

for (cnt = 1 ; cnt < aNavData.length ; cnt++)
	{
	if (aNavData[cnt])
		{
		strTemp = "";
		if ((cVertical == true)||(aNavData[cnt][0] != 0)) strTemp += "<tr>";

		if (aNavData[cnt][0] == 0)
			{
			cnfBGColor = cRootBGColor;
			cnfFontStyle = cRootFontStyle;
			}
		else
			{
			cnfBGColor = cBGColor;
			cnfFontStyle = cFontStyle;
			}
		strTemp += "<td bgcolor=\"" + cnfBGColor + "\"";
		strTemp += " width=\"100%\">";
		if (aNavData[cnt][0] != 0) strTemp += "<table  cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">";
		else  strTemp += "<table width=\"" + cCellWidth + "\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" >";
		strTemp += "<tr onmouseover=\"fnMenuOver(" + cnt + ",this);\"  onmouseout=\"fnMenuOut(" + cnt + ",this)\"";
		if (aNavData[cnt][2]) strTemp += " onclick=\"fnMenuClick('" + aNavData[cnt][2] + "','" + aNavData[cnt][4] + "','" + aNavData[cnt][5] + "')\"";
		strTemp += ">";
		strTemp += "<td onmouseover=\"fnCellOver(" + cnt + ",this);\" onmouseout=\"fnCellOut(" + cnt + ",this);\" style=\"" + cnfFontStyle + "";
		if (aNavData[cnt][0] != 0) strTemp += "";
		strTemp += "\" width=\"100%\">";
		strTemp += aNavData[cnt][1];
		strTemp += "</td>";
		
		strTemp += "</tr></table></td>";
		if ((cVertical == true)||(aNavData[cnt][0] != 0)) strTemp += "</tr>";
		aTableData[aNavData[cnt][0]] += strTemp;
		id = cnt;
		aNavData[cnt][13] = Array();
		while (id > 0)
			{
			for (x = 1 ; x < aNavData.length ; x++)
				{
				if (aNavData[x])
					{
					if (x == id)
						{
						aNavData[cnt][13][aNavData[cnt][13].length] = id; 

						id = aNavData[x][0];
						break;
						}
					}
				}
			}
		}
	}	

strTemp = "";

for (cnt = 0 ; cnt < aTableData.length ; cnt++)
	{
	if (aTableData[cnt])
		{
		strTemp += aTableData[cnt];
		if ((cVertical == false)&&(aNavData[cnt][0] == 0)) strTemp += "</tr>";
		strTemp += "</table>";
		}
	}


//window.clipboardData.setData("Text", strTemp);
document.write(strTemp);