<script type="text/javascript">
function addSidenote(){
var myTextArea = document.getElementById("commentBox");
myTextArea.value = myTextArea.value + '[dohtml]<span class="sidenote" title="Text"></span>[/dohtml]';
}
</script>
<textarea id="commentBox"/>
<input type="button" onclick="addSidenote();" value="Add a Sidenote"/>
That code will create a new textarea for the benefit of demonstration. You'll want to link it to your existing textarea. Looking at the source of the page in your link; this is your textarea:
<TD><b>Quick Comment:</b></TD></tr><tr><TD><textarea cols="40"rows="5" scrollbars="yes" name="field1"
value="" ></textarea></TD>
You'll want to add an id attribute to that text area; something like this:
<TD><b>Quick Comment:</b></TD></tr><tr><TD><textarea cols="40"rows="5" scrollbars="yes" name="field1"
value="" [B]id="commentBox"[/B] ></textarea></TD>
Now if you remove the textarea from my example; and put the code on your page somewhere, the code will relate to your comment box; and should work ok.