Well I could not understand any of the JS of the swampimage function but here is the code to me where it looks like the insert happens. The code in the red is it actually getting the value of the field where it inserts into the variable.
elmImage.src = txtFileName.value;
if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }
else { elmImage.hspace = 0; }
if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }
else { elmImage.vspace = 0; }
elmImage.alt = txtAltText.value;
if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }
else { elmImage.border = 0; }
elmImage.align = selAlignment.value;
grngMaster.collapse(false);
grngMaster.select();
window.close();