Obama declares swine flu a national emergency