function UpdateNavigation(navi, childof)
{
	var uri;
	var link;
	var location;
	pg = document.getElementById("mainpanel").uri.split('/')[1].split('.')[0];
	uri = document.URL.split('?')[0] + '?pg=' + pg;
	if(document.getElementById("mainpanel").uri.indexOf('?') != -1)
	{
		params = document.getElementById("mainpanel").uri.split('?')[1];
		uri += '&params=' + escape('?' + params);
	}
	link = ('<a href="' + uri + '">' + navi + '</a>');
	if(childof != '') //if childof is set
	{
		//search for childof in array navigation[]
		location = FindInArray(childof, navigation);
		//truncate array navigation[] after parent
		if(location > -1)
			if(!(location == (navigation.length - 1)))
				navigation.splice(location + 1, (navigation.length - location));
	}
	else //it's blank therefore TOP LEVEL - clean that array out
	{
		navigation.splice(0,navigation.length);
	}
	//insert link at end of array navigation[]
	navigation.push(link);
	//populate navigation div from array navigation[]
	document.getElementById('navigation').innerHTML = '<ul><li>You are here:</li><li>' + navigation.join('</li><li>&gt;</li><li>') + '</li></ul>';
}
