Thailand imposes emergency rule to deal with protests