/////////////////////////////////////////////////////////////////////////////
// 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('MalayHome','Home',ssUrlPrefix + 'index.htm',null,'showInTopMenuBar==TRUE');
g_navNode_2=g_navNode_Root.addNode('13','UKM_Databases',ssUrlPrefix + 'Highlights/index.htm','ShowInSideNavigation==TRUE','showInTopMenuBar==FALSE');
g_navNode_2_0=g_navNode_2.addNode('14','Adat Perpatih',ssUrlPrefix + 'Highlights/AdatPerpatih/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_1=g_navNode_2.addNode('18','Borneo Homeland',ssUrlPrefix + 'Highlights/BorneoHomeland/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_2=g_navNode_2.addNode('19','Karya Jawi',ssUrlPrefix + 'Highlights/KaryaJawi/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_3=g_navNode_2.addNode('22','N A Halim\'s Special Collection',ssUrlPrefix + 'Highlights/test/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_4=g_navNode_2.addNode('29','Malay World Database\x28PADAT\x29',ssUrlPrefix + 'Highlights/MalayWorldDatabasePADAT/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_5=g_navNode_2.addNode('30','Malay Dictionary Of End Syllables',ssUrlPrefix + 'Highlights/MalayDictionaryOfEndSyllabus/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_6=g_navNode_2.addNode('31','Malay Dictionaries By Non-Malays',ssUrlPrefix + 'Highlights/MalayDictionariesByNon-Malays/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_7=g_navNode_2.addNode('26','Sari On-Line',ssUrlPrefix + 'Highlights/SariOn-Line/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_8=g_navNode_2.addNode('32','Peribhasa \x28Malay Proverbs\x29',ssUrlPrefix + 'Highlights/PeribhasaMalayProverbs/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_9=g_navNode_2.addNode('33','Pantun Baba \x28Baba\'s Pantun\x29',ssUrlPrefix + 'Highlights/PantumBabaBabasPantum/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_10=g_navNode_2.addNode('34','SejutaPantun Malayu',ssUrlPrefix + 'Highlights/1JutaPantumMalayu/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_11=g_navNode_2.addNode('35','Tenas Effendy\'s Special Collection',ssUrlPrefix + 'Highlights/TenasEffendysSpecialCollection/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_12=g_navNode_2.addNode('36','Zaba\'s Collection',ssUrlPrefix + 'Highlights/ZabasCollection/index.htm','ShowInSideNavigation==TRUE');
g_navNode_2_13=g_navNode_2.addNode('37','Kolesksi Khas Yang Quee Yee',ssUrlPrefix + 'Highlights/KolesksiKhasYangQueeYee/index.htm','ShowInSideNavigation==TRUE');
g_navNode_3=g_navNode_Root.addNode('2','AboutUs',ssUrlPrefix + 'AboutUs/index.htm','showInTopMenuBar==TRUE');
g_navNode_3_0=g_navNode_3.addNode('3','The Introduction',ssUrlPrefix + 'AboutUs/Introduction/index.htm','showInTopMenuBar==TRUE');
g_navNode_3_1=g_navNode_3.addNode('4','Mission \x26 Vision',ssUrlPrefix + 'AboutUs/MissionVision/index.htm','showInTopMenuBar==TRUE');
g_navNode_3_2=g_navNode_3.addNode('5','Profile',ssUrlPrefix + 'AboutUs/Profile/index.htm','showInTopMenuBar==TRUE');
g_navNode_3_3=g_navNode_3.addNode('6','Contact Us',ssUrlPrefix + 'AboutUs/ContactUs/index.htm','showInTopMenuBar==TRUE');
g_navNode_3_4=g_navNode_3.addNode('7','Research',ssUrlPrefix + 'AboutUs/Research/index.htm','showInTopMenuBar==TRUE');
g_navNode_4=g_navNode_Root.addNode('27','Site Map',ssUrlPrefix + 'SiteMap/index.htm','showInTopMenuBar==TRUE');

