I suggest:
<table><tr><td align="center" border="0">
<a href="javscript:void(0);" onclick="to_name(\'', $message['member']['name'], '\'); return false;"><img src="', $settings['images_url'], '/author.gif" alt="Author" border="0" /></a>
</td>
<td align="center" border="0">
<img src="', $settings['images_url'], '/quote1.gif" alt="Quote" onclick="quote_selection();" style="cursor: ', $context['browser']['is_ie'] ? 'hand' : 'pointer', '" /></td></tr></table>(cusor: hand is not very browser proof, and also onclick doesn't need the javascript: part.)
You can also add this to index.template.php, but assuming you want it in script.js, I suggest:
function quote_selection()
{
selection = document.getSelection ? document.getSelection() : document.selection.createRange().text;
document.postmodify.message.value += '\n[quote]' + selection + '[/quote]\n';
}
function to_name(char_name)
{
document.postmodify.message.value += '[b][u]2 [color=red]' + char_name + '[/color][/u][/b]: ';
}
In post and quick reply, it is document.postmodify.message... or should be.
-[Unknown]