GREENSBORO, NC — A delusional, two-timing Sen. John Edwards dreamed of a Supreme Court appointment, even as his political career crumbled under the weight of a seedy sex scandal, according to testimony today.

Leo Hindery — Edwards’ economic policy adviser in his failed 2008 White House bid — was one of the government’s final witnesses before prosecutors rested, capping a sensational 14-day narrative of sex, money and deception.

Hindery told jurors that the North Carolina Democrat was ready to surrender after then-candidate Barack Obama won the hotly contested Iowa caucuses.

“He asked me to reach out to the Obama campaign and make clear his availability on the ticket,” said Hindery, managing partner at Intermediary Partners, a private equity firm in New York.

Edwards had been Sen. John Kerry’s running mate in 2004. If not the White House, Edwards’ ultimate goal was to someday reach America’s highest court, according to Hindery.

“We talked about a more elaborate goal of Mr. Edwards, which was to be a Supreme Court justice,” Hindery told the federal panel.

Edwards is on trial for six felony counts for allegedly using political donations to hide his affair and out-of-wedlock baby with campaign groupie Rielle Hunter. He publicly admitted to the affair in late 2008, and then his love child in early 2010.

Before he made that shocking admission, Edwards did everything he could to hide Hunter. Edwards and trusted aide Andrew Young even hatched a wild plan for the confidante to claim he was the baby daddy.

Now Young is the government’s star witness. Hindery recalled a sad 2009 meeting with Young and his wife, when the couple seemed broken by the whole sordid mess.

Hindery described Young as “a sad young man.”

“He was very nervous. Ms. Young would periodically shed some tears,”Hindery said.

“He was worried about employment and how he would pay expenses for his family.”

During cross examination by defense lawyer Abbe Lowell, Hindery said Young was “not especially smart.”