function ixmleditor_expcolDebug(pName, pFunc) {
  if (elementById('ixmleditord_' + pName).style.display == 'none')
    eval(pFunc + '(pName);');
  else
    ixmleditor_hideDebug(pName);
}

function ixmleditor_hideDebug(pName) {
  displayElemById('ixmleditord_' + pName, 'none');
  displayElemById('ixmleditort_' + pName, 'block');
  with (imageByName('debug'))
    src = src.replace(/debug_g\.png/, 'debug.png');
}

function ixmleditor_showDebug(pDebug, pName) {
  var S = formByName('details').elements[pName].value;
  S = S.replace(/&/g, '&amp;');
  S = S.replace(/<(\/?)([a-z:_][a-z0-9:_\.\-]*)([^>]*)>/gi, function(pText, pEndTag, pTag, pAttr) {
      pAttr = pAttr.replace(/([a-z:_][a-z0-9:_\.\-]*)(\s*=\s*)"([^"]*)"/gi, '<span style="color:maroon;">$1</span>$2&quot;<span style="color:navy;">$3</span>&quot;');
      return '<span style="color:blue;">&lt;' + pEndTag + '<span style="color:green;">' + pTag + '</span>' + pAttr + '&gt;</span>';
    }
  );
  S = S.replace(/<(\?[^>]*\?)>/g, '<b style="color:navy;">&lt;$1&gt;</b>');
  S = S.replace(/<!--([^>]*)-->/g, '<span style="color:blue;">&lt;!--<span style="color:gray;">$1</span>--&gt;</span>');
  S = S.replace(/<!\[CDATA\[([^\]]*)\]\]>/g, '<span style="color:blue;">&lt;![CDATA[</span>$1<span style="color:blue;">]]&gt;</span>');
  S = S.replace(/(%[a-z0-9_]+%?)/gi, '<span style="color:purple;">$1</span>');
  setHTML(S.replace(/\n/g, '<br>').replace(/\s\s/g, '&nbsp; '), 'ixmleditorh_' + pName);
  setHTML(pDebug, 'ixmleditoro_' + pName)
  displayElemById('ixmleditort_' + pName, 'none');
  displayElemById('ixmleditord_' + pName, 'table');
  with (imageByName('debug'))
    src = src.replace(/debug\.png/, 'debug_g.png');
}