/////////////////////////////////////////////////////////////////////////////
// Function : leftnav_tree
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function leftnav_tree( strClassName, strShowHome, strStartLevel, strNumLevels, strLevelClass)
{

	this.m_ClassName  = 'leftnav';
	this.m_LevelClass  = 'leftnavsub';
	
	this.m_ShowHome   = false;
	
	this.m_StartLevel = 2;
	this.m_NumLevels  = 10;
	this.m_EndLevel   = 11;
	
	this.m_NavPath    = g_navNode_Path;
			
	leftnav_tree.prototype.Display = leftnav_tree_Display;
	leftnav_tree.prototype.DisplayNode = leftnav_tree_DisplayNode;


	if (strClassName != '')
		this.m_ClassName = strClassName;

	if (strShowHome == 'true')
		this.m_ShowHome = true;
		
	if (strStartLevel != '')
	{
		var value = parseInt(strStartLevel);
		if (value != NaN)
			this.m_StartLevel = value;
	}
	
	if (strNumLevels != '')
	{
		var value = parseInt(strNumLevels);
		if (value != NaN)
			this.m_NumLevels = value;
	}

	this.m_EndLevel = this.m_StartLevel + this.m_NumLevels - 1 ;
}

function leftnav_tree_Display (node)
{
	document.write('<dl>');
	this.DisplayNode(node);	
	document.write('</dl>');
}

