The language of the internal party memo was stark and brutally honest. Sent out by Republican congressman Tom Davis last week after a stunning congressional by-election loss in the Deep South, it warned colleagues of a potential disaster ahead.

The result, in which the Democratic party won a Mississippi House of Representatives seat that had voted 62 per cent for President Bush in 2004, was a sign of a 'toxic' political environment for Republicans, Davis wrote. He went on to point out the loss was the Republicans' third defeat in a row in special elections - the equivalent of a by-election in Britain - this year alone. Davis's memo dubbed the defeats 'canaries in the coalmine' for the survival of the Republican party.

A Democratic win in such a solidly conservative district capped a week in which Senator Barack Obama finally turned his eyes to the coming November election and his opponent, John McCain. Now many Democrats believe the signs are good that the tide of American public opinion is firmly swinging their way and will deliver them the White House. Certainly, many of the key indicators are giving them strong grounds for optimism.

A recent Quinnipiac University Polling Institute survey showed that a staggering 82 per cent of Americans are unhappy with the direction that the country is heading. At the same time the faltering economy, and especially high petrol prices, are a major concern. 'Overwhelmingly, voters think the economy is in bad shape,' said Maurice Carroll, Quinnipiac's polling director. Obama is now leading McCain in recent national polls by an average of four points.

The results in Mississippi showed Republican voters were willing to vote for a Democratic candidate in areas where the party would normally assume it had no chance. The fight was especially significant as the Republican candidate, Greg Davis, ran a campaign aggressively linking his opponent, Travis Childers, to Obama and the controversy over his former pastor, the Rev Jeremiah Wright. If Obama was looking for reassurance that Wright's outspoken and radical views had not damaged his chances, then Childers's victory provided it.

It also raised the prospect that Obama - buoyed by a massive turnout among black voters - might prove competitive in the South against McCain. Some Democrat insiders think Obama might even win states such as Virginia and North Carolina.

Many Democrats are also starting to hope that Obama is emerging from his long fight with Hillary Clinton as a more battle-tested candidate who has got his major mistakes out of the way early. He has also honed an efficient media machine that responds rapidly to attacks, in stark contrast to the sluggish efforts of the Democratic party's 2004 candidate, John Kerry.

But it would be unfair to say that all Republicans are predicting disaster. Certainly the party's chances in the congressional elections to be held in November look grim. But many experts say that voters look at local issues in such elections and that the terrain of a presidential campaign is very different. 'The Mississippi result bodes well for the Democrats in Congress. It does not mean anything for the national election,' said Professor Cary Covington, a political scientist at the University of Iowa.

Indeed, there is very little in the way of despair in McCain's camp. Privately, McCain aides express high confidence that Obama has many weaknesses that they will be able to exploit. Many of their attacks will likely build on the lines used by Clinton, where she has portrayed Obama as an elitist who is out of touch with many working Americans, especially blue-collar whites in crucial states such as West Virginia, Ohio and Pennsylvania.

The McCain campaign is also now closely studying a dossier of tactics drawn up by Obama's Republican opponent in a Senate election of 2004. That opponent, Jack Ryan, dropped out due to a sex scandal, which ensured the dossier went unused. But now it is being dusted off by McCain staffers. It detailed various votes and statements by Obama that could be used to portray him as being in favour of legalising marijuana, soft on crime and too tolerant of sex offenders.

The dossier's contents and tone seem likely to ensure the coming anti-Obama assault will be dirty. One internet advert attacking Obama's wife, Michelle, is already being circulated by the Tennessee Republican party, featuring a four-minute video based on her remarks that she became proud of her country only after her husband decided to run for President. The video plays Michelle Obama's words six times, interspersed with ordinary Tennesseans explaining why they have always been proud of America.

McCain's campaign team also believes that Obama is going to be vulnerable on a traditional Democratic weakness: national security. Recent statements seeking to link him to Hamas, and Bush's speech in Israel last week on appeasement were seen as the first attempts to paint Obama as weak on terrorism. 'If Obama can convince the American people he can protect them, then he cannot lose. But it is a tough job. And if he can't convince them, then I don't think he can win,' said Covington.

Certainly, national security was a key issue in the Republican victory in 2004, despite the disaster of the Iraq war. McCain, who is hawkish abroad and is a war hero, is likely to again make it the centrepiece of his party's campaign. Covington is also convinced that the economy will not be the key issue in the election, just as it was not in 2004. Instead, Republicans will try to use McCain's public distancing from Bush as a way of nullifying the impact of Iraq. 'McCain's background makes him a formidable opponent and he has been forthright in his criticism of Bush in speeches,' said Covington. 'At this moment, I would have to think McCain is the more likely to win.'

The Battlegrounds

If Barack Obama is to unify his party and make it to the White House in November he will have to improve in three key areas

Race and religion

Obama is attempting to become America's first black President and thus race is one of the thorniest issues in the election. Obama's victory in overwhelmingly white Iowa in January was heralded as a new era of non-racial politics. However, recent contests in Pennsylvania and West Virginia have shown that a significant minority of white voters still consider race as an issue. Nor is it just white voters. The Hispanic electorate - seen as key to whoever wins in November - has a historically complicated relationship with black candidates and will need to be won over. The issue of religion will probably mix with race. The controversy over Obama's former pastor, the Rev Jeremiah Wright, above, highlighted the differences between black and white churches in America. Thus Obama's open and strong Christian faith, usually a huge boon to candidates, will probably be a more complex issue, with some whites fearing the mixture of black pride and conspiracy theory that Wright preached.

White working class

Hillary Clinton's victories in Ohio, Pennsylvania and West Virginia - all three of which are vital states for the Democrats in November - showed that working-class white voters remain sceptical of Obama. Obama has to reach out to them to unite the Democrats and also to stand a chance in November. Without them the Clinton camp's prediction that Obama's alliance of liberals and black Americans will not be enough to win the White House will almost certainly come true.

National security

Weakness on national security has been an ongoing problem for the Democrats in recent decades, despite the catastrophic invasion of Iraq and the continuing violence there. In 2004, when the war was already unpopular, Democrat John Kerry was portrayed as soft and weak on national security, even though he was a decorated Vietnam veteran. Obama, who has served only one term in the Senate, is likely to be seen as an even easier target by Republicans.