function loadDialog(dialogId) { $('#dialog_'+dialogId).dialog('open'); ajaxAction('Browser_Dialog', 'ajaxLoadDialog', dialogId, 'loadDialogResponse'); } var loadedDialogs = []; function loadDialogResponse(response) { var dialogId = response['dialogId']; loadedDialogs[dialogId] = true; // add the html getElement('dialog_'+dialogId).innerHTML = response['html']; // initialize buttons initializeButtonStyle(); // enable buttons if (response['buttons'] != '') { var buttons = ',buttons:{'+response['buttons']+'}'; } else { var buttons = ''; } // execute javascript if (response['script'] != '') { globalEval(response['script']); } var exec = "$('#dialog_"+dialogId+"').dialog({position:{my:'top',at:'top'}"+buttons+"});"; globalEval(exec); }