I've said this before but I think this JavaScript should be separated into files and just included in _common_includes.gsp