function dma_left_nav_mOver(idObj,colorObj)
{
	document.getElementById(idObj.id).style.color = colorObj;
	document.getElementById(idObj.id).style.textDecoration = "underline";
}
function dma_left_nav_mOut(idObj,colorObj)
{
	document.getElementById(idObj.id).style.color = colorObj;
	document.getElementById(idObj.id).style.textDecoration = "none";
}

/////////////////////////////////////////////////////////////////////////////
// Class : dma_left_nav
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function dma_left_nav()
{
	this.m_NavPath    = g_navNode_Path;
	dma_left_nav.prototype.Display = dma_left_nav_Display;
	dma_left_nav.prototype.DisplayNode = dma_left_nav_DisplayNode;

	this.textColor_a  = '';
	this.textColor_i  = '#00a3e0';
	this.textColor = '';

}

function dma_left_nav_Display (node)
{
	document.write('<!--DMA Left Nav (start)-->\n');
	document.write('<div id="navcontainer">\n');
	document.write('<ul id="navlist">\n');
	this.DisplayNode(node);
	document.write('</ul>\n');
	document.write('</div>\n');
	document.write('<!--DMA Left Nav (end)-->\n');
}

function dma_left_nav_DisplayNode(node)
{
	var bSelected = false;
	var nodeLevel = node.m_level;

	if (nodeLevel > 6)
		nodeLevel = 6;
	
	if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length)
	{
		if (this.m_NavPath[node.m_level] == node.m_id)
		{
			bSelected = true;
			//nodeColor = this.m_FocusColor;
			//nodeClass += '-focus';
			//alert("g_ssSourceNodeId = " + g_ssSourceNodeId + "\nthis.m_NavPath[node.m_level] = " + this.m_NavPath[node.m_level] + "\nnode.m_id = " + node.m_id);
		}
	}
	
	if (nodeLevel >= 2)
	{
		var ds = new Array();
		var di = 0;

		/*
		if (node.m_level >= 3) {
			leftmargin = '18px';
		} else {
			leftmargin = '0px';
		}
		*/

		if (node.m_level == 3) {
			leftmargin = '16px';
		} else if (node.m_level >= 4) {
			leftmargin = '32px';
		} else {
			leftmargin = '0px';
		}

		if (getCustomSectionProperty(node.cp_ShowItalicize).toLowerCase() == "true")
		{
			fontstyle = "italic";
		} else {
			fontstyle = "normal";
		}
		
		//alert(node.m_label + "\n" + getCustomSectionProperty(node.cp_MenuTextColor));
		
		if (getCustomSectionProperty(node.cp_MenuTextColor) != "")
		{
			// this.textColor_a = getCustomSectionProperty(node.cp_MenuTextColor);
			this.textColor = getCustomSectionProperty(node.cp_MenuTextColor);
		}
		else
		{
			// this.textColor_a = "#00a3e0";
			this.textColor = "#00a3e0";
		}
		
		//if (bSelected)
		if (parseInt(g_ssSourceNodeId) == node.m_id)
		{
			ds[di++] = '<li id="active" style="background-color:' + this.textColor + ';margin-left:' + leftmargin + ';font-style:' + fontstyle + '">';
			ds[di++] = '<a id="current" href="' + node.m_href + '" style="color:#ffffff;background-color:' + this.textColor + '">';
			if (node.m_level >= 3)
			{
				ds[di++] = '<span style="font-size:10.5px">' + node.m_label + '</span>';
			}
			else
			{
				ds[di++] = node.m_label
			}
			ds[di++] = '</a></li>\n';

		}
		else
		{
			//if (node.m_level >= 3) {
			//	ds[di++] = '<li style="margin-left:15px;">';
			//}
			//else {
			//	ds[di++] = '<li>';
			//}
			ds[di++] = '<li style="margin-left:' + leftmargin + '"><a id="' + node.m_id + '" href="' + node.m_href + '" ';
			ds[di++] = 'style="color:' + this.textColor + ';font-style:' + fontstyle + '" ';
			ds[di++] = 'onmouseover="dma_left_nav_mOver(this,\'' + this.textColor + '\');" ';
			ds[di++] = 'onmouseout="dma_left_nav_mOut(this,\'' + this.textColor + '\');">';
			if (node.m_level >= 3)
			{
			    ds[di++] = '<span style="font-size:10.5px">' + node.m_label + '</span>';
			}
			else
			{
			    ds[di++] = node.m_label;
			}
			ds[di++] = '</a></li>\n';
			//ds[di++] = node.m_label + '</a></li>\n';
		}
		
		document.write(ds.join(''));
	}
	
	if (bSelected)
	{	// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}
