/////////////////////////////////////////////////////////////////////////////
// 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('2873','ILO/AIDS',ssUrlPrefix + 'index.htm',null,'NavigationRootLevel==1','SectionLabelShort_en==ILO/AIDS','SectionLabelShort_es==ILO/AIDS','SectionLabelShort_fr==ILO/AIDS','SectionLabel_en==ILO Programme on HIV/AIDS and the world of work \x28ILO/AIDS\x29','SectionLabel_es==Programa de la OIT sobre el VIH/SIDA y el mundo del trabajo \x28ILO/AIDS\x29 ','SectionLabel_fr==Programme de l\u2019OIT sur le VIH/sida et le monde du travail \x28ILO/AIDS\x29','SiteLabel_en==ILO-AIDS','SiteLabel_es==ILO-AIDS','SiteLabel_fr==ILO-AIDS','SiteLanguages==en,fr,es','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('2884','About ILO/AIDS',ssUrlPrefix + 'Aboutus/index.htm','SectionLabel_en==About ILO/AIDS','SectionLabel_es==Acerca de ILO/AIDS','SectionLabel_fr==A propos de ILO/AIDS','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('3108','ILO\'s constituents',ssUrlPrefix + 'Constituents/index.htm','SectionLabel_en==ILO constituents and HIV/AIDS','SectionLabel_es==Los constituyentes de la OIT y el VIH y el sida','SectionLabel_fr==Les mandants de l\\x27OIT, le VIH et le sida','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('2887','Projects and activities',ssUrlPrefix + 'Projects/index.htm','SectionLabel_en==Projects and activities','SectionLabel_es==Proyectos y actividades','SectionLabel_fr==Projets et activit\xe9s','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3=g_navNode_Root.addNode('3107','Legislation and policies',ssUrlPrefix + 'legislation/index.htm','SectionLabel_en==Legislation and policies','SectionLabel_es==La legislaci\xf3n y las pol\xedticas ','SectionLabel_fr==L\xe9gislations et politiques','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_5=g_navNode_Root.addNode('4574','Good practices',ssUrlPrefix + 'good-practices/index.htm','SectionLabel_en==Good practices','SectionLabel_es==Buenas pr\xe1cticas','SectionLabel_fr==Bonnes pratiques','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_7=g_navNode_Root.addNode('2888','Publications',ssUrlPrefix + 'Publications/index.htm','SectionLabel_en==Publications','SectionLabel_es==Publicaciones','SectionLabel_fr==Publications','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_8=g_navNode_Root.addNode('4107','Multimedia',ssUrlPrefix + 'multimedia/index.htm','SectionLabel_en==Multimedia','SectionLabel_es==Multimedia','SectionLabel_fr==Multim\xe9dia','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_9=g_navNode_Root.addNode('3105','Events and meetings',ssUrlPrefix + 'Eventsandmeetings/index.htm','SectionLabel_en==Events and meetings','SectionLabel_es==Eventos y reuniones','SectionLabel_fr==Ev\xe9nements et r\xe9unions','secondaryUrlVariableField==pl_replaceable_content');

