Jquery UI callback

Jquery UI callback

I am simply trying to do a callback after my accordion has been created AND initialized.I have two tabs that get created. In each tab is an accordion that gets created. However  my work can only be done on the accordions once the tabs and accordions are done initializing. I am getting a race condition where I am trying to change elements that are not initialized yet. Below I tried to add the "change" event to teh accordion, as I saw this elsewhere on the forum. But its not doing anything. So I assume thats outdated. I also tried teh few methods for accordion such as create, but they all trigger before things are initialized. How do I know when things are initialized? I really dont want to resort to timers.


$("#OuterTab").tabs({heightStyle:"content"});
$('#InnerTab1').load('SystemSettings.html',function () {
$("#Systemaccordion").accordion({header:"h3",heightStyle:"content" ,change:SystemUILoaded});
$("button").button();
//SystemUILoaded();
});
$('#InnerTab2').load('emailSetup.html',function () {
$("#Mailaccordion").accordion({header:"h3",heightStyle:"content"});
$("button").button();
$("#msg1").spinner();
$("#msg2").spinner();
$("#msg3").spinner();
$("#msg4").spinner();
$("#msg5").spinner();
$("#msg6").spinner();
$("#msg7").spinner();
$("#msg8").spinner();
$("#msg9").spinner();
$("#msg10").spinner();
MessTrigUILoaded();
});
Initdone=true;