The front-page headlines in The Chicago Sun-Times that day were hardly complimentary, but inside the downtown hotel Cardinal John Patrick Cody was among friends.

The embattled 73-year-old prelate beamed happily as a baritone singer serenaded him to the tune of "Let Me Call You Sweetheart." A procession of waiters stepped into the room with lighted candles on birthday cakes in a joint celebration of the 50th anniversary of the Chicago Archdiocesan Council of Catholic Women and of Cody's 50th year in the priesthood.

In his red ceremonial robes and matching skull cap, Cody chose the occasion to denounce the allegations that have been building up against him for more than a year, despite the efforts of his archdiocesan newspaper, his publicists and his lawyers to squelch them in advance.

In fact, the published reports that Cody might have diverted up to $1 million in church funds to enrich a lifelong friend and cousin by marriage appear to be only the tip of a mystery that stretches from here to the Vatican and back.

Its murky twists and turns include what some might call stonewalling by the cardinal, who seems to be asserting a sort of churchman's privilege in response to government subpoenas.

There is also talk of a campaign hatched in Rome several years ago to force his ouster. Its most Byzantine twist came to light with the recent disclosure of the secret plans and musings of the Rev. Andrew M. Greeley, a syndicated columnist, sociologist, author and for years an outspoken critic of the cardinal.

In transcripts of tape recordings and other documents obtained by the Chicago Lawyer, a small monthly legal publication, Greeley tells of plans to unseat the cardinal, replace him with Cincinnati Archbishop Joseph Bernardin, and, through Bernardin, "rig" the next papal election in the College of Cardinals in behalf of a liberal.

Much of the mystery, at the moment, revolves around the question of who, if anyone, in the church or in the media is telling the truth about the cardinal, his financial dealings and the origin of the investigations swirling about them.

Cody, an Irish immigrant's son, has chosen to equate the attacks on him as attacks on the church, part of an anti-Catholic inquisition into matters beyond the reach of civil law. The criticisms, he contends, have been fueled by those dissatisfied with his "conservative" approach to running the 2.4-million-member archdiocese, the nation's largest.

That dissatisfaction, by most accounts, is deeply felt, and Catholic to the core. The discontent is said to have been summed up by a prominent Chicago layman who told a liberal church audience in 1979 that the archdiocese was being run like a monarchy, that it wanted "only our support, not our spirit; only our cash, not our ideas."

By contrast, Cody told the luncheon gathering at the Conrad Hilton Hotel: "Ultimately any accusation against the shepherd is an accusation against the church . . . . "

But all this begs the question of whether there is anything to the specific allegations against Cody. They have been under investigation by the U.S. attorney's office here since the fall of 1980, but evidently the cardinal and his lawyers have not yet produced the banking and financial records demanded of them in grand jury subpoenas last January.

The cardinal's attorneys say they believe they "have complied with the law," but they refuse to elaborate. Knowledgeable sources say that all that the lawyers have done is provide written assurances, perhaps affidavits, claiming that the funds in question are completely discretionary and within Cody's power to disburse as he sees fit.

Former deputy attorney general Charles B. Renfrew said one of the cardinal's lawyers, Judge Harold (Ace) Tyler of New York, took the position last winter "that they wanted us to trust them" and to take their word for it that Cody alone controlled the accounts.

"I said, 'Ace, we trust everybody, but we also want the documents,' " Renfrew recalled in a telephone interview. "I would like signature cards and documents that show me where the money comes from," he said.

Perhaps the most startling strand in the complex Cody case is that of the Greeley tapes, excerpts of which were published in recent weeks by the Chicago Lawyer. Greeley reportedly made the tapes for the late James F. Andrews, chairman of the Universal Press Syndicate, which distributes Greeley's column.

According to the transcripts, Greeley decided several years ago to "get rid of Cody" by exposing him "to the worst kind of public scandal."

The iconoclastic priest, who compiled the tapes as a sort of daily diary, expected that Bernardin would be named as Cody's successor and could go on from there to see that the College of Cardinals would choose a liberal in the next papal election.

"He Bernardin is the only one in the American hierarchy now who can get rid of Cody," Greeley told his tape recorder after an October, 1977, lunch in Rome with the bishop from Cincinnati. "He has to be the one to do it, and he assumes there are enough people around in Rome who have enough confidence in him that he will not be thought of as seeking personal promotion for himself. It's a very sticky business, though."

Greeley was by then planning a Teddy-White-style book about "The Making of the Pope," whenever that next happened, and he said he found Bernardin extraordinarily helpful with all sorts of information on that score, too.

"I'm not sure why he's telling it to me, except I guess he values me as an ally in the fight against Cody," the Lawyer article quoted Greeley as saying.

