var TREE_ITEMS = [
	['EPA-NR', 'index.html', {'tt' : 'Window object', 'sb':'Window object'},
		['<b>Introduction</b>', 'introduction.html', {'tt' : 'Introduction', 'sb' : 'Introduction'},
			/*['Introduction', 'introduction.html'],*/
			['Objective', 'objective.html'],
			['Partners', 'partners.html'],
			['EPA-NR brochure', 'brochure.html'],
		],
		['<b>1. All project results</b>', '1.html', {'tt' : 'All project results', 'sb' : 'All project results'},
			['1.1 EPA-NR Method and tools', '11.html', {'tt' : '1.2 EPA-NR Method and tools', 'sb' : '1.1 EPA-NR Method and tools'},
				['1.1.1 Booklet describing the<br>EPA-NR method', '111.html'],
				['1.1.2 Process stages & tools', '112.html'],
				['1.1.3 Checklist intake interview', '113.html'],
				['1.1.4 Inspection protocol', '114.html'],
				['1.1.5 EPA-NR software', '115.html'],
				['1.1.6 Functional specifications of<br>the EPA-NR software', '116.html'],
			],
			['1.2 Application strategies', '12.html', {'tt' : '1.2 Application strategies', 'sb' : '1.2 Application strategies'},
				['1.2.1 Strategy report', '121.html'],
			],
			['1.3 Pilots', '13.html', {'tt' : '1.3 Pilots', 'sb' : '1.3 Pilots'},
				['1.3.1 Overview pilots', '131.html'],
				['1.3.2 Brochure on pilots', '132.html'],
				['1.3.3 National pilot projects', '133.html'],
			],
			['1.4 Brochures', '14.html', {'tt' : '1.4 Brochures', 'sb' : '1.4 Brochures'},
				['1.4.1 Intro brochure', '141.html'],
				['1.4.2 Other brochures', '142.html'],
			],
			['1.5 National context', '15.html', {'tt' : '1.5 National context', 'sb' : '1.5 National context'},
				['1.5.1 Survey: National context<br>and need for instruments', '151.html'],
			],
		],
		['<b>2. Results by target audience</b>', '2.html', {'tt' : '2. Results by target audience', 'sb' : '2. Results by target audience'},
			['2.1 Consultants', '21.html'],
			['2.2 Policy makers', '22.html'],
		],
		['<b>Further information & links</b>', 'furtherinfo.html', {}],
		['<a href="javascript:expand_all(0)">Expand all</a>', 0, {}],
		['<a href="javascript:collapse_all(0,1)">Collapse all</a>', 0, {}]
		/*['About this site', 0, {'tt' : 'About this site', 'hs' : 'iets'}]*/
	]
];


function iets (o_item) {
	alert("javascriptje.");
	return true;
}

function expand_all (n_index, n_depth) {	
    var o_tree = TREES[n_index ? n_index : 0];
	if (!o_tree)
		alert("Tree is not initialized yet");
	var a_nodes = o_tree.a_nodes;
	for (var i = 0; i< a_nodes.length; i++)
		if (n_depth == null || a_nodes[i].n_depth <= n_depth)
			a_nodes[i].open(0, 1);
	o_tree.ndom_refresh();
}

function collapse_all (n_index, n_depth) {
	var o_tree = TREES[n_index ? n_index : 0];
	if (!n_depth) n_depth = 1;
	if (!o_tree)
		alert("Tree is not initialized yet");
	var a_nodes = o_tree.a_nodes;
	for (var i = a_nodes.length - 1; i >= 0; i--)
		if (a_nodes[i].n_depth >= n_depth && a_nodes[i].open)
			a_nodes[i].open(1, 1);
	o_tree.ndom_refresh();
}