Updated javascript codes.