[jQuery] Newbie : Tab refresh problems

[jQuery] Newbie : Tab refresh problems


I'm rather new to jQuery...
I'm having problems with refreshing the right tab.
On each tab I have a close and refresh button.
But if I want to refresh a non-selected tab I'm getting the index of
the selected tab.
How can I get the right index from the unselected tab (I prefer
getting the index by the html divID).
Now I run this code onClick:
refreshTab(\$(\'#$tabholder_id\').tabs(\'option\', \'selected\'));
My js function:
function ".$tabholder_id."refreshTab(tabindex){
$('#$tabholder_id').tabs('load', tabindex).data('selected.tabs');
}
Maybe there is a better way to bind this to the tabs itself?