var temp123 = '';
var nodeList = new Array();
var breadcrumb = new Array();

var map_loaded = false;
var bc_loaded = false;

// This function creates asset Node objects
function Node(id, name, url, hvrtxt, level, children, parent) {
	this.id = id;
	this.name = name;
	this.url = url;
	this.hvrtxt = hvrtxt;
	this.level = level;
	this.children = children;
	this.parent = parent;
	}

// This function creates breadcrumb objects
function breadcrumbNode(id, parent) {
	this.id = id;
	this.parent = parent;
	}

function getNodeById(id) {
	for (x=0; x < nodeList.length; x++)
		if (nodeList[x].id == id) return nodeList[x];
		
	return null;
	}

function getNodeByName(name) {
	for (x=0; x < nodeList.length; x++)
		if (nodeList[x].name == name) return nodeList[x];
	
	return null;
	}	

function setParentNode(x) {
	for(p = x - 1; p >= 0; p--) {						// Search up the site structure node list.
		if (nodeList[p].level < nodeList[x].level) {	//   and is at a higher level in the tree, then you have found the parent
			nodeList[x].parent = nodeList[p].id;		// Set the parent asset id
//			nodeList[p].children--;						// Decrease its number of children
			return;										// Stop looking for the parent
			}
		}
	}