The ecclestiastical machinations at the bottom of all this have yet to be appreciated. But Greeley wrote several years ago, in his book on papal politics, that powerful church officials, including the Vatican's undersecretary of state and the Italian cardinal in charge of the Vatican office that appoints most of the bishops in the world, had decided by the fall of 1975 "to attempt to remove Cardinal Cody" because of complaints emanating from the United States.

Bernardin, who is reputed to be one of the most influential Catholic churchmen in the world, was at the time president of the National Conference of Catholic Bishops.

In the fall of 1975, however, Greeley has said he knew nothing about anti-Cody maneuvering in Rome. He was there concentrating on his book about papal politics. And as he thought about it, he decided the next election was up for grabs.

" . . . The only people in the world who are busy organizing for it are the same people who are always busy organizing for it: the conservatives, the reactionaries, the kooks," Greeley told his tape recorder after a Nov. 23, 1975, dinner in Rome with Swiss theologian Hans Kung.

"The liberals go about their business not doing anything," the Chicago priest continued. "So Kung and I kind of decided that it would be a shame to let this happen and that, in the immortal words of Richard J. Daley, 'We godda organize da voters.'

"We decided that if anyone was going to rig the next papal election, it just might as well be us."

On Oct. 30, 1977, according to the transcripts obtained by Chicago Lawyer editor Rob Warden, Greeley orchestrated an explicit plan.

" . . . L et me suggest that one of the points that is important for a conspiracy is getting Joe Bernardin into the College of Cardinals," he said at one point.

"Now, gentlepersons, you say, 'How the hell can we get Joe Bernardin into the College of Cardinals?'

"I will tell you how we get him in. We get him to become archbishop of Chicago . . . . We get rid of John Patrick Cody. And how do we do that? We do an expose soon.

"We turn an investigative reporter loose on the archdiocese of Chicago, a really good one, mind you, maybe some son-of-a-bitch from out of town, and tell him to blow the Chicago thing wide open . . . . How's that for a clever idea, co-conspirators? . . . Also, investigating Chicago, fellows, will make a superb part of the movie rights."

Pope Paul VI died in early August, 1978, too soon for any "conspiracy" to rig the next conclave. The pope's demise, Greeley was quoted as saying on an Aug. 7, 1978, tape, "couldn't come at a worse time. The whole thing just isn't off the ground."

Greeley's book, a White-type treatment called "The Making of the Popes 1978," was published in 1979 by a Universal Press Syndicate subsidiary. In it, he devoted several pages to what he called a dossier of charges that Vatican officials had compiled against Cody.

Some of the specifics were startling. Under a heading of "financial maladministration," Greeley said there were "allegations that $60 million of parish funds are on deposit at the Chicago chancery, and no accounting has been made either to the diocese or to Rome as to the investment of these funds."

The ubiquitous Chicago-based priest dedicated his book to his confidential sources, particularly one he nicknamed "Deep Purple." The Chicago Lawyer reported that, according to the documents it obtained, "Deep Purple" was Archbishop Bernardin.

In a statement issued even before the Chicago Lawyer hit the newsstands with its October edition, Bernardin dismissed the talk of "a supposed conspiracy in Chicago" as a pipe dream. So did Greeley, in another preemptive statement he issued a day earlier.

In his statement, Bernardin said: "Father Andrew Greeley has described as fantasies accounts of a supposed conspiracy in Chicago. Such accounts are fantasies, and there is no truth to them."

Traveling in Europe on a long-planned sabbatical, Greeley said through his lawyer here that he regarded the materials as stolen property, retained without authorization by a young journalist who had had approved access to Greeley's archives at Rosary College last year.

In any case, the mercurial priest, a sociologist who is not assigned to normal parish duties, maintained that his old diaries merely described "the moods, feelings, fantasies and emotions of the moment--the things I would like to have seen happen in my late-night sleepy musing in a hotel in Rome . . . .

"It is absurd to say that I orchestrated the present problems of the cardinal," Greeley added. "Even if I had done so, it would have been neither criminal nor immoral." In short, as he told one reporter by phone from Greece, "I didn't do it, but I wish I had."

Despite the disavowals, Greeley seems to have sowed some of the seeds. One knowledgeable source told The Washington Post that Andrews of the Universal Press Syndicate had suggested an investigation of Cody to an executive of the Gannett newspaper chain.

The executive in question, John Quinn, has publicly denied any such contact, but nonetheless, one of Gannett's top reporters, Carlton Sherwood, whose 1979 investigation of the Pauline Fathers in Pennsylvania was about to win a Pulitzer Prize, began digging into Cody's activities in March of 1980.

Sherwood started out, it was learned, by interviewing Father Greeley.

The next month, the Sun-Times jumped into the fray with a full-dress investigation. Sun-Times executives have been insisting that their inquiry had been going on "for months before we knew about the Gannett investigation" but former Sun-Times managing editor Stuart Loory has a different recollection.

"Roy Larson The Sun-Times religion editor came to us in April of 1980 with the first indication that this story might exist," Loory says. "What he said was the Gannett people were sniffing around on a major story about archdiocesan finances. We put him to work then with Sun-Times investigative reporters William Clements and Gene Mustain."