function leftnav_tree_DisplayNode(node)
{
	var bSelected = false;
	var nodeColor = '';
	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)
		{
			if (node.m_level > 0 || (node.m_level == 0 && this.m_NavPath.length == 1))
			{
				bSelected = true;
				nodeColor = '';
				nodeClass += '-focus';
			}
		}
	}

	if (nodeLevel > 0)
		nodeClass += '-' + nodeLevel;
		
	if ( (node.m_level == 0 && this.m_ShowHome) || 
     	 (node.m_level >= this.m_StartLevel && node.m_level <= this.m_EndLevel)
	   )
	{
		var ds = new Array();
		var di = 0;
		
		if (node.m_level == '2')
		{
			
			if (bSelected == "1" && node.m_label != "Why Financial Network")
			{
			ds[di++] = '<tr><td height="1" background="/stellent2/groups/it_bd/documents/image/top_line_selected.gif"><img src="/stellent2/groups/it_bd/documents/image/fnp_spacer.gif" width="1" height="1"></td></tr>';
			ds[di++] = '<tr><td width="144" height="19" align="center">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavselected"';				 
			ds[di++] = '>'
			ds[di++] = node.m_label;
			ds[di++] = '</a></td></tr>';
			ds[di++] = '<tr><td width="144" height="1"><img src="/stellent2/groups/it_bd/documents/image/7003219.gif" width="144" height="1"></td></tr>';
			ds[di++] = '<tr><td><img src="/stellent2/groups/it_bd/documents/image/7003216.gif" width="144" height="1"></td></tr>';
			ds[di++] = '<tr><td width="144" height="8"><img src="/stellent2/groups/it_bd/documents/image/7003220.gif" width="144" height="8"></td></tr>';
			}

			if (bSelected == "1" && node.m_label == "Why Financial Network")
			{
			ds[di++] = '<tr><td height="1" bgcolor="B7B7B7"><img src="/stellent2/groups/it_bd/documents/image/fnp_spacer.gif" width="1" height="1"></td></tr>';
			ds[di++] = '<tr><td width="144" height="19" align="center">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavselected"';				 
			ds[di++] = '>'
			ds[di++] = node.m_label;
			ds[di++] = '</a></td></tr>';
			ds[di++] = '<tr><td width="144" height="1"><img src="/stellent2/groups/it_bd/documents/image/7003219.gif" width="144" height="1"></td></tr>';
			ds[di++] = '<tr><td><img src="/stellent2/groups/it_bd/documents/image/7003216.gif" width="144" height="1"></td></tr>';
			ds[di++] = '<tr><td width="144" height="8"><img src="/stellent2/groups/it_bd/documents/image/7003220.gif" width="144" height="8"></td></tr>';
			}

			if (bSelected != "1")
			{
			ds[di++] = '<tr><td height="1" bgcolor="#000000"><img src="/stellent2/groups/it_bd/documents/image/fnp_spacer.gif" width="1" height="1"></td></tr>';
			ds[di++] = '<tr><td width="144" height="19" align="center" style="background-image:url(/stellent2/groups/it_bd/documents/image/purple_bg.gif);">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnav"';				 
			ds[di++] = '>'
			ds[di++] = node.m_label;
			ds[di++] = '</a></td></tr>';
			ds[di++] = '<tr><td height="1" bgcolor="#000000"><img src="/stellent2/groups/it_bd/documents/image/fnp_spacer.gif" width="1" height="1"></td></tr>';
			ds[di++] = '<tr><td><img src="/stellent2/groups/it_bd/documents/image/7003216.gif" width="144" height="1"></td></tr>';
			}
			
		}

		if (node.m_level == '3')
		{
			
			if (bSelected == "1" && node.m_label != "empty") 
			{
			ds[di++] = '<tr><td width="144" height="22" align="left" background="/stellent2/groups/it_bd/documents/image/7003216.gif">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavsubselected"';				 
			ds[di++] = '><div style="margin-left:12px;">'
			ds[di++] = node.m_label;
			ds[di++] = '</a></div></td></tr>';
			ds[di++] = '<tr><td width="144" height="1">';
			ds[di++] = '<img src="/stellent2/groups/it_bd/documents/image/dashed_line.gif" width="144" height="1"></td></tr>';
			}
			if (bSelected != "1" && node.m_label != "empty")
			{
			ds[di++] = '<tr><td width="144" height="22" align="left" background="/stellent2/groups/it_bd/documents/image/7003216.gif">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavsub"';				 
			ds[di++] = '><div style="margin-left:12px;">'
			ds[di++] = node.m_label;
			ds[di++] = '</a></div></td></tr>';
			ds[di++] = '<tr><td width="144" height="1">';
			ds[di++] = '<img src="/stellent2/groups/it_bd/documents/image/dashed_line.gif" width="144" height="1"></td></tr>';
			}
			if (node.m_label == "empty")
			{
			ds[di++] = '<tr><td width="144" height="15" background="/stellent2/groups/it_bd/documents/image/7003216.gif"><img src="/stellent2/groups/it_bd/documents/image/fnp_spacer.gif" width="1" height="15"></td></tr>';
			}			
		}

			if (node.m_level == '4')
			{

			
			if (bSelected == "1")
			{
			ds[di++] = '<tr><td width="144" height="14" align="left" background="/stellent2/groups/it_bd/documents/image/7003216.gif">';
			if (node.m_label == "Tour ING SmartWorks®")
				{
			ds[di++] = '<a href="http://www.financialnetwork.com/' + node.m_href + '"';
			ds[di++] = ' class="leftnavsubselected"';	
			ds[di++] = ' target="_blank"><div style="margin-left:18px;">'
				}
			else
				{
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavsubselected"';
			ds[di++] = '><div style="margin-left:18px;">'
				}
			ds[di++] = node.m_label;
			ds[di++] = '</a></div></td></tr>';
			ds[di++] = '<tr><td width="144" height="1">';
			ds[di++] = '<img src="/stellent2/groups/it_bd/documents/image/7003216.gif" width="144" height="1"></td></tr>';
			}
			
			if (bSelected != "1")
			{
			ds[di++] = '<tr><td width="144" height="14" align="left" background="/stellent2/groups/it_bd/documents/image/7003216.gif">';
			if (node.m_label == "Tour ING SmartWorks®")
				{
			ds[di++] = '<a href="http://www.financialnetwork.com/' + node.m_href + '"';
			ds[di++] = ' class="leftnavsub"';	
			ds[di++] = ' target="_blank"><div style="margin-left:18px;">'
				}
			else
				{
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="leftnavsub"';
			ds[di++] = '><div style="margin-left:18px;">'
				}
			ds[di++] = node.m_label;
			ds[di++] = '</a></div></td></tr>';
			ds[di++] = '<tr><td width="144" height="1">';
			ds[di++] = '<img src="/stellent2/groups/it_bd/documents/image/7003216.gif" width="144" height="1"></td></tr>';
			}			

		}

		if (node.m_level == '1')
{
		ds[di++] = '<a href="' + node.m_href + '"';
		ds[di++] = ' class="leftnavsub"';
		ds[di++] = '>'
		ds[di++] = node.m_label + ' ' + node.m_level;
		ds[di++] = '</a>';
}
		
		document.write(ds.join(''));

	}
	
	if (bSelected || node.m_level == 0)
	{	// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}