function initSiteNav() {	

	if (map_loaded == false) {
		var i = 0;
//		document.write("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\">");

		nodeList[i++] = new Node(75520,"Home","http://nodal.ercot.com/index.html","",1,6,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75520</td><td>Home</td><td>http://nodal.ercot.com/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75489,"About Texas Nodal","http://nodal.ercot.com/about/index.html","",2,4,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75489</td><td>About Texas Nodal</td><td>http://nodal.ercot.com/about/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83016,"What's Changing","http://nodal.ercot.com/about/wc/index.html","",3,5,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83016</td><td>What's Changing</td><td>http://nodal.ercot.com/about/wc/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83019,"Zonal vs. Nodal","http://nodal.ercot.com/about/wc/zvn/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83019</td><td>Zonal vs. Nodal</td><td>http://nodal.ercot.com/about/wc/zvn/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83038,"DAM","http://nodal.ercot.com/about/wc/dam.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83038</td><td>DAM</td><td>http://nodal.ercot.com/about/wc/dam.html</td><td></td></tr>");

		nodeList[i++] = new Node(83041,"RUC","http://nodal.ercot.com/about/wc/ruc.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83041</td><td>RUC</td><td>http://nodal.ercot.com/about/wc/ruc.html</td><td></td></tr>");

		nodeList[i++] = new Node(83040,"Real-Time Market","http://nodal.ercot.com/about/wc/rt.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83040</td><td>Real-Time Market</td><td>http://nodal.ercot.com/about/wc/rt.html</td><td></td></tr>");

		nodeList[i++] = new Node(83039,"CRR","http://nodal.ercot.com/about/wc/crr.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83039</td><td>CRR</td><td>http://nodal.ercot.com/about/wc/crr.html</td><td></td></tr>");

		nodeList[i++] = new Node(83007,"Nodal Program","http://nodal.ercot.com/about/po/index.html","",3,4,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83007</td><td>Nodal Program</td><td>http://nodal.ercot.com/about/po/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83023,"Organization","http://nodal.ercot.com/about/po/org/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83023</td><td>Organization</td><td>http://nodal.ercot.com/about/po/org/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83029,"Schedules","http://nodal.ercot.com/about/po/sch/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83029</td><td>Schedules</td><td>http://nodal.ercot.com/about/po/sch/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(82987,"Governance","http://nodal.ercot.com/about/po/gov/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>82987</td><td>Governance</td><td>http://nodal.ercot.com/about/po/gov/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83032,"Accountability","http://nodal.ercot.com/about/po/acc/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83032</td><td>Accountability</td><td>http://nodal.ercot.com/about/po/acc/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75490,"Nodal Projects","http://nodal.ercot.com/about/projects/index.html","",3,15,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75490</td><td>Nodal Projects</td><td>http://nodal.ercot.com/about/projects/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(116930,"PMO","http://nodal.ercot.com/about/projects/pmo/index.html","Program Management Office",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>116930</td><td>PMO</td><td>http://nodal.ercot.com/about/projects/pmo/index.html</td><td>Program Management Office</td></tr>");

		nodeList[i++] = new Node(88112,"NMMS","http://nodal.ercot.com/about/projects/nmms/index.html","Network Model Management System",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>88112</td><td>NMMS</td><td>http://nodal.ercot.com/about/projects/nmms/index.html</td><td>Network Model Management System</td></tr>");

		nodeList[i++] = new Node(110523,"EMS","http://nodal.ercot.com/about/projects/ems/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>110523</td><td>EMS</td><td>http://nodal.ercot.com/about/projects/ems/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(95198,"MMS","http://nodal.ercot.com/about/projects/mms/index.html","Market Management System (MMS)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>95198</td><td>MMS</td><td>http://nodal.ercot.com/about/projects/mms/index.html</td><td>Market Management System (MMS)</td></tr>");

		nodeList[i++] = new Node(103337,"CRR","http://nodal.ercot.com/about/projects/crr/index.html","Congestion Revenue Rights (CRR)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>103337</td><td>CRR</td><td>http://nodal.ercot.com/about/projects/crr/index.html</td><td>Congestion Revenue Rights (CRR)</td></tr>");

		nodeList[i++] = new Node(92311,"COMS","http://nodal.ercot.com/about/projects/coms/index.html","Commercial Systems (COMS)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>92311</td><td>COMS</td><td>http://nodal.ercot.com/about/projects/coms/index.html</td><td>Commercial Systems (COMS)</td></tr>");

		nodeList[i++] = new Node(101061,"EDS","http://nodal.ercot.com/about/projects/eds/index.html","Early Delivery Systems (EDS)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>101061</td><td>EDS</td><td>http://nodal.ercot.com/about/projects/eds/index.html</td><td>Early Delivery Systems (EDS)</td></tr>");

		nodeList[i++] = new Node(219997,"Systems Integration","http://nodal.ercot.com/about/projects/si/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>219997</td><td>Systems Integration</td><td>http://nodal.ercot.com/about/projects/si/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(107261,"INF","http://nodal.ercot.com/about/projects/inf/index.html","Infrastructure (INF)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>107261</td><td>INF</td><td>http://nodal.ercot.com/about/projects/inf/index.html</td><td>Infrastructure (INF)</td></tr>");

		nodeList[i++] = new Node(211337,"CDR","http://nodal.ercot.com/about/projects/cdr/index.html","Current-Day Reports (CDR)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>211337</td><td>CDR</td><td>http://nodal.ercot.com/about/projects/cdr/index.html</td><td>Current-Day Reports (CDR)</td></tr>");

		nodeList[i++] = new Node(120013,"EDW","http://nodal.ercot.com/about/projects/edw/index.html","Enterprise Data Warehouse (EDW)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>120013</td><td>EDW</td><td>http://nodal.ercot.com/about/projects/edw/index.html</td><td>Enterprise Data Warehouse (EDW)</td></tr>");

		nodeList[i++] = new Node(161739,"MIS","http://nodal.ercot.com/about/projects/mis/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>161739</td><td>MIS</td><td>http://nodal.ercot.com/about/projects/mis/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(145982,"ERCOT Readiness","http://nodal.ercot.com/about/projects/ert/index.html","ERCOT Readiness",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>145982</td><td>ERCOT Readiness</td><td>http://nodal.ercot.com/about/projects/ert/index.html</td><td>ERCOT Readiness</td></tr>");

		nodeList[i++] = new Node(90286,"Training","http://nodal.ercot.com/about/projects/training/index.html","Training",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>90286</td><td>Training</td><td>http://nodal.ercot.com/about/projects/training/index.html</td><td>Training</td></tr>");

		nodeList[i++] = new Node(86119,"Integration and Design Authority","http://nodal.ercot.com/about/projects/ida/index.html","Integration and Design Authority",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>86119</td><td>Integration and Design Authority</td><td>http://nodal.ercot.com/about/projects/ida/index.html</td><td>Integration and Design Authority</td></tr>");

		nodeList[i++] = new Node(81343,"Nodal News","http://nodal.ercot.com/about/news/index.html","",3,1,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>81343</td><td>Nodal News</td><td>http://nodal.ercot.com/about/news/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(82994,"Newsletters","http://nodal.ercot.com/about/news/newsletters/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>82994</td><td>Newsletters</td><td>http://nodal.ercot.com/about/news/newsletters/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(99749,"Market Rules","http://nodal.ercot.com/mktrules/index.html","",2,3,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>99749</td><td>Market Rules</td><td>http://nodal.ercot.com/mktrules/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83268,"Nodal Protocols","http://nodal.ercot.com/protocols/index.html","",3,3,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83268</td><td>Nodal Protocols</td><td>http://nodal.ercot.com/protocols/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75491,"Nodal Protocols Library","http://nodal.ercot.com/protocols/library/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75491</td><td>Nodal Protocols Library</td><td>http://nodal.ercot.com/protocols/library/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83671,"Nodal Protocol Revision Requests","http://nodal.ercot.com/protocols/nprr/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83671</td><td>Nodal Protocol Revision Requests</td><td>http://nodal.ercot.com/protocols/nprr/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(83905,"NPRR Submission Process","http://nodal.ercot.com/protocols/nprr/proc/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>83905</td><td>NPRR Submission Process</td><td>http://nodal.ercot.com/protocols/nprr/proc/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(99787,"Nodal Operating Guides","http://nodal.ercot.com/mktrules/noperating/index.html","",3,3,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>99787</td><td>Nodal Operating Guides</td><td>http://nodal.ercot.com/mktrules/noperating/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(159750,"Current Nodal Operating Guide","http://nodal.ercot.com/mktrules/noperating/cur.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>159750</td><td>Current Nodal Operating Guide</td><td>http://nodal.ercot.com/mktrules/noperating/cur.html</td><td></td></tr>");

		nodeList[i++] = new Node(99807,"Nodal Operating Guide Library","http://nodal.ercot.com/mktrules/noperating/lib.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>99807</td><td>Nodal Operating Guide Library</td><td>http://nodal.ercot.com/mktrules/noperating/lib.html</td><td></td></tr>");

		nodeList[i++] = new Node(99847,"Nodal Operating Guide Revision Requests","http://nodal.ercot.com/mktrules/noperating/nogrr/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>99847</td><td>Nodal Operating Guide Revision Requests</td><td>http://nodal.ercot.com/mktrules/noperating/nogrr/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(132012,"Nodal Procedures","http://nodal.ercot.com/mktrules/np/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>132012</td><td>Nodal Procedures</td><td>http://nodal.ercot.com/mktrules/np/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75492,"Training","http://nodal.ercot.com/training/index.html","",2,4,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75492</td><td>Training</td><td>http://nodal.ercot.com/training/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(110480,"Courses","http://nodal.ercot.com/training/courses/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>110480</td><td>Courses</td><td>http://nodal.ercot.com/training/courses/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(114213,"Training Locations","http://nodal.ercot.com/training/locations/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>114213</td><td>Training Locations</td><td>http://nodal.ercot.com/training/locations/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(152931,"Training Readiness by Role","http://nodal.ercot.com/training/readiness/index.html","",3,7,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152931</td><td>Training Readiness by Role</td><td>http://nodal.ercot.com/training/readiness/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(152940,"QSE without Resources","http://nodal.ercot.com/training/readiness/q/index.html","Nodal Training Readiness: Qualified Scheduling Entity (QSE) without Resources",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152940</td><td>QSE without Resources</td><td>http://nodal.ercot.com/training/readiness/q/index.html</td><td>Nodal Training Readiness: Qualified Scheduling Entity (QSE) without Resources</td></tr>");

		nodeList[i++] = new Node(152942,"QSE with Resources","http://nodal.ercot.com/training/readiness/qr/index.html","Nodal Training Readiness: Qualified Scheduling Entity (QSE) with Resources",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152942</td><td>QSE with Resources</td><td>http://nodal.ercot.com/training/readiness/qr/index.html</td><td>Nodal Training Readiness: Qualified Scheduling Entity (QSE) with Resources</td></tr>");

		nodeList[i++] = new Node(152941,"TDSP","http://nodal.ercot.com/training/readiness/td/index.html","Nodal Training Readiness: Transmission/Distribution Service Provider (TSP/DSP)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152941</td><td>TDSP</td><td>http://nodal.ercot.com/training/readiness/td/index.html</td><td>Nodal Training Readiness: Transmission/Distribution Service Provider (TSP/DSP)</td></tr>");

		nodeList[i++] = new Node(152947,"LSE","http://nodal.ercot.com/training/readiness/lse/index.html","Nodal Training Readiness: Load Serving Entity (LSE)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152947</td><td>LSE</td><td>http://nodal.ercot.com/training/readiness/lse/index.html</td><td>Nodal Training Readiness: Load Serving Entity (LSE)</td></tr>");

		nodeList[i++] = new Node(152946,"CRR Account Holder","http://nodal.ercot.com/training/readiness/crr/index.html","Nodal Training Readiness: Congestion Revenue Rights Account Holder",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152946</td><td>CRR Account Holder</td><td>http://nodal.ercot.com/training/readiness/crr/index.html</td><td>Nodal Training Readiness: Congestion Revenue Rights Account Holder</td></tr>");

		nodeList[i++] = new Node(152938,"ERCOT","http://nodal.ercot.com/training/readiness/e/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>152938</td><td>ERCOT</td><td>http://nodal.ercot.com/training/readiness/e/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(111455,"Nodal Training Readiness Course Guide","http://nodal.ercot.com/training/readiness/all/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>111455</td><td>Nodal Training Readiness Course Guide</td><td>http://nodal.ercot.com/training/readiness/all/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(93257,"Training Exam","http://nodal.ercot.com/training/testing/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>93257</td><td>Training Exam</td><td>http://nodal.ercot.com/training/testing/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75488,"Documents","http://nodal.ercot.com/docs/index.html","",2,4,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75488</td><td>Documents</td><td>http://nodal.ercot.com/docs/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75503,"Current Issues and Topics","http://nodal.ercot.com/docs/cit/index.html","",3,1,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75503</td><td>Current Issues and Topics</td><td>http://nodal.ercot.com/docs/cit/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(80618,"Archive","http://nodal.ercot.com/docs/cit/archive.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>80618</td><td>Archive</td><td>http://nodal.ercot.com/docs/cit/archive.html</td><td></td></tr>");

		nodeList[i++] = new Node(75495,"Nodal Program Office","http://nodal.ercot.com/docs/po/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75495</td><td>Nodal Program Office</td><td>http://nodal.ercot.com/docs/po/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75496,"Nodal Project Documents","http://nodal.ercot.com/docs/pd/index.html","",3,14,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75496</td><td>Nodal Project Documents</td><td>http://nodal.ercot.com/docs/pd/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(80187,"NMMS","http://nodal.ercot.com/docs/pd/nmms/index.html","Network Model Management System",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>80187</td><td>NMMS</td><td>http://nodal.ercot.com/docs/pd/nmms/index.html</td><td>Network Model Management System</td></tr>");

		nodeList[i++] = new Node(75512,"EMS","http://nodal.ercot.com/docs/pd/ems/index.html","Energy Management System",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75512</td><td>EMS</td><td>http://nodal.ercot.com/docs/pd/ems/index.html</td><td>Energy Management System</td></tr>");

		nodeList[i++] = new Node(125602,"MMS","http://nodal.ercot.com/docs/pd/mms/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>125602</td><td>MMS</td><td>http://nodal.ercot.com/docs/pd/mms/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75514,"CRR","http://nodal.ercot.com/docs/pd/crr/index.html","Congestion Revenue Rights",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75514</td><td>CRR</td><td>http://nodal.ercot.com/docs/pd/crr/index.html</td><td>Congestion Revenue Rights</td></tr>");

		nodeList[i++] = new Node(75515,"COMS","http://nodal.ercot.com/docs/pd/coms/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75515</td><td>COMS</td><td>http://nodal.ercot.com/docs/pd/coms/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75518,"EDS","http://nodal.ercot.com/docs/pd/eds/index.html","Early Delivery Systems (EDS) - formerly IRT",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75518</td><td>EDS</td><td>http://nodal.ercot.com/docs/pd/eds/index.html</td><td>Early Delivery Systems (EDS) - formerly IRT</td></tr>");

		nodeList[i++] = new Node(219703,"Systems Integration","http://nodal.ercot.com/docs/pd/si/index.html","Systems Integration",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>219703</td><td>Systems Integration</td><td>http://nodal.ercot.com/docs/pd/si/index.html</td><td>Systems Integration</td></tr>");

		nodeList[i++] = new Node(78802,"INF","http://nodal.ercot.com/docs/pd/inf/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>78802</td><td>INF</td><td>http://nodal.ercot.com/docs/pd/inf/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(162909,"CDR","http://nodal.ercot.com/docs/pd/cdr/index.html","Current-Day Reports (CDR)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>162909</td><td>CDR</td><td>http://nodal.ercot.com/docs/pd/cdr/index.html</td><td>Current-Day Reports (CDR)</td></tr>");

		nodeList[i++] = new Node(162904,"EDW","http://nodal.ercot.com/docs/pd/edw/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>162904</td><td>EDW</td><td>http://nodal.ercot.com/docs/pd/edw/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(162907,"MIS","http://nodal.ercot.com/docs/pd/mis/index.html","Market Information System (MIS)",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>162907</td><td>MIS</td><td>http://nodal.ercot.com/docs/pd/mis/index.html</td><td>Market Information System (MIS)</td></tr>");

		nodeList[i++] = new Node(146021,"ERCOT Readiness","http://nodal.ercot.com/docs/pd/ert/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>146021</td><td>ERCOT Readiness</td><td>http://nodal.ercot.com/docs/pd/ert/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75519,"Training","http://nodal.ercot.com/docs/pd/trn/index.html","Training",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75519</td><td>Training</td><td>http://nodal.ercot.com/docs/pd/trn/index.html</td><td>Training</td></tr>");

		nodeList[i++] = new Node(75510,"Integration and Design Authority","http://nodal.ercot.com/docs/pd/ida/index.html","Integration and Design Authority",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75510</td><td>Integration and Design Authority</td><td>http://nodal.ercot.com/docs/pd/ida/index.html</td><td>Integration and Design Authority</td></tr>");

		nodeList[i++] = new Node(75505,"TNT Archives","http://nodal.ercot.com/docs/tntarc/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75505</td><td>TNT Archives</td><td>http://nodal.ercot.com/docs/tntarc/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(130766,"Readiness Center","http://nodal.ercot.com/readiness/index.html","",2,9,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>130766</td><td>Readiness Center</td><td>http://nodal.ercot.com/readiness/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(134180,"Market Notices","http://nodal.ercot.com/readiness/notices/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>134180</td><td>Market Notices</td><td>http://nodal.ercot.com/readiness/notices/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(134181,"Registration and Qualification","http://nodal.ercot.com/readiness/rq/index.html","",3,2,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>134181</td><td>Registration and Qualification</td><td>http://nodal.ercot.com/readiness/rq/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144052,"Registration and Qualification Activities","http://nodal.ercot.com/readiness/rq/activities/index.html","",4,6,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144052</td><td>Registration and Qualification Activities</td><td>http://nodal.ercot.com/readiness/rq/activities/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144293,"Nodal Reg & Qual Activities for CRRs","http://nodal.ercot.com/readiness/rq/activities/crr/index.html","",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144293</td><td>Nodal Reg & Qual Activities for CRRs</td><td>http://nodal.ercot.com/readiness/rq/activities/crr/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144358,"Nodal Reg & Qual Activities for QSEs with Resources","http://nodal.ercot.com/readiness/rq/activities/qr/index.html","",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144358</td><td>Nodal Reg & Qual Activities for QSEs with Resources</td><td>http://nodal.ercot.com/readiness/rq/activities/qr/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144320,"Nodal Reg & Qual Activities for ERCOT","http://nodal.ercot.com/readiness/rq/activities/e/index.html","",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144320</td><td>Nodal Reg & Qual Activities for ERCOT</td><td>http://nodal.ercot.com/readiness/rq/activities/e/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144335,"Nodal Reg & Qual Activities for QSEs without Resources","http://nodal.ercot.com/readiness/rq/activities/q/index.html","Nodal Reg & Qual Activities for QSEs without Resources",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144335</td><td>Nodal Reg & Qual Activities for QSEs without Resources</td><td>http://nodal.ercot.com/readiness/rq/activities/q/index.html</td><td>Nodal Reg & Qual Activities for QSEs without Resources</td></tr>");

		nodeList[i++] = new Node(144379,"Nodal Reg & Qual Activities for TSP/DSP","http://nodal.ercot.com/readiness/rq/activities/td/index.html","",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144379</td><td>Nodal Reg & Qual Activities for TSP/DSP</td><td>http://nodal.ercot.com/readiness/rq/activities/td/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(144364,"Nodal Reg & Qual Activities for Resource Entities","http://nodal.ercot.com/readiness/rq/activities/re/index.html","",5,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>144364</td><td>Nodal Reg & Qual Activities for Resource Entities</td><td>http://nodal.ercot.com/readiness/rq/activities/re/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(143387,"Registration and Qualification Documents","http://nodal.ercot.com/readiness/rq/documents/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>143387</td><td>Registration and Qualification Documents</td><td>http://nodal.ercot.com/readiness/rq/documents/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(134182,"Web Services Support","http://nodal.ercot.com/readiness/sandbox/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>134182</td><td>Web Services Support</td><td>http://nodal.ercot.com/readiness/sandbox/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247272,"Outreach","http://nodal.ercot.com/readiness/outreach/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247272</td><td>Outreach</td><td>http://nodal.ercot.com/readiness/outreach/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247052,"Market Trials","http://nodal.ercot.com/readiness/markettrials/index.html","",3,9,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247052</td><td>Market Trials</td><td>http://nodal.ercot.com/readiness/markettrials/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247571,"Market Trials 2.1 Connectivity Testing","http://nodal.ercot.com/readiness/markettrials/connectivity/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247571</td><td>Market Trials 2.1 Connectivity Testing</td><td>http://nodal.ercot.com/readiness/markettrials/connectivity/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(246965,"Real-Time Market/LFC","http://nodal.ercot.com/readiness/markettrials/rtm/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>246965</td><td>Real-Time Market/LFC</td><td>http://nodal.ercot.com/readiness/markettrials/rtm/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(246979,"Congestion Revenue Rights","http://nodal.ercot.com/readiness/markettrials/crr/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>246979</td><td>Congestion Revenue Rights</td><td>http://nodal.ercot.com/readiness/markettrials/crr/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(246999,"Outage Scheduler","http://nodal.ercot.com/readiness/markettrials/os/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>246999</td><td>Outage Scheduler</td><td>http://nodal.ercot.com/readiness/markettrials/os/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(246985,"DAM/RUC","http://nodal.ercot.com/readiness/markettrials/dam/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>246985</td><td>DAM/RUC</td><td>http://nodal.ercot.com/readiness/markettrials/dam/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247005,"COMS/Settlements","http://nodal.ercot.com/readiness/markettrials/coms/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247005</td><td>COMS/Settlements</td><td>http://nodal.ercot.com/readiness/markettrials/coms/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(258053,"Market Information System","http://nodal.ercot.com/readiness/markettrials/mis/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>258053</td><td>Market Information System</td><td>http://nodal.ercot.com/readiness/markettrials/mis/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247238,"ERCOT Readiness","http://nodal.ercot.com/readiness/markettrials/ereadiness/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247238</td><td>ERCOT Readiness</td><td>http://nodal.ercot.com/readiness/markettrials/ereadiness/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247246,"MP Readiness","http://nodal.ercot.com/readiness/markettrials/mpreadiness/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247246</td><td>MP Readiness</td><td>http://nodal.ercot.com/readiness/markettrials/mpreadiness/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247269,"Readiness Scorecard","http://nodal.ercot.com/readiness/scorecard/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247269</td><td>Readiness Scorecard</td><td>http://nodal.ercot.com/readiness/scorecard/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(180989,"Nodal Go-Live","http://nodal.ercot.com/readiness/golive/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>180989</td><td>Nodal Go-Live</td><td>http://nodal.ercot.com/readiness/golive/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(168796,"Nodal Reports","http://nodal.ercot.com/readiness/reports/index.html","",3,5,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>168796</td><td>Nodal Reports</td><td>http://nodal.ercot.com/readiness/reports/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(173963,"Reports","http://nodal.ercot.com/readiness/reports/r/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>173963</td><td>Reports</td><td>http://nodal.ercot.com/readiness/reports/r/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(173962,"Extracts and DDLs","http://nodal.ercot.com/readiness/reports/DDL/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>173962</td><td>Extracts and DDLs</td><td>http://nodal.ercot.com/readiness/reports/DDL/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(173965,"Statements and Invoices","http://nodal.ercot.com/readiness/reports/si/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>173965</td><td>Statements and Invoices</td><td>http://nodal.ercot.com/readiness/reports/si/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(173969,"Report and Extract Specifications","http://nodal.ercot.com/readiness/reports/sp/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>173969</td><td>Report and Extract Specifications</td><td>http://nodal.ercot.com/readiness/reports/sp/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(182968,"XSDs","http://nodal.ercot.com/readiness/reports/XSD/index.html","",4,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>182968</td><td>XSDs</td><td>http://nodal.ercot.com/readiness/reports/XSD/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(247268,"Readiness Contacts","http://nodal.ercot.com/readiness/contacts/index.html","",3,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>247268</td><td>Readiness Contacts</td><td>http://nodal.ercot.com/readiness/contacts/index.html</td><td></td></tr>");

		nodeList[i++] = new Node(75494,"Contact Us","http://nodal.ercot.com/contacts/index.html","",2,0,0);
//		document.write("<tr><td>" + (i-1) + "</td><td>75494</td><td>Contact Us</td><td>http://nodal.ercot.com/contacts/index.html</td><td></td></tr>");

//		document.write("</table>");
//		document.write("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\">");
		for(x = 0; x < nodeList.length; x++) {
			if (nodeList[x].level > 1) setParentNode(x);
//			document.write("<tr><td>" + x + "</td><td>" + nodeList[x].id + "</td><td>" + nodeList[x].name + "</td><td>" + nodeList[x].level + "</td><td>" + nodeList[x].children + "</td><td>" + nodeList[x].parent + "</td></tr>");
			}
		map_loaded = true;
//		document.write("</table>");
		}
	}

function highlightTopNav(id) {
	var currentNode = getNodeById(id);
//	document.write("<h4>" + id + "</h4>");
	if (currentNode != null) {
		while (currentNode.level > 2) { currentNode = getNodeById(currentNode.parent); }
		var objTopNavSelItem = document.getElementById("s" + currentNode.id);
		if (objTopNavSelItem != null) {
			objTopNavSelItem.id = "active";
			objTopNavSelItem.firstChild.id = "current";
			}
		}
	}

function buildSiteNav(id) {
	initSiteNav();
	var currentNode = getNodeById(id);
	if (currentNode != null) {
		/*	for sections not listed within left-nav,
			find the parent that is listed within the left-nav */
		while (currentNode.level > 4) {
			currentNode = getNodeById(currentNode.parent);
			id = currentNode.id;
			}
		var parentId = currentNode.parent;
		var topId = parentId;
		var shtml = "";
		var ihtml = "";
		shtml += "<div id=\"navcontainer\"><ul id=\"navlist\">";
		if (currentNode.level >= 2) {
			if (currentNode.level <= 2) topId = id;
			if (currentNode.level >= 4) topId = getNodeById(parentId).parent;
			highlightTopNav(topId);
			// outer loop through siblings
			for (x = 0; x < nodeList.length; x++) {
				if (nodeList[x].parent == topId) {
					if ((nodeList[x].id == id) || (nodeList[x].id == parentId)) { 
						var childSelected = false;
						// inner loop through children
						for (y = x + 1; y < nodeList.length; y++) {
							if (nodeList[y].parent == nodeList[x].id) {
								if (nodeList[y].id == id) {
									ihtml += "<li id=\"subactive\"><a href=\"" + nodeList[y].url + "\" title=\"" + nodeList[y].hvrtxt + "\" id=\"subcurrent\">" + nodeList[y].name + "</a></li>";
									childSelected = true;
									}
								else {
									ihtml += "<li><a href=\"" + nodeList[y].url + "\" title=\"" + nodeList[y].hvrtxt + "\">" + nodeList[y].name + "</a></li>";
									}
								}
							}
						// determine whether child is selected or not
						if (childSelected)
							shtml += "<li id=\"active\"><a href=\"" + nodeList[x].url + "\" title=\"" + nodeList[x].hvrtxt + "\" id=\"selchild\">" + nodeList[x].name + "</a>";
						else
							shtml += "<li id=\"active\"><a href=\"" + nodeList[x].url + "\" title=\"" + nodeList[x].hvrtxt + "\" id=\"current\">" + nodeList[x].name + "</a>"; 
						if (ihtml != "")
							shtml += "<ul id=\"subnavlist\">" + ihtml + "</ul>";
						shtml += "</li>";
						}
					else {
						shtml += "<li><a href=\"" + nodeList[x].url + "\" title=\"" + nodeList[x].hvrtxt + "\">" + nodeList[x].name + "</a></li>";
						}
					}
				}
			}
		shtml += "</ul></div>"
		return shtml;
		}
	return "";
	}
