Issue #028: Rearranges JavaScript so that jQuery only runs when appropriate; earlier versions had multiple $(document).ready calls, which could possibly confuse the server.