/////////////////////////////////////////////////////////////////////////////
// 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 attrName = argValues[i].split("==")[0];
		var attrValue = argValues[i].split("==")[1];

		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 attrName = argValues[i].split("==")[0];
		var attrValue = argValues[i].split("==")[1];

		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('686','JCU Halls of Residence',ssUrlPrefix + 'index.htm',null,'cspFeatureImgQuery==dDocType \x3cmatches\x3e \x60foo\x60','cspNavImage==JCUPRD_043122','cspNavImgURL==index.htm','secondaryUrlVariableField==region1');
g_navNode_0=g_navNode_Root.addNode('778','Alumni',ssUrlPrefix + 'alumni/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Alumni\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_1=g_navNode_Root.addNode('706','Conferences and  Functions',ssUrlPrefix + 'conferences/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Contacts\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Conference\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_1_0=g_navNode_1.addNode('711','Conference and Function Facilities',ssUrlPrefix + 'conferences/facilities/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Facilities\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Conference\x60','cspSortSpec==xJCU_Heading asc xJCUSequence asc','secondaryUrlVariableField==region1');
g_navNode_1_1=g_navNode_1.addNode('714','Menus',ssUrlPrefix + 'conferences/menus/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../../index.htm','cspQueryText==xSubject \x3csubstring\x3e \x60menu\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60','cspSortSpec==xJCU_Heading asc dDocTitle asc','cspSubField==\x3c\x24xDescription\x24\x3e','secondaryUrlVariableField==region1');
g_navNode_2=g_navNode_Root.addNode('1898','Contacts',ssUrlPrefix + 'contacts/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3cmatches\x3e \x60Contacts\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_3=g_navNode_Root.addNode('768','Events',ssUrlPrefix + 'events/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Event_description\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60','cspSortSpec==xKeyDate desc','secondaryUrlVariableField==region1');
g_navNode_4=g_navNode_Root.addNode('701','Money Matters',ssUrlPrefix + 'money/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Finance\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_5=g_navNode_Root.addNode('715','Newsletters',ssUrlPrefix + 'news/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Newsletter\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60','cspSortSpec==xKeyDate desc','secondaryUrlVariableField==region1');
g_navNode_6=g_navNode_Root.addNode('696','Our Halls',ssUrlPrefix + 'halls/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Residence\x60','cspSortSpec==xJCU_Heading asc xJCUSequence asc','secondaryUrlVariableField==region1');
g_navNode_7=g_navNode_Root.addNode('697','Our People',ssUrlPrefix + 'staff/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Contacts_services\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  \x3cNOT\x3e \x28xJCU_Topic \x3csubstring\x3e \x60Support\x60\x29','cspSortSpec==xJCUSequence asc','secondaryUrlVariableField==region1');
g_navNode_7_0=g_navNode_7.addNode('1829','Residential Support Team',ssUrlPrefix + 'staff/rst/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Contacts_services\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Support\x60','cspSortSpec==xJCU_Heading asc xJCUSequence asc','secondaryUrlVariableField==region1');
g_navNode_8=g_navNode_Root.addNode('702','Preparing for Arrival',ssUrlPrefix + 'arrival/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  \x28xJCU_Topic \x3csubstring\x3e \x60Arrival\x60 \x3cOR\x3e  xJCU_Topic \x3csubstring\x3e \x60Orientation\x60\x29','cspSortSpec==xJCU_Heading asc xJCUSequence asc','secondaryUrlVariableField==region1');
g_navNode_9=g_navNode_Root.addNode('704','Residential Life',ssUrlPrefix + 'reslife/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Student Life\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_9_0=g_navNode_9.addNode('705','Resident Code of Conduct',ssUrlPrefix + 'reslife/conduct/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../../index.htm','cspQueryText==dDocType \x3csubstring\x3e \x60Policy\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60','cspSortSpec==dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_10=g_navNode_Root.addNode('698','Services \x26 Facilities',ssUrlPrefix + 'facilities/index.htm','cspDisplayField==\x3c\x24xJCU_Heading\x24\x3e','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==dDocType \x3cmatches\x3e \x60Facilities\x60  \x3cAND\x3e  xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  \x3cNOT\x3e \x28xJCU_Topic \x3csubstring\x3e \x60Conference\x60\x29','cspSortSpec==xJCU_Heading asc dDocTitle asc','secondaryUrlVariableField==region1');
g_navNode_11=g_navNode_Root.addNode('699','Short Stays',ssUrlPrefix + 'shortstay/index.htm','cspNavImage==JCUPRD_043122','cspNavImgURL==../index.htm','cspQueryText==xWebsites \x3ccontains\x3e \x60jcuhalls\x60  \x3cAND\x3e  xJCU_Topic \x3csubstring\x3e \x60Short stay\x60','cspSortSpec==xJCUSequence asc','secondaryUrlVariableField==region1');
