Thailand flooding leaves hundreds dead, threatens capital