IN A recent television advertisement placed by Iraq's electoral commission, which says it expects voters to start registering for January's hoped-for general election in a month or so, a cosy family of four cheerfully discusses the coming poll. All citizens, they decide, should vote: a nation is stronger when everyone joins in to build it. Opinion polls taken last month suggested that 88% of Iraqis planned to vote, against only 8% who did not.

But will they be able to? Most Iraqis say it is hard to imagine going to a polling station if car-bombs still go off regularly in the heart of Baghdad, a trip to the corner shop carries a risk of being caught in crossfire, and insurgent sympathisers are free to threaten those who want to vote with a bullet in the head.

Iyad Allawi, prime minister of the interim government, who still promises to lead Iraq to a credible election, says the rebels will be contained and the no-go zones where people will be unable to vote freely will be eradicated. If such bad spots as Fallujah, to the west of Baghdad, can be sealed off if not subdued, the rest of the country will be peaceful enough to witness a fair ballot.

But there is still no sign of the government forces, spearheaded by 140,000 American troops and 22,000 from allied countries, getting on top of the insurgents, whose estimated numbers range from 20,000, according to one American general, to twice that figure. Every day the government troops sweep the bastions of Islamist and Baathist fervour around Haifa Street, a main road in Baghdad in easy mortar range of the “green zone” where the government is seated. No sooner do the American and Iraqi troops disappear than armed guerrillas re-emerge, to badger and hector passers-by.

The kidnapping of foreigners, a practice that began in earnest only in April, shows no sign of abating. Since then, at least 137 have been nabbed, of whom 28 have been killed, 29 are still being held, and 60 have been freed or escaped, says the Brookings Institution in Washington, DC; the status of the rest is unknown. In the past week a group led by a Jordanian Islamist fanatic with proclaimed links to al-Qaeda, Abu Musab al-Zarqawi, has beheaded two American civil contractors and has threatened to do the same to a Briton. The trio were grabbed in Baghdad's Mansour suburb, previously considered pretty secure.

Mr Allawi and the Americans stress that most of Iraq is more or less safe. Of 18 provinces, 11 are said to be calm. The three Kurdish provinces in the north-east have been quiet. A state-funded newspaper, al-Sabah, reports that 75 out of Iraq's 86 biggest towns are at least “semi-stable”. Most of the unstable 11 are in the Sunni triangle mainly north and west of Baghdad.

At present, the rebels control Fallujah outright. In nearby Ramadi, American patrols enter in the morning and let the insurgents take over the streets in the afternoon. In Samarra, police and local officials keep order under a deal recently brokered with tribal sheikhs, but rebels still periodically ambush American patrols. Sadr City, Baghdad's north-eastern Shia slumland, is often off-limits. But even outside the Sunni triangle conditions vary widely from town to town; the insurgency ebbs and flows. Basra, a haven of relative stability a year ago, is now less secure.

One snag, for Mr Allawi and the Americans, is that no one knows exactly who the Sunni insurgents are. Apart from a desire to throw foreigners out of Iraq, they vary in their aims and ideology, and are loosely organised. Most of their leaders are known only in their home towns or districts.

Though foreigners are thought responsible for most of the suicide-bombs that periodically cause mayhem (some 83 have gone off since the fall of Saddam Hussein, at a rate that may be slightly going down), they do not dominate the insurgency. Of 5,500 suspected rebels in prison, only 130-140 are foreigners. It is unlikely that Mr Zarqawi masterminds a national network; some intelligence sources reckon he has around 200 active disciples. But he is a symbol of defiance for a range of zealots across the country and beyond.

Even in Fallujah, several competing groups sit on a “council of mujahideen”. Some associate themselves with the Muslim Scholars' Board, a group of conservative Sunni theologians who endorse attacks on American troops but are against random street bombs and have helped free hostages. But in nearby Khaldiya, members of the “Daham network”, named after a local preacher, denounce Fallujah's scholars' board as atheistic collaborators. Even if Mr Allawi wanted to negotiate, it would be hard to seek out interlocutors.

The insurgency could spread further if the present shaky truce with Muqtada al-Sadr, a turbulent Shia cleric with strong support especially in Sadr City, breaks down. Whether or not with Mr Sadr's connivance, his Mahdi Army has failed to hand over its weapons, as the government demanded. When disarmament negotiations recently broke down, American and Iraqi troops arrested several Sadrist clerics whom they accused of hoarding guns and rocket-launchers, then marched into the movement's base in Sadr City to restore order. After two weeks of relative calm, renewed fighting left at least 20 dead. There are fears that Mr Sadr's rank-and-file might lose patience with its leader's new-found restraint—and that the hitherto cohesive Sadrist movement might disintegrate into dozens of smaller groups. That would make negotiation far harder too.

Refusing to lose heart

Mr Allawi's people insist they can reverse the trend towards insecurity. Iraqi officials say their forces are being steadily built up, with more recruits and better training and weaponry. Soon, they say, they will be able to tighten border controls to keep out foreign fighters; then they will tackle the insurgents' strongholds, even Fallujah and Sadr City.

A week ago, senior American soldiers were suggesting that voting might be cancelled in towns like Fallujah. Now, perhaps with Mr Allawi's encouragement, they are talking of retaking the town in December, putting off a showdown until after America's presidential election—and until Iraqi forces have been beefed up.

But the UN, which is supposed to oversee the election, sounds unconvinced. While it has some experienced officials at hand, it still seems to be holding back. An effective international protection force for the UN, whose headquarters and top representatives in Baghdad were blown up last year, has yet to be mustered. The UN's secretary-general, Kofi Annan, recently doubted whether a credible election could be held in present circumstances, suggesting he would continue to keep his staff in Iraq to a minimum until Mr Allawi clearly makes headway against the rebels.

Despite the gloom, Iraqis are still surprisingly optimistic. An opinion poll a few weeks ago found that 47% reckoned life was better than under Mr Hussein, versus 31% who said it was worse; and 58% said democracy was likely to succeed, against 32% who said it would not. But responses varied hugely from area to area: Sunnis were notably gloomier on all scores.

Everywhere, plainly, security is overwhelmingly people's biggest worry. Until it improves, reconstruction will stall—and the hopes of Messrs Allawi and Bush for a decent election, enabling a strong and legitimate government to take over, will continue to look uncertain to be fulfilled.