To me it looks like the top function runs a “contextMenu” script to interact with a textarea inside of a reply (#reply textarea). I don’t know exactly what that script does, but it looks like you can set which mouse button to click to open the menu (left in this case) to reply. It adds two custom functions:
* “twitter” which allows you to view someone’s twitter profile
* “reply” which just adds the person’s @name at the cursor in the textarea.
The second part of the script `insertAtCursor` does just that. It finds the cursor location in the textarea with special treatment for IE and Opera and inserts a text string.
The way i read it is,
locates a text area used for sending tweet stores it in var,
$.contextMenu (non standard jquery function not in the api, third party plugin prolly) builds a popup menu when left mouse is used on a an element, with two options View Profile and Reply it then pulls the data required from the attributes of the element clicked.
View Profile just opens the twitter profile
Reply moves to an anchor down the page and inserts and selects the twitter username into a textarea to be used for the reply tweet (done by insertAtCursor)