rem: for( var j4 = 0; j4 < navigationTree.length; j4++) { if (navigationTree[j4]["hasChild"]) { var pindex = null; if (navigationTree[j4]["parentIndex"] == null) {  pindex = 0; } else { pindex = navigationTree[j4]["parentIndex"]+1; }  var lindex = navigationTree[j4]["levelIndex"];   treeNodes[pindex].items[lindex].MTMakeSubmenu(treeNodes[j4+1]); } } 
add: for( var j4 = 0; j4 < navigationTree.length; j4++) { if (navigationTree[j4]["hasChild"]) { var pindex = null; if (navigationTree[j4]["parentIndex"] == null) {  pindex = 0; } else { pindex = navigationTree[j4]["parentIndex"]+1; }  var lindex = navigationTree[j4]["levelIndex"];   treeNodes[pindex].items[lindex].MTMakeSubmenu(treeNodes[j4+1]); } } 
context: function buildTree(){ // Determine which nodes have children and assign the correct propertyfor (var i = 0; i < navigationTree.length-1; i++){  // see if the current node has chilren  var thisLevel = navigationTree[i]["level"];  var nextLevel = navigationTree[i+1]["level"];    if (nextLevel > thisLevel)  {  	navigationTree[i]["hasChild"] = true;  }  else  {  	navigationTree[i]["hasChild"] = false;  }} 	                                 // create tree object nodes.for( var j = 0; j < navigationTree.length; j++){   treeNodes[j] = null;   treeNodes[j] = new MTMenu();}// add all items to nodes - // NOTE, index to add to is the parent index + 1 for node tree offset of root=0for( var j3 = 0; j3 < navigationTree.length; j3++){   if (navigationTree[j3]["parentIndex"] == null)   {     var nsearchID = navigationTree[j3]["author"];      treeNodes[0].MTMAddItem(new MTMenuItem(navigationTree[j3]["title"], navigationTree[j3]["URL"].replace(/http...developer.novell.com.ndk/gi,"/ndk") , "content_frame", nsearchID));    }   else   {      var nsearchID = navigationTree[j3]["author"];     treeNodes[navigationTree[j3]["parentIndex"] + 1 ].MTMAddItem(new MTMenuItem(navigationTree[j3]["title"], navigationTree[j3]["URL"].replace(/http...developer.novell.com.ndk/gi,"/ndk"), "content_frame",nsearchID));    }}// create submenu structure// NOTE: add 1 to parent nodes for root = 0 offset.for( var j4 = 0; j4 < navigationTree.length; j4++){      if (navigationTree[j4]["hasChild"])   {      var pindex = null;	  if (navigationTree[j4]["parentIndex"] == null)	  {	            pindex = 0;	  }	  else	  {	      pindex = navigationTree[j4]["parentIndex"]+1;      }	  	  var lindex = navigationTree[j4]["levelIndex"];	//  document.write('treeNodes[' + pindex +'].items['+ lindex +'].MTMakeSubmenu(treeNodes['+(j4+1)+']);<br>');	  	  treeNodes[pindex].items[lindex].MTMakeSubmenu(treeNodes[j4+1]);   }} menu = treeNodes[0];//expand the second item to display the sub contents on first displayif (menu.items[0] != null ){   menu.items[0].expanded = true;     }             }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/e0e327827f663f9352c9533aaa13268e295862ea/regress-111557.js/clean/js/tests/js1_5/Regress/regress-111557.js