Attention. Attention. Reset your political dials. Place your seat backs and tray tables in their upright and locked positions. We are descending into the fog.

You are about to land in a city where Republicans endorse their Democratic arch-nemesis Willie Brown for mayor in a tough runoff against a sometime stand-up comic named Tom Ammiano, who ran a write-in campaign out of a juice bar. If he wins instead of Brown tomorrow, he will become the first openly gay mayor of a major American city.

It is no secret that San Francisco is different. How different?

One week ago, in what its producers described as a broadcast first, a political television advertisement began to air that features a gay couple.

The 30-second spot presents two men comfortably ensconced in their living room.

"I guess we're voting for Tom Ammiano for mayor. He is gay," says Man Number One.

"True. But Willie Brown has been a wonderful mayor for gays," parries Man Number Two.

"But don't we have to vote for one of our own?" asks Man Number One.

"Not if we don't agree with him on the issues," points out Man Number Two. "You know, Tom has some pretty far-out tax proposals."

Far-out, indeed.

It was paid for by the Alice B. Toklas Lesbian and Gay Democratic Club.

There is more here than meets the eye.

It is a cold and rainy night, and Ammiano sits at a dais in the chilly auditorium at Hoover Middle School, wielding a gavel. The 58-year-old Italian American favors gray double-breasted suits. He sports a salt-and-pepper mane of hair and a Romanesque nose. When he opens his mouth, his voice is all New Jersey, where he is originally from. It is not a gravelly Joysey voice, but a musical one. Unlike other politicians making their standard cutting karate gestures, Ammiano's hands bounce, like a conductor leading an orchestra not through Wagner or Beethoven, but perhaps a medley of infectious show tunes.

Much has been made of the time Ammiano has spent onstage as a stand-up comedian, but he is also a substantial San Francisco politician. He is currently president of the city's board of supervisors, after serving in the past on the school board. He is a former teacher and also a father, though in his case, he became one when he anonymously donated sperm to a lesbian couple. He and his grown daughter, Annie, are now close.

This night at Hoover School is classic San Francisco. When Ammiano opens up the meeting for public commentary, more than half of the audience rises and gets into line for their three minutes. The first adult speaker is a woman who rambles on about how various supervisors are cute. The final speaker, after the long line is finally exhausted, testifies about the importance of funding for the arts in the public schools. He is a homeless man wearing a jacket emblazoned with the American flag. He is carrying pompoms.

Through it all, Ammiano is polite but firm, holding the speakers to their time limits. This is the kind of interaction that Ammiano believes the city needs more of. He is not exasperated. He is in his element, mixing it up.

All power to the mom-and-pop stores, and to hell with the "dehumanizing" retail chains! is his battle cry. Enough of the back-room deals he accuses Brown of. Enough of lobbyists, whom he sought to have banned from city hall. Enough of tax breaks for big corporations, like the $3 million that Bloomingdale's got for opening up a downtown store.

At one point, commenting on how cold the auditorium is, he suggests a group hug, and jokes that when this fractious group of supervisors might consider a group hug, "you know we're cold."

Three weeks before the general election in November, Tom Ammiano was not even in this race. But encouraged by a tight circle of supporters, including the editors of the San Francisco Bay Guardian, an alternative weekly newspaper, Ammiano launched a most improbable write-in race for mayor.

Running his campaign out of Josie's Cabaret and Juice Joint in San Francisco's gay Castro District, with about $25,000 in cash, Ammiano defeated two better-funded candidates, former San Francisco mayor Frank Jordan and former political consultant Clint Reilly. That placed Ammiano in tomorrow's runoff with incumbent mayor Willie Brown, who was the longtime speaker of the California Assembly and is one of the most wily, silky smooth professional pols in the Golden State. Brown will spend more than $3 million, in direct funds and soft money, for his reelection attempt.

Few political handicappers gave Ammiano much of a chance. But he surprised them all, garnering some 44,000 votes, and forcing Brown into the runoff. That means he already made electoral history. Nobody here can recall a mayor's race in any large American city where a candidate did so well when voters had to actually write in a name.

His theme? Honesty and integrity. Let's make history. Power to the people.

At a campaign appearance at the Commonwealth Club in downtown San Francisco, Ammiano arrives with his bodyguard (he has gotten death threats, as has Brown) in a cramped compact car stuffed with five adults. Ammiano is well known for his frugality. He takes the bus to work. His salary as president of the San Francisco Board of Supervisors is $23,924 a year. The average salary for city employees is $56,000. Ammiano's 1998 tax returns put his annual income at $37,629, which includes his supervisor's pay, some income for teaching at San Francisco State University and $500 for his stand-up comedy routines--which run toward jokes about gay stereotypes and his Italian upbringing. They have been put on hold recently. He owns a 1990 Toyota and a house he bought for $29,000 in 1974, on which he borrows money. Brown's income in 1998 was $329,000--$140,000 as mayor, and the rest from selling his law firm, real estate holdings and investments. The mayor favors limousines, beautifully tailored suits, snappy fedoras, and vacations in Las Vegas.

