/////////////////////////////////////////////////////////////////////////////
// Class : EnlacesIzquierdaRaiz
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function EnlacesIzquierdaRaiz(strTextColor, strHoverColor, strFocusColor, strClassName,Nivel,ultValor)
{

	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_FocusColor = '';
	this.m_ClassName  = 'EnlacesIzquierdaRaiz';

	this.m_NavPath    = g_navNode_Path;
		
	EnlacesIzquierdaRaiz.prototype.Display = EnlacesIzquierdaRaiz_Display;
	EnlacesIzquierdaRaiz.prototype.DisplayNode = EnlacesIzquierdaRaiz_DisplayNode;

	
	if (strTextColor != '')
		this.m_TextColor = strTextColor;
		
	if (strHoverColor != '')
		this.m_HoverColor = strHoverColor;

	if (strFocusColor != '')
		this.m_FocusColor = strFocusColor;

	if (strClassName != '')
		this.m_ClassName = strClassName;
this.m_ShowFocus = true;
this.m_Nivel=Nivel;
//this.etiqueta=new String(etiq);
this.pintaNodo=0;
this.clasEstilo=strClassName;
this.pri=0;
	this.ultimoValor=ultValor; //variable utilizada para indicar si se ha pintado el nivel o no

}

function EnlacesIzquierdaRaiz_Display (node)
{
	//document.write('<ul>');
	this.DisplayNode(node);
	document.write('</ul>');
	document.write('</div>');
}

function EnlacesIzquierdaRaiz_DisplayNode(node)
{
	var bSelected = false;
	var nodeColor = this.m_TextColor;
	var nodeClass = this.m_ClassName;
	var nodeLevel = node.m_level;
	var texto="";
	var urlbase="/lpgc/idcplg?IdcService=SS_GET_PAGE&nodeId=";

	if (nodeLevel > 6)
		nodeLevel = 6;
	

	if ((node.m_level > this.m_Nivel) || (this.m_ShowHome))
	{
		var ds = new Array();
		var di = 0;
		var valor='';	
		var valor1=0;
		var valor2=0;	

				
				
		valor1=parseInt(this.m_Nivel);
		valor2=parseInt(this.m_Nivel)+1;
		if ((node.m_level == valor1) ||(node.m_level == valor2))	{	

			if(this.pri==0){
				this.pri=1;
				texto="<div id='"+this.clasEstilo+"'>";
				document.write(texto);
				document.write('<ul>');
	
			}		
			ds[di++] = '<li><a href="' + urlbase+node.m_id + '"';
			
			//ds[di++] = ' class="NumerosPeqNarjInfinito"';
			node.m_label=node.m_label;
						ds[di++] = '>'
			ds[di++] =node.m_label;
			ds[di++] = '</a></li>';


		}
		document.write(ds.join(''));

	//if((node.m_level==1)&&((node.m_label!="Contenidos")||(this.etiqueta!=""))){
	if((node.m_level==1)&&((node.m_label!="Contenidos"))){

		/*if((node.m_label==this.etiqueta)&&(node.m_level==1)&&(this.etiqueta!="")){
		
		   this.ultimoValor=node.m_level;
		}else{
			if((node.m_label!=this.etiqueta)&&(node.m_level==1)&&(this.etiqueta!="")){

			   this.ultimoValor=0;
	
			}
		}*/
		   this.ultimoValor=node.m_level;
	

	   }
    }

	//if(this.ultimoValor!=0){
		//PARA PINTAR UN SOLO NIVEL
		// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
//	alert(this.m_NavPath[node.m_level]+" == "+node.m_id +" label "+node.m_label);
//alert(this.m_NavPath[node.m_level]+" "+node.m_id+" label "+node.m_label);

		if (this.m_NavPath[node.m_level] == node.m_id)
		{
			this.pintaNodo=1;
		}else{
			this.pintaNodo=0;

		}
			//if (this.pintaNodo==1){
			if ((node.m_label=="Servicios")||(node.m_label=="Inicio")){
				this.DisplayNode(node.m_subNodes[i]);

			}			

		}
	//}
}

