Moving javascript into index.