From a July 2008 Foreign Policy Magazine web exclusive interview with Karim Sadjadpour is an associate at the Carnegie Endowment for International Peace:
FP: What do Iranians think about the U.S. presidential election and John McCain versus Barack Obama?
KS: There's far more intrigue about Obama than about McCain. Apart from the fact that he advocates dialogue with Iran, he's African-American and his middle name is Hussein, who is the paramount figure in Shiite history and culture. If Obama were to win, it would be much more difficult for Iran to constantly paint the United States as this grand oppressor. It's interesting to note that a few days after the hostages were taken at the U.S. Embassy in Tehran, the Iranians released all the women and blacks because they said these groups were historically oppressed by Americans.
An Obama victory in November could tremendously change the dynamics in U.S.-Iran relations. If you're a hard-liner in Tehran and you survive in isolation, like Ayatollah Khamenei, it presents far more of a quandary for you to have a president in Washington who says "Let's be friends" than one who says "Let's be enemies" and essentially continue the status quo. I would wager the vast majority of Iran's political elite, who do want to see some sort of reconciliation, support Obama. But then you have a small, but powerful minority who survive in isolation, much like Fidel Castro in Cuba. They see Iran opening up to the world as a threat to their interests, and I'm sure they would much prefer John McCain to be president.