/////////////////////////////////////////////////////////////////////////////
// Function : umc_breadcrumbs
// Comments : Modified version of UR Template Breadcrumbs
/////////////////////////////////////////////////////////////////////////////

function umc_breadcrumbs(strSeparator, strTopLevel)
{
	this.m_TopLevel   = 0;
	this.m_Separator  = '&nbsp;&gt;&nbsp;';

	this.m_NavPath    = g_navNode_Path;
	
	if (strSeparator != '')
		this.m_Separator = strSeparator;
		
	if (strTopLevel != '')
	{
		var value = parseInt(strTopLevel);
		if (value != NaN)
			this.m_TopLevel = value;
	}
		
	umc_breadcrumbs.prototype.Display = umc_breadcrumbs_Display;
	umc_breadcrumbs.prototype.DisplayNode = umc_breadcrumbs_DisplayNode;
}

function umc_breadcrumbs_Display (node)
{
	this.DisplayNode(node);
}

function umc_breadcrumbs_DisplayNode(node)	
{
	var level = node.m_level;
	var topLevel = this.m_TopLevel;

	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 (node.m_level >= topLevel)
		{

			if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length-1)
				ds[di++] = '<a href="' + node.m_href + '">';
		
			ds[di++] = node.m_label;

			if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length-1)
				ds[di++] = '</a>';
			
			if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length-1)
				ds[di++] = this.m_Separator;
	
			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]);
		}
	}
}
