/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007, 2008, Oracle. All rights reserved.
// Function : SS_HP_BreadCrumb_Plain
// Comments :
/////////////////////////////////////////////////////////////////////////////

function SS_HP_BreadCrumb_Plain(strTextColor, strHoverColor, strSeparator, strClassName)
{
	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_Separator  = '&nbsp;&gt;&nbsp;';
	this.m_ClassName  = 'SS_HP_BreadCrumb_Plain';

	this.m_NavPath    = g_navNode_Path;

	if (strTextColor != '')
		this.m_TextColor = strTextColor;

	if (strHoverColor != '')
		this.m_HoverColor = strHoverColor;

	if (strSeparator != '')
		this.m_Separator = strSeparator;

	if (strClassName != '')
		this.m_ClassName = strClassName;

	SS_HP_BreadCrumb_Plain.prototype.Display = SS_HP_BreadCrumb_Plain_Display;
	SS_HP_BreadCrumb_Plain.prototype.DisplayNode = SS_HP_BreadCrumb_Plain_DisplayNode;
}

function SS_HP_BreadCrumb_Plain_Display (node)
{
	document.write ('<nav><div class="nav" id="breadcrumb" role="navigation"><ul>');

	this.DisplayNode(node);

	document.write ('</ul></div></nav>');
}

function SS_HP_BreadCrumb_Plain_DisplayNode(node)
{
	var level = node.m_level;

	var bExpand = false;
	var nodeColor = this.m_TextColor;
	var nodeClass = this.m_ClassName;

	var ds = new Array();
	var di = 0;

	if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length)
	{
		if (this.m_NavPath[node.m_level] == node.m_id)
			bExpand = true;
	}

	if (bExpand)
	{
	  if (this.m_NavPath[this.m_NavPath.length-1] != node.m_id)
      {
		ds[di++] = '<li><a href="' + node.m_href + '">';
		ds[di++] = node.m_label;
		ds[di++] = '</a></li>';
      }
      else
      {
        ds[di++] = '<li><span>';
        ds[di++] = node.m_label;
        ds[di++] = '</span></li>';
      }

		document.write(ds.join(''));	// Write out the "live" path only

		// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}

