/////////////////////////////////////////////////////////////////////////////
// Class : EnlacesIzquierdaLasPalmasnivel1
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function EnlacesIzquierdaLasPalmasnivel1(strClassName,Nivel,ultValor,estilos,raiz)
{

	this.m_ClassName  = 'EnlacesIzquierdaLasPalmasnivel1';

	this.m_NavPath    = g_navNode_Path;
	this.nivel_actual=1;
		
	EnlacesIzquierdaLasPalmasnivel1.prototype.Display = EnlacesIzquierdaLasPalmasnivel1_Display;
	EnlacesIzquierdaLasPalmasnivel1.prototype.DisplayNode = EnlacesIzquierdaLasPalmasnivel1_DisplayNode;
	EnlacesIzquierdaLasPalmasnivel1.prototype.Pinta = EnlacesIzquierdaLasPalmasnivel1_Pinta;
	
	if (strClassName != '')
		this.m_ClassName = strClassName;
this.m_ShowFocus = true;
this.m_Nivel=Nivel;
this.pintaNodo=0;
this.nivel_actual=1;
this.estilos=estilos;

	this.anterior=0;
	this.contador=0;
this.pri=0;


this.raiz=raiz;
this.numElementos=0;

	this.ultimoValor=ultValor; //variable utilizada para indicar si se ha pintado el nivel o no

}

function EnlacesIzquierdaLasPalmasnivel1_Display (node)
{
	this.DisplayNode(node);
}


function EnlacesIzquierdaLasPalmasnivel1_DisplayNode(node)
{
	for (var i = 0; i < node.m_subNodes.length; i++)
	{
		if (node.m_subNodes[i].m_id == g_navNode_Path[1])
		{
			this.Pinta(node.m_subNodes[i]);
			return;
		}else{
			if (node.m_subNodes[i].m_id == g_navNode_Path[this.nivel_actual])
			{
				this.nivel_actual=this.nivel_actual+1;
				this.DisplayNode(node.m_subNodes[i]);
			}
		}
	}
}

function EnlacesIzquierdaLasPalmasnivel1_Pinta(node)
{
	var urlbase="/lpgc/idcplg?IdcService=SS_GET_PAGE&nodeId=";
	
	this.clasEstilo="";
	if (node.m_id==26)
		this.clasEstilo="subser";
        if (node.m_id==84)
		this.clasEstilo="subciu";
        if (node.m_id==74)
		this.clasEstilo="subayu";
        if (node.m_id==85)
		this.clasEstilo="subtur";
	if (node.m_id==86)
	     	this.clasEstilo="subtra";
	     
	if (this.clasEstilo=="") return;
	     
	var ds = new Array();
	var di =0;
	texto="<div id='"+this.clasEstilo+"'>";
	ds[di++]=texto;
	ds[di++]='<ul>';

	for (j = 0; j < node.m_subNodes.length; j++)
	{

		if (g_navNode_Path[2]==node.m_subNodes[j].m_id){
			ds[di++] = '<li><a class="activo" href="' + urlbase+node.m_subNodes[j].m_id + '"';
		}else{
			ds[di++] = '<li><a href="' + urlbase+node.m_subNodes[j].m_id + '"';
		}
			
		node.m_subNodes[j].m_label=node.m_subNodes[j].m_label;
		ds[di++] = '>'
		ds[di++] =node.m_subNodes[j].m_label;

		if (g_navNode_Path[g_navNode_Path.length-1]==node.m_subNodes[j].m_id){
			ds[di++] = '</a></li>';
		}else{
			ds[di++] = '</a></li>';
		}
	}
	ds[di++]='</ul>';
	ds[di++]="</div>";
	
	
	document.write(ds.join(''));
}
