Thanks for the link to the example, but that example only shows adding a tab dynamically, while the mini tab tools are static on the page. I am also creating the div that holds the mini tab tools dynamically.
However, I did finally get it working. Hopefully my code can help someone else.
Note: This code not only creates the tab and its mini tab tools dynamically, but it also adds a hidden unique id to the tab title, to get around the problem of using the tab title to identify tabs, when titles might not be unique in themselves.tabTitle = tabName + "<strong>" + tabID + "<\/strong>"; //append a unique id to the title inside a strong tag, so that tab titles are unique. the css hides the <strong>.
tabContent = "mypage.asp?id=" + tabID;
tabIcon = "icon-reps-profile";
tabClose = true;
var tabTools = "tab-tools-" + tabTitle.replace(/[^\w]/g, '').replace(/strong/g, ''); //create the unique id for the mini tab tools by removing everything from the tab title that is not a letter, number, or underscore
var tabToolsDiv = "<div id='" + tabTools + "'><a href='javascript:void(0);' class='icon-mini-popup' onclick='javascript:popTab(\"" + tabTitle + "\");'><\/a><\/div>"; //create the div for the mini tab tools (a popup icon that calls the script to pop up this tab in a new window)
$('#main-tab-tools').append(tabToolsDiv); //add the mini tab tools div to the page
tabTools = "#" + tabTools;//specify the id of the mini tab tools
$('#main-tab-bar').tabs('add',{ //add the new tab
title: tabTitle, //unique tab title
href: tabContent, //url to load via ajax
cache: true, //cache the content so the tab doesn't reload it every time this tab is selected
iconCls: tabIcon, //tab icon
closable: tabClose, //whether to show the close button on the tab
tools: tabTools, //which div holds its mini tools (popup icon)
selected: true //whether this tab should be selected after it is added
});//end add the new tab