When neighbors and city officials started filing lawsuits in an effort to block Foxwoods' casino plans in Philadelphia, they quickly learned that they wouldn't have much success at the state Supreme Court.

What they didn't know: One of the lawyers for Foxwoods, Jeffrey B. Rotwitt, was working with Supreme Court Justice Ronald D. Castille to find a site for a new Family Court building in the city.

Castille, now chief justice, ruled on several key Foxwoods cases in 2007 and 2008 without disclosing his professional relationship with Rotwitt, according to records and interviews. Ethics experts say judges should, at a minimum, announce potential conflicts and give lawyers a chance to object.

"Certainly, I think it should have been disclosed," said Larry D. Silver, an attorney for the Society Hill Civic Association in two 2007 cases in which Rotwitt represented Foxwoods. "I would have liked to have known."

And when one casino opponent tried to find out about the potential conflict by filing an information request with the courts, he was rebuffed with a reply from an administrator that there was no contract with Rotwitt - even though Rotwitt had been working for the court system and Castille for more than a year.

In an interview and a subsequent statement, Castille said that Rotwitt had not been his personal lawyer, and that Rotwitt's client had been the Philadelphia courts, not the Supreme Court.

"The answer is no, there was no conflict," Castille wrote. He said he was just one of seven justices and had written only one opinion that favored Foxwoods. In some other decisions, he sided with opponents of Foxwoods.

Foxwoods subsequently ran into other political and legal problems and is trying to stave off an attempt to cancel its license. Rotwitt and his law firm at the time - Obermayer, Rebmann, Maxwell & Hippel - have not worked for the Foxwoods partnership since 2008.

Although Rotwitt's name repeatedly appeared on legal briefs on behalf of Foxwoods that were sent to the Supreme Court, Castille said he made a point of not paying attention to the names of lawyers in cases.

"I don't want to know who the parties are," he said. "I just want to look at the law."

Rotwitt also has been an occasional golfing partner with Castille, according to both men, but Castille said that was also meaningless: "I play golf with tons of lawyers," he said.

As for the failure to provide records, a spokesman for Castille said there had been no attempt to mislead anyone. Staff simply didn't find the court's letter agreement with Rotwitt because it was in a different office, the spokesman said.

The activist who sought the records said he was "amazed" when The Inquirer reported last month that Rotwitt, in fact, was retained by the courts in February 2006.

"I think the two possibilities are either they lied or they are grossly incompetent. Either one is bad, from my point of view," said Ed Goppelt, an open-government advocate who for many years ran Hallwatch, a website that monitored city government.

Rotwitt's role on both sides of the Family Court project is at the center of an FBI criminal investigation.

Obermayer, his former law firm, received $1.3 million from the courts, payments authorized by Castille. The developer, Donald Pulver of Conshohocken, also paid Rotwitt $500,000 as his codeveloper on the project.

Castille has said he didn't know about Rotwitt's deal with Pulver until The Inquirer reported it, and he has hired a consultant to investigate.

Obermayer subsequently fired Rotwitt, and he and Pulver have been booted from the deal. The state will take over construction of the $200 million courthouse at 15th and Arch Streets.

In 2007, though, Rotwitt was at Castille's side as the justice, who had just taken over the job of supervising city courts, tried to find a spot for a new courthouse, and the money to build it. They attended meetings together with politicians and toured potential locations.

Rotwitt, a veteran real estate lawyer, was retained by former Supreme Court Justice Sandra Schultz Newman starting in late 2005 to scout for a Family Court site.

The courts never drew up a detailed contract for Rotwitt's services. The only document, officials say, is a short February 2006 letter that says Rotwitt had agreed to work without a fee and take his payment at the end of the deal.

After Newman left the court at the end of 2006, Castille took over her responsibilities in supervising Philadelphia courts - and the role of spearheading the Family Court project.

In interviews over the last month, Castille referred repeatedly to Rotwitt as "our lawyer," and said he had relied on his advice in the courthouse deal. Castille signed a letter at the end of 2008 that authorized fees to Rotwitt, Pulver, and others; as a result, the courts have paid out about $12 million.

"He actually did a lot of good work for us," Castille said in a recent interview. "We probably wouldn't have gotten to the point we got to without his efforts."

Throughout 2007, Rotwitt also was a public advocate for Foxwoods as the company battled a rising tide of neighborhood and City Hall opposition. He wrangled with city lawyers, represented Foxwoods at city hearings, and defended the Columbus Boulevard project in interviews with news reporters.

"Talk is cheap, opinions are plentiful, but we're actually betting a half-billion dollars" that Foxwoods would be a community asset, Rotwitt said in April 2007 on Radio Times on WHYY-FM.

