function pte_hcsp_top_navigation()
{

  /*this.m_ClassName  = 'st_main_menu';
	*/
	this.m_ShowHome   = true;
	
	this.m_StartLevel = 2;
	this.m_NumLevels  = 1;
	this.m_EndLevel   = 2;
		
	this.m_NavPath    = g_navNode_Path;
			
	pte_hcsp_top_navigation.prototype.Display = pte_hcsp_top_navigation_Display;
	pte_hcsp_top_navigation.prototype.DisplaySubLevel = pte_hcsp_top_navigation_DisplaySubLevel;
	
  /*	
	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 pte_hcsp_top_navigation_Display (node)
{
	document.write('<ul id="1" class="lavaLampWithImage">');
	this.DisplaySubLevel(node);	
	document.write('</ul>');
}

function pte_hcsp_top_navigation_DisplaySubLevel (node)	
{
	var bSelected = false;
	var bDisplay  = false;

	//var nodeClass = this.m_ClassName
	var nodeLevel = node.m_level+1;
	
	var ds = new Array();
	var di = 0;
	var count = 0;

	var selectedNode = null;

	if (this.m_ShowHome && (node.m_level == 1))
		count = -1;

	var href = '';
	var label = '';
	
	//alert(node.m_level+' '+this.m_StartLevel+' '+this.m_EndLevel);
	
	if (node.m_level >= this.m_StartLevel-1 && node.m_level < this.m_EndLevel){
		bDisplay = true;
	}

  /*
	if (bDisplay) 
	{
		ds[di++] = '<li>';
	}
  */	
		
	for ( ; count < node.m_subNodes.length; count++)
	{
	  //alert('for');
	
	  bSelected = false;
		//nodeColor = this.m_TextColor;

    if (count == -1)	// Root/home link 
		{	
			// this is only really applicable if we're working the top level
			// but the same technique could be used to display a generalised "back-up-one-level")
						
			if ( (this.m_NavPath.length == node.m_level+1) &&
				 (this.m_NavPath[node.m_level] == node.m_id) )
			{
				bSelected = true;
			}
			
			label = node.m_label;
			if(node.m_label=='PT'){
			   label = 'In\355cio';
      } else if(node.m_label=='EN') {
      	label = 'Home';
      }
			href  = node.m_href;
		}
		else
		{	
		 
			if (this.m_NavPath.length >= node.m_subNodes[count].m_level)
			{
				if (this.m_NavPath[node.m_subNodes[count].m_level] == node.m_subNodes[count].m_id)
				{
					bSelected = true;
					selectedNode = node.m_subNodes[count];
				}
			}
			label = node.m_subNodes[count].m_label;
			href = node.m_subNodes[count].m_href;
		}		

		if (bDisplay)
		{
  		if (bSelected){
  			ds[di++] = '<li class="current"><div>';
  		} else {
        ds[di++] = '<li>';
      }
    
			ds[di++] = '<a href="' + href + '"';
			
			/*
			if (bSelected)
  		{
  			ds[di++] = ' class="selected"';
  		}
  		*/
     			
			ds[di++] = '>';
			ds[di++] = label;
			ds[di++] = '</a>';

      if (bSelected){
	       ds[di++] = '</div>';
      }
		  ds[di++] = '</li>';
		}
		
	} 
	
	if (bDisplay)
	{
    /*
	  if (bSelected){
	   ds[di++] = '</div>';
    }
		ds[di++] = '</li>';
		*/
		document.write(ds.join(''));
	}
	
	//alert(ds.join(''));
	
	if (selectedNode != null)
		this.DisplaySubLevel (selectedNode);
		
	
}

