'New User');
    $('#fm').form('clear');
    url = '/user/add'
  }

  function editUser() {
    var row = $('#dg').datagrid('getSelected');
    if (row) {
      $('#dlg').dialog('open').dialog('center').dialog('setTitle', 'Edit User');
      $('#fm').form('load', row);
      url = '/user/save'
    }
  }

  function saveUser() {
    $('#fm').form('submit', {
      url: url, onSubmit: function () {
        return $(this).form('validate')
      }, success: function (result) {
        var result = eval('(' + re