I think the media played a role in boosting coverage of Ahmadinejad's opponents, which made it look like Moussavi would win. Journalists have now been banned from further coverage in Iran.
The Center for Public Opinion, a nonprofit institute that researches attitudes toward extremism, and the New America Foundation conducted a poll in Iran May 11-20, interviewing 1,001 people. They found Ahmadinejad with a large lead over his rivals.
They defended their work today in an op-ed piece in The Washington Post. You can read it here. Read the rest at the Miami Herald