Egypt's future in the balance
Days before the final round of Egypt's presidential election this weekend, legal challenges could still upset the whole delicate transition to democracy.
Two crucial rulings are expected from Egypt's Supreme Constitutional Court on Thursday.
One will decide whether Ahmed Shafiq, one of the two candidates in this weekend's run-off election, is eligible to stand.
The other ruling will decide whether parliamentary elections held last year were unconstitutional.
One strong possibility is that the court will simply postpone its decision.
But, if the court rules against the candidacy of Ahmed Shafiq, or against the validity of the parliamentary elections, Egypt could be thrown into new turmoil - the planned handover to civilian rule by the end of this month would again be in doubt.
Concerning Ahmed Shafiq, the court has been asked to rule on a law passed by parliament, banning senior officials from former President Hosni Mubarak's regime from standing for office.
The law was passed hastily by parliament, aimed mainly at blocking the former intelligence chief Omar Suleiman from standing.
He was eventually disqualified for another reason - he just missed securing enough nomination signatures.
In the meantime, Ahmed Shafiq, a former prime minister, was caught in the net.
So far Ahmed Shafiq has been disqualified by the electoral commission, then restored provisionally to the ballot on appeal.
According to leaks published in the Egyptian press, a legal panel has recommended that Ahmed Shafiq should be allowed to stand, but the court is not bound by that advice.
Hassan Nafaa, professor of political science at Cairo University, says that court has two issues to decide on.
Firstly, did the presidential election commission have the right to refer the issue to the court in the first place?
If it did not have that authority, then Ahmed Shafiq is automatically disqualified.
If the commission was right to refer the issue to the court, it must then decide whether the original law was constitutional or not - most experts believe the court will rule it was unconstitutional, which would leave Ahmed Shafiq in the race.
One other point to note - the head of the Constitutional Court, Farouk Sultan, also happens to be the head of the Electoral Commission.
Though other members of the two bodies are different.
If Ahmed Shafiq were disqualified it is not clear what the implications will be.
A spokesman for the electoral commission said that either the other candidate in the run-off, Mohamed Morsi of the Muslim Brotherhood, would be allowed to stand on his own, or the whole election would have to be re-run. Egypt is none the wiser!
The other ruling concerns the parliamentary elections held last year, in which the Islamists secured more than two-thirds of the seats in parliament.
The procedure has been challenged, because some of the seats were contested on a proportional list system, others on a "first-past-the-post" system.
In this case, leaks from the legal panel indicate that it will rule the procedure unconstitutional.
That could mean the parliamentary elections would have to be re-run, in whole or in part.
In turn, that would most likely be bad news for the Islamists.
The Muslim Brotherhood did particularly well because of the way the election was organised.
And there is a feeling that the Islamists have lost popularity in the last year because of the perceived poor performance of parliament.
However, it is not clear who would have the authority to dissolve parliamentary and re-run the elections.
The parliamentary speaker, Saad al-Katatni, of the Muslim Brotherhood, has pointed out that none of this is specified in the constitutional declaration under which Egypt is currently governed.
Hassan Nafaa believes that if the elections are ruled unconstitutional, it would effectively "freeze" the work of parliament, preventing it from passing any new laws until new elections.
The legal challenges are part of what many observers see as a legal and constitutional muddle afflicting Egypt.
Stopping the clock
Already, three leading candidates have been disqualified from running for president, some of them because of time served in prison, effectively as political prisoners under Hosni Mubarak.
The process of writing a constitution has been glacially slow. Nearly a year-and-a-half after the ousting of Hosni Mubarak, arguments are continuing over who should be on a constitutional commission tasked with drafting the new document.
The Nobel Peace Prize winner, Mohamed ElBaradei, has repeated his suggestion that the first priority should be to draft a new constitution.
He has proposed that any president elected before then should rule for just one year.
Parliamentary elections should also be held again, under the new constitution, he has urged.
For Egyptian liberals, including many of those who led the revolution last year, these court cases represent a last hope.
They want to be saved from what they see as an impossible dilemma, the choice between a candidate from the old regime and an Islamist.
Many other Egyptians want, above all, for the country to return to normality.
But, after the dramatic change of last year's revolution, setting the clock back is no longer an option.