How to add a button that enables the user to insert a link in a textarea located in the front-end?

It’s a JavaScript editor just like the one used in a new/edit post/page editor
only here the editor is:

WMD-Editor (i think)

and WordPress uses an editor named: TinyMCE

In both cases it’s a matter of attaching the editor to a textarea. you can use Dean’s FCKEditor For WordPress which uses the powerful WYSIWYG CKeditor
and integrates it into the comments textarea.

Update
i just saw this http://c.hadcoleman.com/wordpress-plugins/wmd-editor-wordpress-plugin/ which is just what you need.