Wrap index JS in a single $(document).ready()