function executeDebug(pName) {
  doHttpRequest('plain.php?umi=admin_enhancements&page=debug.dyn', 'ixmleditor_showDebug', pName, 'data=' + encodeURIComponent(formByName('details').elements[pName].value));
}

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

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

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

function doConfirmActionExtData(pAction, pMsg, pId) {
  loadPageConfirm(pMsg, '&action=' + pAction + '&id=' + pId + '&tab=3');
}

function doConfirmActionRemoveAccessKey(pMsg, pIndex, pSubIndex) {
  loadPageConfirm(pMsg, '&page=details_service&action=removeaccesskey&index=' + pIndex + '&subindex=' + pSubIndex);
}

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

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

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

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

function doIndexConfirmActionExtData(pAction, pMsg) {
  doConfirmActionExtData(pAction, pMsg, getOptSelValue(formByName('index').elements['id']));
}

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

function doPopupActionAddAccessKey(pIndex, pSubIndex) {
  goOpener('index.php?umi=admin_enhancements&page=details_service&action=addaccesskey&index=' + pIndex + '&subindex=' + pSubIndex);
  window.close();
}

function getDynEntity() {
  var Form = formByName('details').elements;
  selUpperCase(Form['entity']);
  var S = Form['entity'].value;
  if (S != '')
    doHttpRequest('plain.php?umi=admin_enhancements&page=entity.dyn', 'showDynEntity', '', 'name=' + encodeURIComponent(S));
}

function hideDynEntity() {
  window.setTimeout("displayElemById('dyn_entity', 'none');", 300);
}

function popupAddAccessKey(pIndex) {
  popupWindow('plain.php?umi=admin_enhancements&page=addaccesskey.pop&index=' + pIndex, 300, 420);
}

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

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

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

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

function popupPreview(pIndex) {
  popupWindow('plain.php?umi=admin_enhancements&page=preview.pop&index=' + pIndex, 420, 660);
}

function selServiceEvent(pObj) {
  if (pObj.selectedIndex == 1) {
    displayElemById('entity', 'none');
    fadeElemById('schedule', 'inline');
    fadeElemById('interval', 'inline');
  } else if (pObj.selectedIndex > 2) {
    displayElemById('schedule', 'none');
    displayElemById('interval', 'none');
    fadeElemById('entity', 'inline');
  } else {
    displayElemById('entity', 'none');
    displayElemById('schedule', 'none');
    displayElemById('interval', 'none');
  }
}

function setDynEntity(pName) {
  var Form = formByName('details').elements;
  Form['entity'].value = pName;
}

function showDynEntity(pValue, pParam) {
  setHTML(pValue, 'dyn_entity');
  fadeElemById('dyn_entity', pValue == '' ? 'none' : 'block');
}