/////////////////////////////////////////////////////////////////////////////
// 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('1500','INTEGRATION\x3a Home',ssUrlPrefix + 'index.htm',null,'BreadcrumbPrefixNode==global\x3a278','NavigationRootLevel==1','SectionLabelShort_en==INTEGRATION home','SectionLabel_en==Policy Integration Department \x28INTEGRATION\x29','SietLabel_fr==INTEGRATION','SiteLabel_en==INTEGRATION','SiteLabel_es==INTEGRATION','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('1501','About the Group',ssUrlPrefix + 'about/index.htm','SectionLabel_en==About us','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_0=g_navNode_0.addNode('1515','Staff profiles',ssUrlPrefix + 'about/staff/index.htm','SectionLabel_en==Staff profiles','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('3087','Themes',ssUrlPrefix + 'themes/index.htm','SectionLabel_en==Themes','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_1=g_navNode_1.addNode('2906','Measuring decent work',ssUrlPrefix + 'themes/mdw/index.htm','SectionLabel_en==Measuring decent work','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_2=g_navNode_1.addNode('3648','Mainstreaming decent work',ssUrlPrefix + 'themes/dw_mainstreaming/index.htm','SectionLabel_en==Mainstreaming decent work','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_3=g_navNode_1.addNode('1504','Policy Coherence Initiative',ssUrlPrefix + 'themes/pci/index.htm','SectionLabel_en==Policy coherence initiative','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_3_0=g_navNode_1_3.addNode('3092','International activities',ssUrlPrefix + 'themes/pci/international/index.htm','SectionLabel_en==International activities','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_3_1=g_navNode_1_3.addNode('3093','Regional activities',ssUrlPrefix + 'themes/pci/regional/index.htm','SectionLabel_en==Regional activities','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_4=g_navNode_1.addNode('1505','Fair Globalization',ssUrlPrefix + 'themes/sdg/index.htm','SectionLabel_en==Fair globalization','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_5=g_navNode_1.addNode('3095','Financial crisis',ssUrlPrefix + 'themes/crisis/index.htm','SectionLabel_en==Financial crisis','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_6=g_navNode_1.addNode('3096','Inequality',ssUrlPrefix + 'themes/inequality/index.htm','SectionLabel_en==Inequality','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('1502','Publications and information resources',ssUrlPrefix + 'resources/index.htm','SectionLabel_en==Publications and information resources','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_0=g_navNode_2.addNode('1516','Technical briefs',ssUrlPrefix + 'resources/briefs/index.htm','SectionLabel_en==Technical briefs','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_1=g_navNode_2.addNode('1517','Working papers',ssUrlPrefix + 'resources/papers/index.htm','SectionLabel_en==Working papers','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_2=g_navNode_2.addNode('1518','Other publications',ssUrlPrefix + 'resources/pubs/index.htm','SectionLabel_en==Other publications','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_4=g_navNode_2.addNode('1529','Meeting documentation',ssUrlPrefix + 'resources/mtgdocs/index.htm','SectionLabel_en==Meeting documentation','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_5=g_navNode_2.addNode('2090','Presentations',ssUrlPrefix + 'resources/Presentations/index.htm','SectionLabel_en==Presentations','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3=g_navNode_Root.addNode('1503','Decent Work Forums and other events',ssUrlPrefix + 'events/index.htm','SectionLabel_en==Decent Work Forums and other events','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3_0=g_navNode_3.addNode('1526','Decent Work Forums',ssUrlPrefix + 'events/forums/index.htm','SectionLabel_en==Decent Work Forums','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_3_1=g_navNode_3.addNode('1527','Other events',ssUrlPrefix + 'events/events/index.htm','SectionLabel_en==Other events','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4=g_navNode_Root.addNode('1506','Past initiatives',ssUrlPrefix + 'historical/index.htm','SectionLabel_en==Past initiatives','secondaryUrlVariableField==pl_replaceable_content');

