custom ajax in jquery ui-tabs

custom ajax in jquery ui-tabs

I am trying to integrate jquery ui-tabs in the CMS Flatnux, in such a way as to degrade gracefully if javascript is not enabled. This means that I want to leave the flatnux menu-type href's which are all of the type "index.php?mod=nnn", where "nnn" is the name of the section to be loaded. But I don't want that url to be loaded via ajax if javascript is enabled because that will load the whole page (index.php) and not just the center section, creating an infinite loop. I want to ajax load a different url (instead of calling "index.php?mod=nnn", I need to call "/include/ajax/flopt.php", sending the section name as data: { 'mod':'nnn' } ). This will give me a response with the content of that particular section.
So I need to prevent ui-tabs ajax load. The only way I have found to do this, searching around forums, is to "return false" the select event if the href is a url, like this :

var $tabs = $("div#h_menu").tabs({
   select: function(event, ui) {
       var url = $.data(ui.tab, 'load.tabs');
if(url){
return false;
}
       return true;
   }
});

And I suppose I would then have to put in a custom function somewhere with a custom ajax call. Any ideas about where I should put this custom ajax call? And would I then have to manually update the selected tab index?