Greeley, meanwhile, was working on a novel, "The Cardinal Sins," a spicy account of sex and power plays within the Catholic church here.

The Gannett reporters were apparently concentrating on other angles, but "The Cardinal Sins," published in May of 1981 and now prominently displayed in most Chicago bookstores, contains striking parallels to the news stories the Sun-Times began printing Sept. 10.

Part of the plot concerns a Chicago archbishop named Daniel O'Neil, a cleric mired in financial mismanagement and scandal including "bad investments" and "bribes to Rome" not to mention "the woman."

"Her name is Margaret Johnson," says an excerpt on page 187. "They've been together for 25 years. She's been in every diocese where he's been. Claims to be a cousin but there's no real blood relationship. He owns a real-estate business with her son. She's got an apartment over on the drive...."

The Sun-Times disclosures have all revolved around Cody's stepcousin, Helen Dolan Wilson, a lifelong friend whose father married Cody's aunt when Helen Dolan was five. Divorced in 1939, she moved to Chicago in 1969 following her retirement from a job Cody once helped her get in the St. Louis archdiocese.

The Sun-Times disclosed the existence of the federal grand jury investigation on Sept. 10 and said the aim of the probe was to determine whether the Cardinal had "illegally diverted as much as $1 million in tax-exempt church funds to enrich" Wilson.

Sidebars dealt with Cody's asserted financing of a $100,000 luxury home for her in Florida in 1970 and his "traveling alone to Florida" after the home was completed.

"They are scandalizing me," Wilson, 74, protested tearfully in an interview with the Chicago Tribune on Sept. 12. "They make me seem like a tramp."

She insisted her net worth was only about $250,000, far from the $1 million the Sun-Times had calculated. She said the only cash she got from Cody, aside from a $21,000 loan for the Florida home, consisted of holiday gifts that never amounted to more than "several hundred dollars" at a time. But what upset her most of all, she said, was that she felt she had been portrayed as "a kept woman." She said she and Cody had always had a "brother-sister" relationship.

The Chicago Catholic, the archdiocesan weekly of which Cody is publisher, began an extraordinary campaign against the Sun-Times and its inquiries in the summer of 1980, apparently shortly after the Sun-Times had first learned of Wilson.

"The Chicago Sun-Times is not a proper agency to conduct an inquiry into the internal government of the Catholic Church," the "official newspaper of the archdiocese" thundered in a July 11, 1980, editorial. "We don't think the Sun-Times and its editors are proper judges of an archbishop, the successor to the Apostles, whose authority did not come from a board of election commissioners."

The cardinal's headaches were multiplied that fall with the inception of the federal tax investigation by then-U.S. Attorney Thomas P. Sullivan, a strong-minded prosecutor who did not believe in asking Washington for permission to pursue alleged violations of federal law.

As a consequence Justice Department higher-ups in Washington first learned of the probe last winter from the cardinal's lawyers, most notably Judge Tyler, who had been a deputy attorney general in the Ford administration.

"I think he Tyler had been enlisted because he'd had my job," says Renfrew, who apparently took much of the heat. Renfrew moved swiftly to limit the inquiry, to keep it from embarking on any elaborate tracing of bank checks such as Sullivan's office had apparently decided to undertake.

"I checked into it," Renfrew recalls after discovering that the case had not been put on the Justice Department's "watch list" of sensitive investigations. "I told the people involved that this was a very delicate matter, that this was a Prince of the Church we were dealing with."

Sources close to Cody, meanwhile, keep assuring reporters privately that the bank accounts in question deal with "sensitive church matters" ranging from the rehabilitation of alcoholic priests to missions "behind the Iron Curtain."

But Renfrew says he decided that at the very least the government should first determine whether the bank accounts in question were as the cardinal's lawyers claimed, completely discretionary. According to Renfrew, his caution was heightened by a feeling that the government might be delving into internal church squabbling that was none of the government's business.

Despite all the rhetoric from the cardinal and his advisers, it is still far from clear that an attack on Cody is an attack on the church. It may be, as Greeley claimed in "The Making of the Popes," that several popes in succession have wanted the cardinal to resign. Cody has denounced the charge as "a dirty lie." But did Greeley simply make it up? Who told him? And why?

There are those who think that powerful forces in the Vatican were using Greeley--and not the other way around--confiding in him, making him feel he was part of the action, trying to keep him from galloping off on his own. The Vatican does not like its investigations to rise to the level of "public scandal."

In the face of the current controversy, Cody has said publicly that he would "assist in every way" to clear up the "doubts" that have been raised about him. But he has yet to come up with the point-by-point rebuttal that archdiocesan officials have promised. It seems clear they are hoping they can yet turn the whole affair into a long dissertation on the sins of the press for the Columbia Journalism Review.