function doConfirmAction(pAction, pMsg, pIndex) {
  loadPageConfirm(pMsg, '&action=' + pAction + '&index=' + pIndex);
}

function doIndexConfirmAction(pAction, pMsg) {
  doConfirmAction(pAction, pMsg, getOptSelValue(formByName('index').elements['index']));
}

function doConfirmActionDeleteCategory(pMsg) {
  if (formByName('index').elements['index'].selectedIndex > 0 && confirm(pMsg))
    submitAndAction('index', 'delete');
}

function doPopupActionPublish(pMsg, pIndex) {
  if (confirm(pMsg)) {
    goOpener('index.php?umi=org_notes&action=publish&index=' + pIndex + '&owner=' + encodeURIComponent(getSelectSelValue(formByIndex(0).elements['selowner'])));
    window.close();
  }
}

function getDynPreview(pIndex) {
  if (elementById('index_preview').style.display != 'none')
    doHttpRequest('plain.php?umi=org_notes&page=preview.dyn&index=' + pIndex, 'setHTML', 'index_preview', '');
}

function goAssignedUser() {
  var S = getSelectSelValue(formByName('details').elements['assigneduser']);
  if (S != '')
    go('index.php?umi=admin_users&page=details&id=' + S);
}

function popupHistory(pIndex) {
  popupWindow('plain.php?page=history.pop&entity=org_notes_notes&index=' + pIndex, 240, 500);
}

function popupPublish(pIndex) {
  popupWindow('plain.php?umi=org_notes&page=publish.pop&index=' + pIndex, 100, 220);
}

function popupSend(pIndex) {
  popupWindow('plain.php?page=send.pop&destumi=org_notes&index=' + pIndex, 300, 420);
}

function viewInfoBoxUser(pId) {
  if (pId != '')
    viewInfoBox('user' + pId, 'plain.php?umi=admin_users&page=user.info&id=' + pId);
}

function viewInfoBoxUser2() {
  viewInfoBoxUser(getSelectSelValue(formByName('details').elements['assigneduser']));
}