/////////////////////////////////////////////////////////////////////////////
// Function : NavNode (constructor)
// Comments :
/////////////////////////////////////////////////////////////////////////////
function NavNode(id, label, href, parent)
{
	this.m_parent = null;
	this.m_level = 0;

	if (parent)
	{
		this.m_parent = parent;
		this.m_level = parent.m_level+1;
	}

	this.m_id = id;

	// assume that m_label will most often be used directly as HTML
	this.m_rawlabel = label;

	label = label.replace(/&/g, '&amp;');
	label = label.replace(/</g, '&lt;');
	label = label.replace(/>/g, '&gt;');
	label = label.replace(/"/g, '&quot;');

	this.m_label = label;

	this.m_href = href;
	this.m_subNodes = new Array();

	var argValues = NavNode.arguments;
	var argCount = NavNode.arguments.length;

	for (i = 4 ; i < argCount ; i++)
	{
		var eqPos = argValues[i].indexOf("==");
		var attrName = argValues[i].substring(0,eqPos);
		var attrValue = argValues[i].substring(eqPos+2);

		eval("this.cp_" + attrName + " = '" + attrValue + "';");
	}

	NavNode.prototype.addNode = addNode;
	NavNode.prototype.isSelected = isSelected;
}

/////////////////////////////////////////////////////////////////////////////
// Function : addNode
// Comments :
/////////////////////////////////////////////////////////////////////////////
function addNode(id, label, href)
{
	var newIndex = this.m_subNodes.length;
	var newNode = new NavNode(id, label, href, this);

	var argValues = addNode.arguments;
	var argCount = addNode.arguments.length;

	for (i = 3 ; i < argCount ; i++)
	{
		var eqPos = argValues[i].indexOf("==");
		var attrName = argValues[i].substring(0,eqPos);
		var attrValue = argValues[i].substring(eqPos+2);

		eval("newNode.cp_" + attrName + " = '" + attrValue + "';");
	}

	this.m_subNodes[newIndex] = newNode;
	return newNode;
}

/////////////////////////////////////////////////////////////////////////////
// Function : isSelected
// Comments :
/////////////////////////////////////////////////////////////////////////////
function isSelected()
{
    var pos = window.location.href.lastIndexOf("/");
    var docname = window.location.href.substring(pos+1, window.location.href.length);

    pos = this.m_href.lastIndexOf("/");
    var myname = this.m_href.substring(pos+1, this.m_href.length);

    if (docname == myname)
		return true;
	else
		return false;
}

/////////////////////////////////////////////////////////////////////////////
// Function : customSectionPropertyExists
// Comments :
/////////////////////////////////////////////////////////////////////////////
function customSectionPropertyExists(csp)
{
	return (typeof csp != _U && csp != null);
}

/////////////////////////////////////////////////////////////////////////////
// Function : getCustomSectionProperty
// Comments :
/////////////////////////////////////////////////////////////////////////////
function getCustomSectionProperty(csp)
{
	if (customSectionPropertyExists(csp))
	{
		return csp;
	}
	else
	{
		return "";
	}
}

/////////////////////////////////////////////////////////////////////////////

var g_navNode_Root = new NavNode('2003','Home',ssUrlPrefix + 'index.htm',null,'NavigationRootLevel==1','SectionLabel_en==Special Action Programme to Combat Forced Labour','SectionLabel_es==Programa Especial de Acci\xf3n para Combatir el Trabajo Forzoso','SectionLabel_fr==Programme d\\x27Action Sp\xe9cial pour Combattre le Travail Forc\xe9','SiteLabel_en==SAP-FL','SiteLabel_es==SAP-FL','SiteLabel_fr==SAP-FL','SiteLanguages==en,es,fr','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('2004','About SAP-FL',ssUrlPrefix + 'AboutSAPFL/index.htm','SectionLabel_en==About SAP-FL','SectionLabel_es==Sobre SAP-FL','SectionLabel_fr==A propos de SAP-FL','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_0=g_navNode_0.addNode('2012','Team at HQ',ssUrlPrefix + 'AboutSAPFL/TeamatHQ/index.htm','SectionLabel_en==Team at HQ','SectionLabel_es==Equipo en la sede','SectionLabel_fr==Equipe au si\xe8ge','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_1=g_navNode_0.addNode('2013','Team in the Field',ssUrlPrefix + 'AboutSAPFL/TeamintheFields/index.htm','SectionLabel_en==Team in the field','SectionLabel_es==Equipo en el terreno','SectionLabel_fr==Equipe sur le terrain','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('2005','Information resources',ssUrlPrefix + 'Informationresources/index.htm','SectionLabel_en==Information resources','SectionLabel_es==Recursos de informaci\xf3n','SectionLabel_fr==Sources d\u2019information','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_0=g_navNode_1.addNode('2017','ILO Publications',ssUrlPrefix + 'Informationresources/ILOPublications/index.htm','SectionLabel_en==ILO publications','SectionLabel_es==Publicaciones OIT','SectionLabel_fr==Publications OIT','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_1=g_navNode_1.addNode('2863','Factsheets and brochures',ssUrlPrefix + 'Informationresources/Factsheetsandbrochures/index.htm','SectionLabel_en==Factsheets and brochures','SectionLabel_es==Documentos y folletos','SectionLabel_fr==Documents et brochures','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_2=g_navNode_1.addNode('4392','Newsletter',ssUrlPrefix + 'Informationresources/newsletter/index.htm','SectionLabel_en==Newsletter','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_3=g_navNode_1.addNode('2862','Speeches',ssUrlPrefix + 'Informationresources/Speeches/index.htm','SectionLabel_en==Speeches','SectionLabel_es==Discursos','SectionLabel_fr==Discours','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_4=g_navNode_1.addNode('2020','Audio visuals',ssUrlPrefix + 'Informationresources/Audiovisuals/index.htm','SectionLabel_en==Multimedia','SectionLabel_es==Multimedia','SectionLabel_fr==Multim\xe9dia','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_5=g_navNode_1.addNode('2021','Photo gallery',ssUrlPrefix + 'Informationresources/Photogallery/index.htm','SectionLabel_en==Photo gallery','SectionLabel_es==Galer\xeda de Fotos','SectionLabel_fr==Galerie photos','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_6=g_navNode_1.addNode('2019','External publications',ssUrlPrefix + 'Informationresources/NonILOpublications/index.htm','SectionLabel_en==External publications','SectionLabel_es==Publicaciones externas','SectionLabel_fr==Publications externes','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('2006','Events',ssUrlPrefix + 'Events/index.htm','SectionLabel_en==Events','SectionLabel_es==Eventos','SectionLabel_fr==Ev\xe9nements','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_0=g_navNode_2.addNode('2022','ILO events',ssUrlPrefix + 'Events/ILOevents/index.htm','SectionLabel_en==ILO events','SectionLabel_es==Eventos OIT','SectionLabel_fr==Ev\xe9nements OIT','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_1=g_navNode_2.addNode('2023','Non-ILO events',ssUrlPrefix + 'Events/NonILOevents/index.htm','SectionLabel_en==Non-ILO events','SectionLabel_es==Eventos externos','SectionLabel_fr==Ev\xe9nements externes','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3=g_navNode_Root.addNode('2007','Projects',ssUrlPrefix + 'Projects/index.htm','SectionLabel_en==Projects','SectionLabel_es==Proyectos','SectionLabel_fr==Projets','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4=g_navNode_Root.addNode('2008','Links',ssUrlPrefix + 'Links/index.htm','SectionLabel_en==Links','SectionLabel_es==Enlaces','SectionLabel_fr==Liens','secondaryUrlVariableField==pl_replaceable_content');

