/////////////////////////////////////////////////////////////////////////////
// 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('2530','Department of Statistics',ssUrlPrefix + 'index.htm',null,'NavigationRootLevel==1','SectionLabel_en==Department of Statistics','SectionLabel_es==Departamento de Estad\xedstica','SectionLabel_fr==D\xe9partement de statistique','SiteLabel_en==Statistics','SiteLabel_es==Statistics','SiteLabel_fr==Statistics','SiteLanguages==en,es,fr','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0=g_navNode_Root.addNode('2536','About us',ssUrlPrefix + 'Aboutus/index.htm','SectionLabel_en==About us','SectionLabel_es==Qui\xe9nes somos','SectionLabel_fr==\xc0 notre sujet','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_0_0=g_navNode_0.addNode('2566','History',ssUrlPrefix + 'Aboutus/History/index.htm','SectionLabel_en==History','SectionLabel_es==Historia','SectionLabel_fr==Aper\xe7u historique','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1=g_navNode_Root.addNode('2537','Areas of work',ssUrlPrefix + 'Areasofwork/index.htm','SectionLabel_en==Areas of work','SectionLabel_es==Ambitos de trabajo','SectionLabel_fr==Domaines d\u2019activit\xe9','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_0=g_navNode_1.addNode('2540','Compilation of statistics',ssUrlPrefix + 'Areasofwork/Compilation/index.htm','SectionLabel_en==Compilation of statistics','SectionLabel_es==Acopio y difusi\xf3n de estad\xedsticas','SectionLabel_fr==Compilation et diffusion de statistiques','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_1=g_navNode_1.addNode('2541','International standard setting',ssUrlPrefix + 'Areasofwork/Standards/index.htm','SectionLabel_en==International standard setting','SectionLabel_es==Establecimiento de normas internacionales sobre estad\xedsticas del trabajo','SectionLabel_fr==Elaboration de normes internationales sur les statistiques du travail','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_2=g_navNode_1.addNode('2542','Technical assistance',ssUrlPrefix + 'Areasofwork/Technicalassistance/index.htm','SectionLabel_en==Technical assistance','SectionLabel_es==Asistencia t\xe9cnica','SectionLabel_fr==Assistance technique','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_1_3=g_navNode_1.addNode('2543','Training programme',ssUrlPrefix + 'Areasofwork/Training/index.htm','SectionLabel_en==Training programme','SectionLabel_es==Programa de formaci\xf3n','SectionLabel_fr==Programme de formation','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2=g_navNode_Root.addNode('2538','Publications',ssUrlPrefix + 'Publications/index.htm','SectionLabel_en==Publications','SectionLabel_es==Publicaciones ','SectionLabel_fr==Publications','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_0=g_navNode_2.addNode('2563','By title',ssUrlPrefix + 'Publications/Bytitle/index.htm','SectionLabel_en==Publications by title','SectionLabel_es==Publicaciones por t\xedtulo','SectionLabel_fr==Publications par titre','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_2_1=g_navNode_2.addNode('2564','By subject',ssUrlPrefix + 'Publications/Bysubject/index.htm','SectionLabel_en==Publications by subject','SectionLabel_es==Publicaciones por tema','SectionLabel_fr==Publications par th\xe8me','secondaryUrlVariableField==pl_replaceable_content');
g_navNode_4=g_navNode_Root.addNode('4844','failovertest',ssUrlPrefix + 'failovertest/index.htm','Hide==TRUE');

