wrapPaletteItem(templateNode, currentRow, null);   templateNode = document.createElementNS("http: "splitter"); templateNode.id = "splitter"; templateNode.className = "toolbar-splitter"; 
function buildPalette(){  // Empty the palette first.  var paletteBox = document.getElementById("palette-box");  while (paletteBox.lastChild)    paletteBox.removeChild(paletteBox.lastChild);  var currentRow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                            "hbox");  currentRow.setAttribute("class", "paletteRow");  // Add the toolbar separator item.  var templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                              "toolbarseparator");  templateNode.id = "separator";  wrapPaletteItem(templateNode, currentRow, null);  // Add the toolbar spring item.  templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                              "toolbarspring");  templateNode.id = "spring";  templateNode.flex = 1;  wrapPaletteItem(templateNode, currentRow, null);  // Add the toolbar spacer item.  templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                              "toolbarspacer");  templateNode.id = "spacer";  templateNode.flex = 1;  wrapPaletteItem(templateNode, currentRow, null);  // Add the splitter item.  templateNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                          "splitter");  templateNode.id = "splitter";  templateNode.className = "toolbar-splitter";  wrapPaletteItem(templateNode, currentRow, null);  var rowSlot = 3;  var currentItems = getCurrentItemIds();  templateNode = gToolbox.palette.firstChild;  while (templateNode) {    // Check if the item is already in a toolbar before adding it to the palette.    if (!(templateNode.id in currentItems)) {      var paletteItem = templateNode.cloneNode(true);      if (rowSlot == kRowMax) {        // Append the old row.        paletteBox.appendChild(currentRow);        // Make a new row.        currentRow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",                                              "hbox");        currentRow.setAttribute("class", "paletteRow");        rowSlot = 0;      }      ++rowSlot;      wrapPaletteItem(paletteItem, currentRow, null);    }        templateNode = templateNode.nextSibling;  }  if (currentRow) {     fillRowWithFlex(currentRow);    paletteBox.appendChild(currentRow);  }}
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/337914c765a8ca59d5d46b6d105175fe013e80ef/customizeToolbar.js/buggy/toolkit/content/customizeToolbar.js