JavaScript motion detection.