By Fiona Ortiz

MADRID (Reuters) - The tortuous procedures of the Spanish court system and a weak political opposition mean corruption allegations are unlikely to force Prime Minister Mariano Rajoy from office.

Uproar in the media and some street protests have helped raise doubts among investors on the government's future, pushing its borrowing costs back up at a time when its priority has been to save money and pay off debts to stave off insolvency.

But while renewed economic difficulties may add to Rajoy's problems, a reluctance in opponents to probe funding practices common to all parties, doubt that payments however dubious were formally illegal, and the chronic backlog in Spain's courts, all mean the prime minister has little to fear from the prosecutors.

Rajoy, 57, has flatly denied doing anything wrong.

And a member of parliament for his Popular Party summed up a sanguine mood in the PP, voicing confidence delays would stifle the problem: "Beyond all the political noise, I don't think this will cause instability for the government or the party," he said. "It's an issue that won't have any quick conclusion."

Investment analyst Alastair Newton at Nomura in London also saw little urgent threat to government stability. "Furthermore," he wrote in a research note on Tuesday, "If Spanish prosecutors were to decide that there is a case to answer, it is likely to take some years to prove, or otherwise, any wrongdoing."

Fernando Jimenez a political scientist and corruption expert at the University of Murcia, noted dozens of corruption cases involving all major parties had been dragging through the courts for years: "Everyone knows there are very few convictions in corruption cases, so you get this sense of impunity," he said.

Last month, a 14-year investigation into whether a Catalan party siphoned off EU funds ended in a plea bargain and a fine.

Though official statistics are not available on how many corruption cases are open or the conviction rates, severe delays are a source of frustration for Jesus Lizcano of global anti-graft campaign group Transparency International: "The courts ... are overwhelmed with cases and don't have the resources they need," he said. "Slow justice is less justice."

PRIME MINISTER'S DENIAL

Rajoy, who has seen austerity policies drive his approval rating down to just 19 percent after 13 months in office, gave an initial response to last week's media allegations by flatly denying any wrongdoing. He also welcomed an investigation of the finances of his conservative People's Party and promised to post his own tax returns on a government website.

Spanish media accuse the party of running a slush fund to channel millions of euros in cash from construction firms to its leaders during the building boom that preceded the crash which plunged Spain into a debt crisis and recession five years ago.

Among key issues is whether alleged payments, supposedly recorded in handwritten accounts whose authenticity the party disputes, were illegal, if party officials paid tax on them.

And while critics wonder whether businesses won favors in return, a public perception that all parties did the same - and notably the Socialists who were in government during much of the building boom - may limit the specific damage to the PP.

Experts on corruption say dozens of cases are under way against figures from major parties - the PP, Socialists and the Convergence and Union (CiU) political alliance in Catalonia.

Some are interlinked. All have taken time.

The celebrated Gurtel case, involving alleged kickbacks from companies to PP mayors, has bounced for four years from court to court without a trial. Among its key figures is Luis Barcenas, a former PP treasurer whose purported secret ledgers were last week the basis of new allegations of payments to Rajoy. Barcenas called the documents published by El Pais newspaper fakes.

PROCEDURAL COMPLEXITY

Complexity of procedure is blamed by some for delay; a probe into alleged graft involving Carlos Fabra, a senior PP figure in Valencia, has passed through nine judges in eight years.

Like many European countries, Spain's law is based on the French civil code developed under Napoleon in which examining magistrates conduct inquiries into whether to bring charges. But these officials often move on. Successors need time to digest a mass of written case notes. And that process can repeat itself.

A further twist is that different courts handle cases against serving state officials and politicians who are not in office, meaning elections can force a change of magistrate.

Unsurprisingly, a poll last week by Metroscopia found that 96 percent of Spaniards believe corruption goes unpunished.

In a survey by Transparency International, Spaniards rated political parties as their nation's most corrupt institutions, grading them 4.4 on a scale where 5.0 was utterly rotten. The same survey showed three in four thought anti-graft efforts ineffective and a similar number felt corruption was increasing.

Payments by building firms to officials in return for state contracts and construction permits were seen as widespread in the boom years, and certainly not confined to one party.

"All the other parties did the same thing," said Jose Ignacio Torreblanca, head of the Madrid office of the European Council on Foreign Relations (ECFR). "No one can cast the first stone, because they all financed themselves like this."

Although the Socialist opposition has called for Rajoy to step down, they have not gone so far as to call for an early election. A vote right now would be damaging for both main parties, with polls crediting neither with more than 25 percent.

Small groups of protesters have demonstrated at the PP's offices, calling for Rajoy to resign. And the premium Spain pays on government bonds over German benchmarks in the euro zone rose to its highest level this year on Monday.

But with nearly three years until an election must be held, Rajoy still commands an absolute PP majority in parliament, blocking any threat of a confidence motion. And there are no signs of internal party revolt against the prime minister.

Although the state prosecutor has begun an investigation of PP accounts, party officials appear to believe the evidence so far, in the shape of purported handwritten ledgers, is weak.

Torreblanca at ECFR said party leaders took the view that, even if there were a trial within the time limit, the evidence would not stand up. "The PP has looked at the documents," he said, "And come to a legal analysis that they are safe - the notes won't survive a trial and the statute of limitations."

(Editing by Alastair Macdonald)