function initMenuFromWddx(WddxPacket) {

  // Deserialize WDDX Packet into WddxRecordset object
  var rsTree = new WddxRecordset;
  rsTree.readFromPacket(WddxPacket);

  // Array to remember position of each item we add to tree
  var Slots = new Array;

  // For each row in the recordset, add an item to the tree.
  // A 'parent' ID of -1 indicates a new item off the tree "root"
  // Otherwise, the 'parent' ID indicates the parent of the item
  for (i = 0; i < rsTree.getRowCount(); i++) {
  
    thisItemID = rsTree.getField(i, 'itemid');
    thisParent = rsTree.getField(i, 'parent');
    thisType   = rsTree.getField(i, 'type');
    thisLabel  = rsTree.getField(i, 'label');
    thisHelp   = rsTree.getField(i, 'helptext');
    thisURL    = rsTree.getField(i, 'url');

    if (thisParent == -1) 
      Slots[thisItemID] = theMenu.addEntry(-1, thisType, thisLabel, "", thisHelp);
    else
      Slots[thisItemID] = theMenu.addChild(Slots[thisParent], thisType, thisLabel, thisURL, thisHelp);
  
  }
}