At the Commonwealth Club, someone asks Ammiano about his support for the Sisters of Perpetual Indulgence, a street theater troupe of gay men who like to dress up as nuns. Many people in the city are upset that the SPI won support from Ammiano to perform their routines on Easter Sunday at an event in the Castro.

Ammiano does not blink. He tells the audience how he attended parochial schools and today is still a member of the church. "I am a good Catholic," he says. He explains that while people might find the performances of men in nun customes outrageous, he supports their right to perform as an exercise in free speech. "Democracy is not meant to be pretty," he says.

But the San Francisco Chronicle reminded readers that "even some of Ammiano's backers winced" in January when he accepted a tiara, a feathered scepter and was hailed as "Queen of the Realm" when he became president of the board of supervisors. "We're not in Kansas anymore," Ammiano said at his coronation.

Ammiano's gayness is playing out in subtle and not-so-subtle ways during this race. While Willie Brown, who is African American, has said that his being black and Ammiano being gay basically cancel each other out in terms of opportunities for bashing, some Ammiano supporters say they can sniff a whiff of anti-gay rhetoric about their candidate.

"It is not something overt, but there's been code, you know, code language, like when Brown keeps asking Tom, do you have the temperament to be mayor? I mean, what is that about? His temperament?" asks Belina Griswold, his campaign press secretary.

At one of his campaign offices, this one in the heavily Latino Mission District, one of Ammiano's volunteers, Kate Raphael, wearing an "I'm a Tom Girl" button and a pair of roller skates, said she has heard things like "I'm not going to vote for a gay man because all gay men are rich" and "I have nothing against gay men, but they're getting too much power."

"That might be subtle, but it's still a form of homophobia," Raphael says. "It's right below the surface, but it's there."

David Binder, an independent pollster, agrees that there is some subtext out there. "It's that Tom is perhaps more obviously gay. A little flamboyant. His voice is a little higher. His mannerisms. His hand gestures. And so for some people it becomes more of an issue. But they don't talk about him being gay. They might say he doesn't seem mayoral, that they can't envision him meeting a visiting head of state."

Yet this is perhaps the most interesting thing: It may not be Ammiano's homosexuality that keeps him from the mayor's office, but his economics. San Francisco is a boomtown. Rents and home prices are exploding in the go-go world of e-commerce, but 15,000 homeless wander the streets and school budgets are being cut. The divide between haves and have-nots is pulling the city apart.

Binder just completed a survey that found, for example, that support for Ammiano is split, with gay renters overwhelmingly favoring the supervisor, but gay homeowners telling Binder they will vote for Brown and the status quo.

"There is this bit of class warfare out there," Binder says. "This atmosphere where Ammiano speaks to the fears of renters who are having a harder time and feel like they're being forced out of the city, while homeowners worry that Ammiano is going to give away the store, raise taxes, you know, all the stuff that Brown is using against him." Brown has cast Ammiano as a super-liberal tax-and-spender hostile to big business and ready to derail the city for "a so-called people's agenda."

Seen on a storefront in the Mission District is a for-lease sign where someone has scrawled graffiti that reads: "BUT NOT FOR YUPPIE SCUM."

Ammiano is plugging in to these feelings. Asked his three main issues, Ammiano replies, "housing, housing and housing." But he also throws in homelessness, better public transportation and the power of neighborhoods over special interests. "So I guess that's five or six top three issues," he says.

The San Francisco Chronicle published the results of its most recent poll a week ago, showing that Brown is likely to win, capturing 49 percent of the vote, to Ammiano's 29 percent, with 22 percent undecided.

Undeterred, Ammiano says win or lose, he and his supporters win. "We're not going to fade off into the sunset," he says.

CAPTION: Board of Supervisors President Tom Ammiano greets a supporter. The eleventh-hour candidate has forced Mayor Willie Brown into a runoff.

CAPTION: San Francisco Mayor Willie Brown, above, speaks to Marina District supporters; an Ammiano supporter, below, distributes leaflets in the Mission District.

CAPTION: Mayor Willie Brown, left, and Tom Ammiano, speaking to their respective supporters. Write-in candidate Ammiano was written off by many handicappers.