/////////////////////////////////////////////////////////////////////////////
// Class : cos_sub_left_nav_level
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function cos_sub_left_nav_level(strTextColor, strHoverColor, strFocusColor, strClassName)
{
	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_FocusColor = '';
	this.m_ClassName  = 'cos_sub_left_nav_level';

	this.m_NavPath    = g_navNode_Path;
		
	cos_sub_left_nav_level.prototype.Display = cos_sub_left_nav_level_Display;
	cos_sub_left_nav_level.prototype.DisplayNode = cos_sub_left_nav_level_DisplayNode;
	
	if (strTextColor != '')
		this.m_TextColor = strTextColor;
		
	if (strHoverColor != '')
		this.m_HoverColor = strHoverColor;

	if (strFocusColor != '')
		this.m_FocusColor = strFocusColor;

	if (strClassName != '')
		this.m_ClassName = strClassName;
}

function cos_sub_left_nav_level_Display (node)
{
	document.write('<dl>');
	this.DisplayNode(node);
	document.write('</dl>');
}

function cos_sub_left_nav_level_DisplayNode(node)
{
	var bSelected = false;
	var nodeColor = this.m_TextColor;
	var nodeClass = this.m_ClassName;
	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';
		}
	}
	
	nodeClass += '-' + nodeLevel;

	//if (nodeLevel >= 3)
	if (nodeLevel == 3)
	{
		var ds = new Array();
		var di = 0;
		
		ds[di++] = (nodeLevel <= 3) ? '<dt' : '<dd';
		ds[di++] = ' class="' + nodeClass + '"';
		ds[di++] = '>';
		
		//ds[di++] = '<img src="groups/website/documents/web_images/cos_000070.gif" border="0" alt="" />';
		ds[di++] = '<span class="bulletpoint" style="text-decoration:none;">&nbsp;&nbsp;</span>';

		ds[di++] = '<a href="' + node.m_href + '"';
		ds[di++] = ' class="sidenavoff" class="' + nodeClass + '"';
		
		if (nodeColor != '')
		{	
			ds[di++] = ' style="color:' + nodeColor + ';"';

			if (!bSelected && this.m_HoverColor != '')
			{
				ds[di++] = ' onmouseover="this.style.color=\'' + this.m_HoverColor + '\'"';
				ds[di++] = ' onmouseout="this.style.color=\'' + nodeColor + '\'"';
			}
		}
		
		ds[di++] = '>'
		ds[di++] = node.m_label;
		ds[di++] = '</a>';
		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]);
		}
	}
}

