These woulkd be simpler using closer variables below
function optOnIconMouseDownListener (e) { // outlineIcons.src.icon_opton  needed?
    var target = thisOutline.targetOf(e)
    var p = target.parentNode
    termWidget.replaceIcon(p.parentNode,
      outlineIcons.termWidgets.optOn,
      outlineIcons.termWidgets.optOff, optOffIconMouseDownListener)
    p.parentNode.parentNode.removeAttribute('optional')
  }