ialog').click(function(){
    last.dialog('open');
  });
  // click to invoke method
  $("#config-method button").click(function(){
    var command = $(this).text();
    var dialog = $(".ui-dialog:last").find(".ui-dialog-content");
    if ( $(dialog).length ) {
      if ( command == 'state' ) {
        alert( $(dialog).dialogExtend(command) );
      } else {
        $(dialog).dialogExtend(command);
      }
    }
  });

});
</script>
</body>
</html>