/////////////////////////////////////////////////////////////////////////////
// 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('2','Home',ssUrlPrefix + 'index.htm',null,'WTSiteSection==education','WTSiteSegmentation==education','WTSiteSubSection==section homepage','css_file_name==microsites/education.css','js_file_name==popup.js,redirect_education.js');
g_navNode_0=g_navNode_Root.addNode('resources','Resources',ssUrlPrefix + 'resources/index.htm','WTSiteSection==resources','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==REFRESH_STYLESHEET','js_file_name==popup.js');
g_navNode_0_0=g_navNode_0.addNode('for4-7yearolds','For 4-7 year olds',ssUrlPrefix + 'resources/for_4-7_year_olds/index.htm','WTSiteSection==resources','WTSiteSegmentation==education','WTSiteSubSection==information page','secondaryUrlVariableField==MainRegion');
g_navNode_0_1=g_navNode_0.addNode('for7-11yearolds','For 7-11 year olds',ssUrlPrefix + 'resources/for_7-11_year_olds/index.htm','WTSiteSection==resources','WTSiteSegmentation==education','WTSiteSubSection==information page','secondaryUrlVariableField==MainRegion');
g_navNode_0_2=g_navNode_0.addNode('for11-14yearolds','For 11-14 year olds',ssUrlPrefix + 'resources/for_11-14_year_olds/index.htm','WTSiteSection==resources','WTSiteSegmentation==education','WTSiteSubSection==information page','secondaryUrlVariableField==MainRegion');
g_navNode_1=g_navNode_Root.addNode('powerstationvisits','Power station visits',ssUrlPrefix + 'power_station_visits/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_0=g_navNode_1.addNode('tilbury','Tilbury',ssUrlPrefix + 'power_station_visits/tilbury/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_1=g_navNode_1.addNode('littlebrook','Littlebrook',ssUrlPrefix + 'power_station_visits/littlebrook/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_2=g_navNode_1.addNode('littlebarford','Little Barford',ssUrlPrefix + 'power_station_visits/little_barford/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_3=g_navNode_1.addNode('fawley','Fawley',ssUrlPrefix + 'power_station_visits/fawley/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_4=g_navNode_1.addNode('dolgarrog','Dolgarrog',ssUrlPrefix + 'power_station_visits/dolgarrog/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_5=g_navNode_1.addNode('didcota','Didcot A',ssUrlPrefix + 'power_station_visits/didcot_a/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_1_6=g_navNode_1.addNode('aberthaw','Aberthaw',ssUrlPrefix + 'power_station_visits/aberthaw/index.htm','WTSiteSection==power station visits','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_2=g_navNode_Root.addNode('companywebsites','Company web sites',ssUrlPrefix + 'company_web_sites/index.htm','WTSiteSection==company websites','WTSiteSegmentation==education','WTSiteSubSection==information page');
g_navNode_3=g_navNode_Root.addNode('contact','Contact',ssUrlPrefix + 'contact/index.htm','WTSiteSection==contact','WTSiteSegmentation==education','WTSiteSubSection==contact page');
g_navNode_5=g_navNode_Root.addNode('374','web',ssUrlPrefix + 'web/index.htm','WTSiteSection==education','WTSiteSegmentation==education','WTSiteSubSection==section homepage','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_0=g_navNode_5.addNode('375','homepage',ssUrlPrefix + 'web/homepage/index.htm','WTSiteSection==education','WTSiteSegmentation==education','WTSiteSubSection==section homepage','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_1=g_navNode_5.addNode('638','npower_Brighter_Futures',ssUrlPrefix + 'web/npower_Brighter_Futures/index.htm','WTSiteSection==brighter futures','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_2=g_navNode_5.addNode('639','npower_Climate_Cops',ssUrlPrefix + 'web/npower_Climate_Cops/index.htm','WTSiteSection==climate cops','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_2_7=g_navNode_5_2.addNode('925','test',ssUrlPrefix + 'web/npower_Climate_Cops/test/index.htm','WTSiteSection==climate cops','WTSiteSegmentation==education','WTSiteSubSection==test','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_3=g_navNode_5.addNode('921','Urban Cricket programme',ssUrlPrefix + 'web/Urban-Cricket-programme/index.htm','WTSiteSection==urban cricket programme','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js','redirectionURL==http\x3a//cricket.npower.com/web/npower_urban_cricket/index.htm');
g_navNode_5_4=g_navNode_5.addNode('922','Football League - Home Team Heroes',ssUrlPrefix + 'web/Football-League-Home-Team-Heroes/index.htm','WTSiteSection==football league - home team heroes','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js','redirectionURL==http\x3a//www.npower.com/hometeamheroes');
g_navNode_5_5=g_navNode_5.addNode('643','science_technology_engineering_maths',ssUrlPrefix + 'web/science_technology_engineering_maths/index.htm','WTSiteSection==science technology engineering maths','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_6=g_navNode_5.addNode('644','students',ssUrlPrefix + 'web/students/index.htm','WTSiteSection==students','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_7=g_navNode_5.addNode('645','useful_links',ssUrlPrefix + 'web/useful_links/index.htm','WTSiteSection==useful links','WTSiteSegmentation==education','WTSiteSubSection==information page','css_file_name==stylesheet_education','js_file_name==npower.js');
g_navNode_5_8=g_navNode_5.addNode('646','contact_us',ssUrlPrefix + 'web/contact_us/index.htm','WTSiteSection==contact us','WTSiteSegmentation==education','WTSiteSubSection==contact page','css_file_name==stylesheet_education','js_file_name==npower.js');

