/////////////////////////////////////////////////////////////////////////////////////////////////
// Function : WE_Breadcrumb
// Comments :	Programmer		Date		Changes
//				Jason Alstead	12/20/04	New fragment (copied from Breadcrumb Plain)
//											Removed all paramenters and code referring to them
////////////////////////////////////////////////////////////////////////////////////////////////

function WE_Breadcrumb()
{
	this.m_Separator  = '&nbsp;/&nbsp;';
	this.m_NavPath    = g_navNode_Path;	
	
	WE_Breadcrumb.prototype.Display = WE_Breadcrumb_Display;
	WE_Breadcrumb.prototype.DisplayNode = WE_Breadcrumb_DisplayNode;
}

function WE_Breadcrumb_Display (node)
{
	this.DisplayNode(node);
}

function WE_Breadcrumb_DisplayNode(node)	
{
	var level = node.m_level;
	var bExpand = false;
	
	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)
	{
		//do not show nodes that are for organization purposes only
		if (getCustomSectionProperty(node.cp_IncludeInSiteMap).toLowerCase() == 'true' ){		
			if (g_ssSourceNodeId != node.m_id){
				ds[di++] = '<a class="breadcrumb-link" ';
				ds[di++] = 'href="' + node.m_href + '">';
				ds[di++] = node.m_label;
				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]);
		}
	}
}


