//////////////////////////////////////////////////////////////////////////////// // The Populate() function places dynamically generated menu items inside // our toolbar's search box drop-down menu. Although this sample isn't very // practical, it demonstrates how dynamic menu population works. //////////////////////////////////////////////////////////////////////////////// Populate: function() { // Get the menupopup element that we will be working with var menu = document.getElementById("TutTB-SearchTermsMenu"); // Remove all of the items currently in the popup menu for(var i=menu.childNodes.length - 1; i >= 0; i--) { menu.removeChild(menu.childNodes.item(i)); } // Specify how many items we should add to the menu var numItemsToAdd = 10; for(var i=0; i