/////////////////////////////////////////////////////////////////////////////
// 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('2098','Home',ssUrlPrefix + 'index.htm',null,'NavigationRootLevel==1','SectionLabel_en==GENDER\x3a Home page','SectionLabel_es==GENDER\x3a P\xe1gina de entrada ','SectionLabel_fr==GENDER\x3a Page d\\x27accueil','SiteLabel_en==GENDER','SiteLabel_es==GENDER','SiteLabel_fr==GENDER','SiteLanguages==en,es,fr','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('2099','About us',ssUrlPrefix + 'Aboutus/index.htm','SectionLabel_en==About us','SectionLabel_es==Sobre nosotros','SectionLabel_fr==A propos de nous','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_0=g_navNode_0.addNode('2102','Team at Headquarters',ssUrlPrefix + 'Aboutus/TeamatHeadquarters/index.htm','SectionLabel_en==Team at headquarters','SectionLabel_es==El equipo en la Sede','SectionLabel_fr==Equipe au si\xe8ge','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_1=g_navNode_0.addNode('2103','Team in field offices',ssUrlPrefix + 'Aboutus/Teaminfieldoffices/index.htm','SectionLabel_en==Team in field offices','SectionLabel_es==El equipo en las oficinas exteriores','SectionLabel_fr==Equipe dans les bureaux ext\xe9rieurs','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('2100','Events',ssUrlPrefix + 'Events/index.htm','SectionLabel_en==Events','SectionLabel_es==Eventos','SectionLabel_fr==Ev\xe9nements','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_1=g_navNode_1.addNode('5444',' International Women\'s Day',ssUrlPrefix + 'Events/international-women-day/index.htm','SectionLabel_en==International Women\\x27s Day','SectionLabel_es==D\xeda Internacional de la Mujer','SectionLabel_fr==Journ\xe9e internationale de la Femme','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('2101','Information resources',ssUrlPrefix + 'Informationresources/index.htm','SectionLabel_en==Information resources','SectionLabel_es==Recursos de informaci\xf3n','SectionLabel_fr==Ressources d\\x27informations','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_0=g_navNode_2.addNode('2120','Publications',ssUrlPrefix + 'Informationresources/Publications/index.htm','SectionLabel_en==Publications','SectionLabel_es==Publicaciones','SectionLabel_fr==Publications','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3=g_navNode_Root.addNode('2121','Technical cooperation projects',ssUrlPrefix + 'Projects/index.htm','SectionLabel_en==Technical cooperation projects','SectionLabel_es==Proyectos de cooperaci\xf3n t\xe9cnica','SectionLabel_fr==Projets de coop\xe9ration technique','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4=g_navNode_Root.addNode('2122','Links',ssUrlPrefix + 'Links/index.htm','SectionLabel_en==Links','SectionLabel_es==Enlaces','SectionLabel_fr==Liens utiles','secondaryUrlVariableField==pl_replaceable_content');

