I've moved that sharebox script down here, it still isn't perfect (would be better to have this in a javascript file in the app/assets/javascripts/ directory) but at least here it will only be included once and is a bit more visible to anyone looking at the layout file.