Rotwitt also was one of the lawyers representing Foxwoods in cases before Castille and the rest of the Supreme Court. Rotwitt's name appears on about a dozen legal briefs submitted to the court.

Lawyers for Foxwoods and SugarHouse, the two companies that won gaming licenses in Philadelphia, argued a succession of Supreme Court cases in 2007. Pennsylvania's casino law says appeals of casino cases go directly to the state's highest court.

The casino firms won most of the time, though Castille was not always on their side.

In April 2007, the court blocked the city from holding a voter referendum on casinos. Castille joined a dissent. Rotwitt applauded the majority decision, telling reporters that "the court has ruled appropriately."

In September that year, Rotwitt and other Foxwoods attorneys argued that the city was deliberately stalling on its zoning, and asked the court to simply approve the development. The courts turned Foxwoods down, in a decision joined by Castille.

But Foxwoods tried again in December, after SugarHouse won a similar case, and in April 2008 Castille wrote the decision that declared that Foxwoods had the required approvals.

"There is ample evidence that the inaction was a deliberate attempt by Council to simply delay the construction of the casinos," wrote Castille, who became chief justice in January 2008.

In an interview, Castille said Rotwitt had never appeared before him on a Foxwoods matter; the casino cases were usually decided on the briefs alone, he said. He said he hadn't paid attention to the names of lawyers on the pleadings, and considered another Obermayer attorney to be the lead lawyer in the case.

"That's the one that really counts," Castille said.

Several legal ethicists say Castille probably should have recused himself from deciding any cases involving Rotwitt while he was supervising Rotwitt's work for the courts.

"That involves a relationship of trust and confidence," said Monroe H. Freedman, a leading ethics expert and a professor at Hofstra University law school.

"At least as long as that continues, the judge should not be sitting on cases involving that lawyer."

Even if a judge in that situation decides to hear the case, experts said, he or she should disclose in detail the lawyer's legal work for the courts and give lawyers a chance to object.

"Why not put it out there? It really sends a signal that the judge has nothing to hide," said Charles Geyh, an Indiana University law professor.

"You should err on the side of turning your cards up on the table," said Geyh, a leading authority on the subject of recusals. He is also no stranger to the Pennsylvania high court; he served as an assistant counsel to the state House during the 1994 impeachment of Justice Rolf Larsen.

Goppelt knew Rotwitt represented Foxwoods - and said he was surprised when a Philadelphia Daily News column quoted Rotwitt as the Supreme Court's lawyer in the effort to build a new Family Court.

"It was a bit too cozy," Goppelt said.

Seeking evidence of a conflict, he sent an e-mail to the Administrative Office of Pennsylvania Courts, noting that Rotwitt was working for both Foxwoods and the court. He asked for documents about his hiring.

Goppelt also asked for any "analysis of potential conflicts of interests" and "any policy about when a Supreme Court justice is to recuse."

He was told there were no records.

"Please be advised that the court system has no contract with Jeffrey Rottwit [sic] for legal services," the reply said. "It has paid Mr. Rottwit [sic] no fees in connection with the effort to locate a site for a new Family Court building in Philadelphia." The e-mail was signed "Rule 509 Administrator," a reference to the court's public records rule.

In fact, Rotwitt had been working for the courts for 18 months, on the basis of the letter authorized by Newman.

L. Stuart Ditzen, a spokesman for the courts and for Castille, said he hadn't known about that 2006 letter until about a month ago, when The Inquirer asked for records related to Rotwitt and Family Court.

"We weren't trying to play games. We had no idea here, no idea, that there was some letter agreement that existed" in the Philadelphia courts office, said Ditzen, a former Inquirer reporter.

When he got the Goppelt request, Ditzen said, he contacted the courts' legal and finance departments. He said the search had turned up nothing; the letter was instead in the office that supervises Philadelphia courts, he said.

"That was a truthful and accurate response then and now," Ditzen said.

He said the absence of any documents "seemed strange," and he talked to Castille. Ditzen said Castille also hadn't provided any documents, and he doesn't remember what Castille said about Rotwitt at the time.

He said he had expected Goppelt to follow up with another request. When he didn't, Ditzen said, "that was the end of it as far as I was concerned."

Goppelt said he was not impressed by what he said were "excuses" for a failure to provide public records.

"A pretty disappointing performance by the people who are in charge of the rule of law in Pennsylvania," Goppelt said.

"The Supreme Court administers the law. We depend on them to enforce the rules," he said. "When they themselves don't follow their own rules, what can you do?"