/////////////////////////////////////////////////////////////////////////////
// Function : gtBreadcrumb
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function gtBreadcrumb()
{
	this.m_NavPath    = g_navNode_Path;
		
	gtBreadcrumb.prototype.Display = gtBreadcrumb_Display;
	gtBreadcrumb.prototype.DisplayNode = gtBreadcrumb_DisplayNode;
}

function gtBreadcrumb_Display (node)
{
	document.write ('<span class="gtBreadcrumb">');

        /********************************************/
        /************ TUTORIAL HYPERLINK ************/
        /********************************************/
        if (SSContributor)
	   generateTutorialLink('gtBreadcrumb', 'click here to learn more about the breadcrumb fragment');
        /********************************************/
        /************ TUTORIAL HYPERLINK ************/
        /********************************************/

	this.DisplayNode(node);
	document.write ('&nbsp;&nbsp;</span>');
}

function gtBreadcrumb_DisplayNode(node)	
{
	var level = node.m_level;

	var bExpand = false;

	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)
	{
		document.write('<a href="' + node.m_href + '" class="gtBreadcrumb">');
		document.write(node.m_label);
		document.write('</a>');
		
		if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length-1)
			document.write('&nbsp;&gt;&nbsp;');

		// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}
