(AP) Voters line up at the Downtown West location in Knoxville, Tenn., to cast their early voting ballot...Full Image

MIAMI (AP) - Legions of lawyers are ready to enter the fray in case Election Day turns on a legal challenge. One nightmare scenario would be for the results in a battleground state like Florida or Ohio to be too close to call, with thousands of absentee or provisional ballots yet to be counted.

The key, experts say, is whether the difference in votes between the two candidates is within what's known as the "margin of litigation" - that is, the number of outstanding votes must be much greater than the margin separating Obama and Romney when the smoke clears. And, it must be in a state that's decisive.

"You'd have to have a state whose Electoral College votes are absolutely pivotal or there would have to be a massive problem involving voters," said Richard Hasen, law professor at the University of California, Irvine, and founding editor of the Election Law Journal. "There not only have to be problems in an election. They have to be widespread enough or the margin close enough that litigating would actually make a difference."

Legal and campaign officials on both sides say lawyers are poised at both the national level and in the key states to respond immediately if a court challenge is needed. The political parties have gained a lot of experience in legal fights over U.S. Senate and House seats. The last major legal battle over the presidency was the 2000 race, settled by the U.S. Supreme Court favoring George W. Bush over Al Gore.

On the Republican side, Washington attorney Benjamin Ginsberg leads the team. Ginsberg was deeply involved in the 2000 court fight as national counsel to the Bush campaign. Ginsberg is assisted by Kathryn Biber, the Romney campaign's general counsel, and Lee Rudofsky, who is the campaign's Election Day operations director.

Calling the shots for the Democrats is Robert Bauer, another well-known Washington lawyer, who is a former Obama White House counsel and Democratic National Committee attorney. Bauer oversees hundreds of lawyers who have volunteered to set up shop in "boiler room" operations in battleground states and across the country.

Both sides will have local attorneys on the team as well.

The Obama campaign also has built up a computerized system to track Election Day incidents in real time. Democratic poll monitors and operatives can call in incidents as they occur and the computer-based system will quickly give campaign officials in Chicago the ability to track and compare the reports and respond quickly.

"No one's going to be flat-footed here, or for that matter anyplace else," said Stephen Hunter Johnson, general counsel to the Miami-Dade County Democratic Party. "Whatever the challenges are, we're up and ready."

Lawyers will observe at targeted polling places, joined by tea party activists and voting abuse critics on the Republican side and civil rights and union groups on the Democratic side. And in crucial battleground states such as Ohio, Florida, Wisconsin and Virginia, Republicans have added legal and political muscle from governors, secretaries of state and GOP-dominated legislatures.

Some legal skirmishes have already begun. Bauer, for instance, wrote this week to Wisconsin's secretary of state raising questions about reports that some Romney poll watchers were being trained with information that could mislead or intimidate voters. State officials said they did not find evidence of egregious transgressions, but the issue could resurface in a potential postelection legal fight.

Election law experts say it's most likely that litigation over the presidency would come down to Florida or Ohio and probably involve either absentee ballots or provisional votes, meaning those that must be verified later by local election officials for a variety of reasons, such as a voter showing up at the wrong precinct, not having proper identification or having their eligibility to vote called into question by a poll watcher.

Edward Foley, director of the election law program at Ohio State University, came up with a hypothetical scenario in which Romney leads Ohio by 10,000 votes the day after the election - but there are 150,000 outstanding provisional ballots that must be examined. Ohio law gives voters 10 days, until Nov. 17, to provide officials with any information needed to show they are eligible to vote.

Under this scenario, if Obama were trailing, Foley said the president's legal team would try to "rescue" as many provisional ballots as possible and likely would head to court to obtain lists of voters' names they could contact. A similar fight took place in Washington state in a 2004 Senate race, he noted.

"It would not surprise me if there emerged a legal tussle over the availability of this information," Foley wrote in a recent article on the scenario.

That would mean Americans might not know the identity of their next president until well into November.

The provisional votes also could come up in Florida, the other big battleground state. University of Florida political science professor Daniel Smith noted than in the August primary about 22 percent of all provisional ballots were rejected by local canvassing boards. That too could become a source of court battles over the validity of such rejections, if the initial outcome in Florida is close enough.

"There's no question we're going to have a boatload of provisional ballots as well as overseas ballots that are not going to be tabulated until after Nov. 6," Smith said.

Sometimes evidence of election problems doesn't lead to litigation, even though it could. In 2004, Democratic nominee John Kerry initially refused to concede because of issues with provisional ballots and other problems in Ohio. But the day after the election, when Bush's lead in the state swelled to about 100,000 votes, it was clear a court fight wouldn't matter and the Democratic lawyers backed off.

It's all about the margin, said Johnson of the Miami-Dade Democrats, who said:

"Litigation can be expected unless there's a clear outcome on Election Day."