/////////////////////////////////////////////////////////////////////////////
// Function : BreadCrumbLasPalmas
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function BreadCrumbLasPalmas(strTextColor, strHoverColor, strSeparator, strClassName)
{
	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_Separator  = '&nbsp;&gt;&nbsp;';
	this.m_ClassName  = 'BreadCrumbLasPalmas';

	this.m_NavPath    = g_navNode_Path;

	if (strTextColor != '')
		this.m_TextColor = strTextColor;
		
	if (strHoverColor != '')
		this.m_HoverColor = strHoverColor;
	
	if (strSeparator != '')
		this.m_Separator = strSeparator;
		
	if (strClassName != '')
		this.m_ClassName = strClassName;
		
	BreadCrumbLasPalmas.prototype.Display = BreadCrumbLasPalmas_Display;
	BreadCrumbLasPalmas.prototype.DisplayNode = BreadCrumbLasPalmas_DisplayNode;
	BreadCrumbLasPalmas.prototype.Pinta = BreadCrumbLasPalmas_Pinta;

	this.ds = new Array();
	this.di = 0;
}

function BreadCrumbLasPalmas_Display (node)
{
	this.DisplayNode(node);
	document.write(this.ds.join(''));
}

function BreadCrumbLasPalmas_DisplayNode(node)	
{
	if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length)
	{
		if (this.m_NavPath[node.m_level] == node.m_id)
			this.Pinta(node);
	}

	for (var i = 0; i < node.m_subNodes.length; i++)
	{
		if (this.m_NavPath[node.m_level] == node.m_id){
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}
function BreadCrumbLasPalmas_Pinta(node)
{
	//this.ds[this.di++]= '<h1 class="opc1">';
	if (node.m_level == this.m_NavPath.length-1){
		this.ds[this.di++]= '<script>var OpcionActiva="'+node.m_label+'"</script>';
		this.ds[this.di++]= '<a class="activo" ';
		
	}
	else{
		this.ds[this.di++]= '<a ';
	}
	if (node.m_level!=1){
		//this.ds[this.di++] = 'href="' + node.m_href + '"';
		this.ds[this.di++] = 'href="/lpgc/idcplg?IdcService=SS_GET_PAGE&nodeId=' + node.m_id + '"';
		this.ds[this.di++] = '>'
		this.ds[this.di++] = node.m_label;
		this.ds[this.di++] = '</a>';
	}else{
		//this.ds[this.di++] = 'href="' + node.m_subNodes[0].m_href + '"';
		this.ds[this.di++] = 'href="/lpgc/idcplg?IdcService=SS_GET_PAGE&nodeId=' + node.m_subNodes[0].m_id + '"';
		this.ds[this.di++] = '>'
		this.ds[this.di++] = node.m_label;
		this.ds[this.di++] = '</a>';
	}
	if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length-1)
		this.ds[this.di++] = this.m_Separator;
	
	//this.ds[this.di++]= '</h1>';
}