How about something like this:
$('#example').tabs({
select: function(event, ui) {
var $tabs = $('#example').tabs();
var selected = $tabs.tabs('option', 'selected');
switch(selected){
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
}
});
There might be a prettier solution, but that should technically do what you need.
EDIT: , . , - :
$("#tabID").click(function(){
do something here...;
});