Reverted to old JavaScript as had trouble with slideshow