/////////////////////////////////////////////////////////////////////////////
// Class : EnlacesDchaLasPalmas
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function EnlacesDchaLasPalmas(strTextColor, strHoverColor, strFocusColor, strClassName,Nivel,ultValor,estilos,raiz,nodoUbicacion)
{

	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_FocusColor = '';
	this.m_ClassName  = 'EnlacesDchaLasPalmas';

	this.m_NavPath    = g_navNode_Path;
	this.nivel_actual=1;
		
	EnlacesDchaLasPalmas.prototype.Display = EnlacesDchaLasPalmas_Display;
	EnlacesDchaLasPalmas.prototype.DisplayNode = EnlacesDchaLasPalmas_DisplayNode;
	EnlacesDchaLasPalmas.prototype.Pinta = EnlacesDchaLasPalmas_Pinta;
	
	
	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.pintaNodo=0;
this.nivel=0;
this.estilos=estilos;

	this.anterior=0;
	this.contador=0;
this.pri=0;


this.nodoPintar=nodoUbicacion;
this.raiz=raiz;
this.numElementos=0;

	this.ultimoValor=ultValor; //variable utilizada para indicar si se ha pintado el nivel o no

}

function EnlacesDchaLasPalmas_Display (node)
{
	
	document.write('<ul>');

	this.DisplayNode(node);
	
	document.write('</ul>');
	
}


function EnlacesDchaLasPalmas_DisplayNode(node)
{
	for (var i = 0; i < node.m_subNodes.length; i++)
	{
		
		if (node.m_subNodes[i].m_id == this.nodoPintar){
			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]);
				return;

			}
		}
	}
}

function EnlacesDchaLasPalmas_Pinta(node)
{
	var urlbase="/lpgc/idcplg?IdcService=SS_GET_PAGE&nodeId=";
	var ds = new Array();
	var di =0;
	for (j = 0; j < node.m_subNodes.length; j++)
	{
	       if (node.m_subNodes[j].m_id != 677){ //borrar despues de prueba de Med. Amb.
		ds[di++] = '<li><a href="' + urlbase+node.m_subNodes[j].m_id + '"';
		ds[di++] = '>'
		ds[di++] =node.m_subNodes[j].m_label;
		ds[di++] = '</a></li>';
               } //borrar despues de prueba de Med. Amb.
	}
	if (ds.length != 0)
	{
		document.write(ds.join(''));
	}

}
