need help with adding tabs programatically

need help with adding tabs programatically

Hi,
 
I'm trying to replicate, using the JQuery UI, the design pattern where a list of objects are displayed in a left pane, and clicking an object causes a tab to be created in a right pane, showing content related to the object clicked.    My problem is that I can't figure out how to associate a tab with the object clicked, so that if the object is clicked a second time, the tab is simply selected as opposed to being created twice.    I can't use the tabTemplate option, since only href and label are passed in.
 
Can someone offer a suggestion?
 
Thanks very much,
 
Stan McFarland