HARRISBURG - Although his years-long crusade to enact a statewide ban on discrimination based on sexual orientation or gender identity again died at the end of the most recent legislative session, state Rep. Dan Frankel sees reason for optimism.

This time around, his bill attracted a record 71 co-sponsors, including two Republicans, and even passed narrowly out of the State Government Committee. It then drew hostile amendments from opponents and was not brought up for a floor vote.

With Republicans set to take over the House and governorship next month, Frankel said short-term prospects are dim, but he insists he's much more hopeful about the long run.

"In my view, it's inevitable," said Frankel, D-Allegheny. "When you talk to people, particularly younger people, under 50, they don't understand why this is an issue."

The Legislature's lack of action to outlaw bias in housing, employment or public accommodation for lesbian, gay, bisexual and transgender people has helped prompt 18 counties or municipalities to pass their own human-relations ordinances. About a dozen more are in some stage of considering it.

The issue has arisen most recently in the Philadelphia suburbs. Doylestown passed an ordinance in August, and the Lower Merion Township commissioners adopted one earlier this month.

In Hatboro, the council passed a human-relations ordinance in November but it was vetoed by the mayor, who said the issue was more appropriately handled by state government. Opponents also cited costs and potential litigation.

Pennsylvania's 18 local ordinances vary, but they generally require a review by a human-relations commission and a mediation process and rely on fines, summary charges or civil litigation for enforcement. Seven also conduct their own investigations.

Twenty-one states have similar laws on the books.

"You can fire someone for being openly gay in Pennsylvania," said Ted Martin, of Equality Pennsylvania, an advocacy organization with offices in Philadelphia and Harrisburg. "It's still legal. It's still legal to refuse them public accommodations. Those things, as long as they exist, are wrong."

Opponents say that expanding anti-discrimination protections comes with a price to taxpayers, that the incidence of those kinds of bias is relatively infrequent and that the laws can force a conflict with deeply held religious beliefs.