From the New York Times :
according to a study by Ball State University, nearly nine in 10 jobs that disappeared since 2000 were lost to automation in the decades-long march to an information-driven economy, not to workers in other countries.
Study link: http://conexus.cberdata.org/files/MfgReality.pdf
the link is by a conservative group, but it says that 88% of the job loss since 2000 is due to productivity gains, not foreign competition. Foreign factors account for only 12% of the loss.