/////////////////////////////////////////////////////////////////////////////
// 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('3321','LABADMIN',ssUrlPrefix + 'index.htm',null,'BreadcrumbPrefixNode==global\x3a278','NavigationRootLevel==1','SectionLabel_en==Labour Administration and Inspection Programme \x28LAB/ADMIN\x29','SectionLabel_es==Programa sobre Administraci\xf3n e Inspecci\xf3n del Trabajo \x28LAB/ADMIN\x29','SectionLabel_fr==Programme d\\x27 administration et d\\x27 inspection du travail \x28LAB/ADMIN\x29','SiteLabel_en==LAB/ADMIN','SiteLabel_es==LAB/ADMIN','SiteLabel_fr==LAB/ADMIN','SiteLanguages==en,es,fr','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('3322','About us',ssUrlPrefix + 'about/index.htm','SectionLabel_en==About the Programme','SectionLabel_es==Qui\xe9nes somos','SectionLabel_fr==\xc0 propos de nous','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('3324','Areas of work',ssUrlPrefix + 'areas/index.htm','SectionLabel_en==Areas of work','SectionLabel_es==Ambitos de trabajo','SectionLabel_fr==Domaines de travail','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4=g_navNode_Root.addNode('3326','What we do',ssUrlPrefix + 'what/index.htm','SectionLabel_en==What we do','SectionLabel_es==Actividades','SectionLabel_fr==Activit\xe9s','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4_0=g_navNode_4.addNode('3327','Projects',ssUrlPrefix + 'what/projects/index.htm','SectionLabel_en==Projects','SectionLabel_es==Proyectos','SectionLabel_fr==Projets','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4_1=g_navNode_4.addNode('3328','Events and meetings',ssUrlPrefix + 'what/events/index.htm','SectionLabel_en==Events and meetings','SectionLabel_es==Eventos y reuniones','SectionLabel_fr==\xc9v\xe9nements et reunions','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4_2=g_navNode_4.addNode('3329','Publications',ssUrlPrefix + 'what/pubs/index.htm','SectionLabel_en==Publications','SectionLabel_es==Publicaciones','SectionLabel_fr==Publications','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4_3=g_navNode_4.addNode('3330','Instructional materials',ssUrlPrefix + 'what/inst/index.htm','SectionLabel_en==Instructional materials','SectionLabel_es==Herramientas did\xe1cticas','SectionLabel_fr==Mat\xe9riel didactique','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_5=g_navNode_Root.addNode('3331','Information resources',ssUrlPrefix + 'info/index.htm','SectionLabel_en==Information resources','SectionLabel_es==Recursos de Informaci\xf3n','SectionLabel_fr==Ressources d\u2019information','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_6=g_navNode_Root.addNode('3352','What\'s new',ssUrlPrefix + 'news/index.htm','SectionLabel_en==News','SectionLabel_es==Novedades','SectionLabel_fr==Actualit\xe9s','secondaryUrlVariableField==pl_replaceable_content');

