Early this week, two men brimming with a confidence that belies their unresolved fate will walk into a century-old state office building and head to their respective suites, carved out for the next attorney general of Virginia.

One will take the elevator to the sixth floor, get off near the women's bathroom and enter the door with a plastic sign taped to it identifying the room as the "Transition Office of the Honorable Robert F. McDonnell." The space set aside for McDonnell, a Republican delegate from Virginia Beach, has windows overlooking a church.

The other will go to the second floor, turn down a winding hallway with flaking yellow paint and two signs with arrows pointing to the "Transition Office of the Honorable R. Creigh Deeds." The office for Deeds, a Democratic state senator from Bath County, has no windows but is marginally bigger.

Each had hoped to be the undisputed winner by now. But almost two weeks after the Nov. 8 election, the vote count continues even as both actively prepare to assume office in January.

Out of 1,943,155 votes cast on Election Day, McDonnell leads by 345 votes and has claimed victory. However, the spread has shrunk almost daily as county and city registrars across Virginia check and re-check their tallies in preparation for a state certification of the vote Nov. 28.

For only the second time in Virginia history, a December recount is a near certainty. Each candidate has assembled two teams, one to plan the transition and one to ride herd on the vote count.

With the outcome in limbo, Gov. Mark R. Warner (D) assigned both men office space in the same building across from the Capitol.

Their representatives ceremoniously carried boxes of files and personal effects into the offices last week. After spreading out photos and plaques on dented and battered state desks and bookcases, they could not resist asking reporters for comparisons.

"I'm told we have 34 more square feet," said John Daniel, Deeds's transition director. "That, like the vote, is close."

Janet Polarek, McDonnell's transition director, retorted, "I'll take windows any day over 34 square feet."

Triumphs in windows and square footage aside, each camp is monitoring every turn in the vote count with knots in their stomachs.

"This is the dream of a candidate who ends election night behind, because it's so, so close," said Larry Framme, who is heading the recount effort for Deeds. "It's a nightmare for the candidate who ends election night ahead because it's so, so close. It's within a margin that can easily be changed in a recount."

Both sides said the delay in declaring an absolute winner will not have an adverse effect on the next state attorney general. Both men are proceeding as if they had won and are getting on with their business.

Daniel said the preparations both men are making to take office are a reassuring sign. "It bodes well for Virginia," he said. "It means our office holders take these jobs very seriously. They want to be prepared to go forward and do the best job for the office for which they're elected. Bob McDonnell is doing what he needs to do, and Creigh Deeds is doing the same."

The vote tally has been a moving target since the election, often changing several times a day.

On election night, Deeds went to bed about 1,400 votes ahead. By morning, McDonnell was ahead by nearly 2,000. Now, his lead has fallen to the hairsbreadth that it is.

The margin has dwindled as registrars across the state have double-checked, their initial unofficial counts. In one jurisdiction, election workers copying down the totals had transposed the numbers. In another, they had not counted provisional or absentee ballots.

"It's typical human error, what happens to people who have been working for 14, 15 or 16 hours," said Jean Jensen, secretary of the State Board of Elections.

When the count is certified, the loser can ask for a recount as long as the margin is less than 1 percent, which appears certain.

The two camps are not waiting to get the results from the election board.

McDonnell has a staff working in what they call a "war room" in a luxury high rise office building in Richmond. Nine or 10 people gather daily in a silk-paneled, windowless conference room at a law firm where they call registrars around the state, write down the vote totals and coordinate volunteers to observe a recount.

McDonnell -- whose friends have started calling him "Landslide" -- said he could not explain why the margin keeps receding, or why it usually seems to go in Deeds's favor.

But McDonnell said he does not expect more change in the results, or the outcome. He noted that in the only other statewide recount in Virginia history, in 1989, only 113 votes were changed. That was far short of the 7,000-vote margin Democrat L. Douglas Wilder held over Republican J. Marshall Coleman.

"I certainly would have preferred it not be a cliffhanger," McDonnell said of this election. "But I'm confident I will be victorious and able to be inaugurated into office on Jan. 14."

He has coped with the stress by getting away from politics. He traveled to North Carolina a week ago to watch his sons play in a soccer tournament and went to the mountains for a weekend with his wife. He also said laughter was a tonic.

In that vein, his war room staff has composed a song to the tune of Fleetwood Mac's "Landslide":

Oh, I've been waiting for this thing to be over cuz I put my life on hold.

When you see the results after this count is over, the landslide'll bring Creigh down.

The Deeds recount effort is being coordinated from his campaign headquarters, in a spartan second-floor office four miles from downtown Richmond. The vote margin is scribbled in blue on a chalkboard leaning against a trash can. Photographs and cartoons are tacked to the drywall. College-age volunteers make calls to registrars.

Deeds has maintained that the election is too close to declare a victor.

"That guy has got to do what he thinks he needs to do," he said of McDonnell at a news conference last week after Warner allotted both candidates the office space. "Perhaps it makes him feel better. Tell him not to waste any money on paint."

Deeds has been spending his time in Bath tending to his animals on his farm and relaxing with his family. Mark Bergman, his spokesman, said Deeds is spending more time on the phone with his transition staff making plans to govern than he is keeping up with the margin.

As Deeds's staff accepted a key to the transition office, in a suite formerly used by the Division of Engineering and Buildings, Daniel expressed confidence in the outcome.

"We believe he is doing nothing more than preparing for the opportunity to serve the people as the next attorney general," he said. "It's a very close contest. Win, lose or draw, it is our obligation to the people of the commonwealth to be prepared to serve."

Whatever the certified results, Framme called a recount a "dead certainty."

"At this point, the recount isn't so much about the candidates," he said. "It's about who the people elected, and accurately counting the votes cast by the people."

A recount would be held over one or two days in December and would be observed by representatives of both candidates. The results would be reported to a three-judge panel in Richmond.

By law, the state must pick up the recount costs if the margin stays this close. The 1989 gubernatorial recount cost $69,000, and this recount is expected to top $100,000, said Jensen, who said she does not expect to take a planned vacation next month to Jamaica.

"It's been more intense than the election," she said. "It's been interesting to be part of history."

Robert F. McDonnell's lead has shrunk since Nov. 9. R. Creigh Deeds, ahead on election night, now trails by 345 votes.