Use rails functions to generate JavaScript
Fix an error where the "Email to friends" link scrolls to the top of the page