/////////////////////////////////////////////////////////////////////////////
// Function : IFA_LeftNavigation
// Comments : 
/////////////////////////////////////////////////////////////////////////////

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

	this.m_ClassName  = 'lhs_menu';
	this.m_LevelClass = 'lhs_menu';
	
	this.m_ShowHome   = false;
	
	this.m_StartLevel = 2;
	this.m_NumLevels  = 10;
	this.m_EndLevel   = 11;
	
	this.m_NavPath    = g_navNode_Path;
			
	IFA_LeftNavigation.prototype.Display = IFA_LeftNavigation_Display;
	IFA_LeftNavigation.prototype.DisplayNode = IFA_LeftNavigation_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 IFA_LeftNavigation_Display (node)
{
	document.write('<dl>');	
	this.DisplayNode(node);
	document.write('</dl>');
}

function IFA_LeftNavigation_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;
		
		ds[di++] = (nodeLevel <= 2) ? '<dt' : '<dd';
		ds[di++] = ' class="' + nodeClass + '"';
		ds[di++] = '>';



		if (node.m_level == '2')
		{
			ds[di++] = '<tr><td align="left" style="border-bottom: 1px solid rgb(229, 229, 229);" colspan="2"><img height="1" width="1" src="http://www.ing-usa.com/us/stellent2/groups/it/documents/image/spacer.gif"/></td></tr>';

			if (bSelected == "1")
			{
                        			
                        
			ds[di++] = '<tr><td colspan="2" align="left" width="200px" height="28" style="background: #FBF9F9;"><div id="lhs_nav">';
                        ds[di++] = '<table align="left"><tr valign="top"><td><img src="http://www.ing-usa.com/us/stellent2/groups/it/documents/image/7004853.gif" style="margin-top:10px; margin-right:3px; margin-left:10px"></td>';
                     
                        ds[di++] = '<td align="left"><a href="' + node.m_href + '"';	
                        ds[di++] = 'class="level1selected"';			 
			ds[di++] = '><B>';
			ds[di++] = node.m_label;
			ds[di++] = '</B></a></td></tr></table>';
                        ds[di++] = '</div></td></tr>';			
			}
                         
                        
			if (bSelected != "1")
			{
			
	                ds[di++] = '<tr><td colspan="2" align="left" width="200px" height="28"><div id="lhs_nav">';
                        ds[di++] = '<table align="left"><tr valign="top"><td><img src="http://www.ing-usa.com/us/stellent2/groups/it/documents/image/7004854.gif" style="margin-top:10px; margin-right:3px; margin-left:10px"></td>';
                    
                        ds[di++] = '<td align="left"><a href="' + node.m_href + '"';				 
			ds[di++] = ' class="level1"';			 
			ds[di++] = '><B>';
			ds[di++] = node.m_label;
			ds[di++] = '</B></a></td></tr></table>';
                        ds[di++] = '</div></td></tr>';

                        
	
			}
			
		}

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


			ds[di++] = '<tr>';
			
			
	if (bSelected == "1")
			{
			
                        ds[di++] = '<td style="background:#FBF9F9;">';
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="orangeselected"';				 
			ds[di++] = '>';
			ds[di++] = node.m_label;
			ds[di++] = '</a>';
			
			ds[di++] = '</div></td>';
			}
	if (bSelected != "1")
			{
			
                        ds[di++] = '<td width="20%" style="background:#FBF9F9;">';			
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="greyselected"';				 
			ds[di++] = '>';
			ds[di++] = node.m_label;
			ds[di++] = '</a></div></td>';
			}

			ds[di++] = '</tr>';	
		

		}

	

		if (node.m_level == '1')
		{
		ds[di++] = '<a href="' + node.m_href + '"';
		ds[di++] = '<div id="lhs_nav">';
				 
		ds[di++] = '>';
		ds[di++] = node.m_label;
		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]);
		}
	}
}
