/////////////////////////////////////////////////////////////////////////////
// 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('2000','A Fair Globalization, Making it Happen ',ssUrlPrefix + 'index.htm',null,'NavigationRootLevel==1','SectionLabel_en==A Fair Globalization, Making it Happen','SectionLabel_es==Pour una globalizaci\xf3n justa, Podemos lograrlo','SectionLabel_fr==Une mondialisation juste, En faire une r\xe9alit\xe9','SiteLabel_en==Fairglobalization','SiteLabel_es==Fairglobalization','SiteLabel_fr==Fairglobalization','SiteLanguages==en,es,fr','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('2337','Follow-up Activities and Events',ssUrlPrefix + 'follow/index.htm','SectionLabel_en==Follow-up Activities \x26 Events ','SectionLabel_es==Actividades y eventos de seguimiento ','SectionLabel_fr==Ev\xe9nements et activit\xe9s de suivi ','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_0=g_navNode_0.addNode('2344','Publications and documents',ssUrlPrefix + 'follow/Publications/index.htm','SectionLabel_en==Publications and documents','SectionLabel_es==Publicaciones y documentos','SectionLabel_fr==Publications et documents','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_1=g_navNode_0.addNode('2388','Global activities and events',ssUrlPrefix + 'follow/Global/index.htm','SectionLabel_en==Global activities and events','SectionLabel_es==Actividades y eventos globales','SectionLabel_fr==Activit\xe9s et \xe9v\xe9nements mondiaux','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_2=g_navNode_0.addNode('2389','Regional activities and events',ssUrlPrefix + 'follow/Regional/index.htm','SectionLabel_en==Regional activities and events','SectionLabel_es==Actividades y eventos regionales ','SectionLabel_fr==Activit\xe9s et \xe9v\xe9nements regionaux','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_3=g_navNode_0.addNode('2390','National activities and events',ssUrlPrefix + 'follow/National/index.htm','SectionLabel_en==National activities and events','SectionLabel_es==Actividades y eventos nationales','SectionLabel_fr==Activit\xe9s et \xe9v\xe9nements nationaux','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('2338','The World Commission\x3a Origins and Working Methods',ssUrlPrefix + 'origins/index.htm','SectionLabel_en==The World Commission\x3a Origins and Working Methods ','SectionLabel_es==La Comisi\xf3n Mundial\x3a or\xedgenes y m\xe9todos de trabajo ','SectionLabel_fr==La Commission mondiale\x3a origines et m\xe9thodes de travail ','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('2339','The Report of the World Commission',ssUrlPrefix + 'report/index.htm','SectionLabel_en==The Report of the World Commission ','SectionLabel_es==Informe de la Comisi\xf3n Mundial ','SectionLabel_fr==Le rapport de la Commission mondiale ','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_1=g_navNode_2.addNode('2341','Toolkit and summary of the Report',ssUrlPrefix + 'report/toolkit/index.htm','SectionLabel_en==Toolkit and summary of the Report ','SectionLabel_es==Gu\xeda pr\xe1ctica y resumen del Informe \x28solamente en ingl\xe8s\x29 ','SectionLabel_fr==Manuel pratique et r\xe9sum\xe9 du rapport \x28en anglais seulement\x29 ','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_2=g_navNode_2.addNode('2342','References to the Report',ssUrlPrefix + 'report/references/index.htm','SectionLabel_en==References to the Report ','SectionLabel_es==Gu\xeda pr\xe1ctica y resumen del Informe \x28solamente en ingl\xe8s\x29 ','SectionLabel_fr==R\xe9f\xe9rences au rapport ','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3=g_navNode_Root.addNode('2343','The role and mandate of the ILO',ssUrlPrefix + 'mandate/index.htm','SectionLabel_en==The role and mandate of the ILO ','SectionLabel_es==La funci\xf3n y el mandato de la OIT ','SectionLabel_fr==Le r\xf4le et le mandat de l\\x27OIT ','secondaryUrlVariableField==pl_replaceable_content');

