FRAZER A burst pipe inundated its brand-new building in Frazer just a few weeks before its dog-training and boarding business was to occupy it.

Then came the bank payments the owners couldn't afford, followed by foreclosure. Naturally, they couldn't file for bankruptcy - because they couldn't pay the legal fees.

"We shouldn't have survived, by all accounts," said Carolyn Garson, a co-owner of What a Good Dog who left her 15-year teaching job at the University of Pennsylvania School of Nursing in 2000 to help the business expand.

"We couldn't have survived if people didn't believe in us."

At that same Frazer building, Garson and co-owner Mary Remer, who founded What a Good Dog three decades ago, held an open house for 130 people on Monday, with tours, food, and a magician.

They said they wanted to thank family members, friends, clients, and investors for putting up millions of dollars in donations and deposits for future services to help them open the building after the flood.

"People have helped us conjure up the magic at What a Good Dog," Garson, 52, said.

Donations ranging from $25 to $50,000 kept the business going, and Garson says it now generates more than $1 million annually.

What a Good Dog offers about 20 classes a week between its two locations, including manners lessons, "puppy kindergarten," swim lessons, and "nose work," in which dogs learn to detect scents.

About a decade ago, What a Good Dog decided to expand from its dog-training site in Villanova to a second building in Frazer for training, boarding, and grooming.

The goal was to create a place that would care for dogs as their owners would, and where dogs would "wag their tails coming in and wag their tails going out," Remer said.

The business raised several million dollars to construct the facility and for operating costs and starting capital.

Then came the flood.

A hot-water pipe burst in October 2009, damaging the 18,000-square-foot building a few weeks before it was to open. Water spewed for about 24 hours and damaged walls, floors, surveillance cameras, and equipment. The business lost more than $500,000, and insurance did not cover loss-of-business costs.

People told Garson and Remer to give up on the new building, but they couldn't. Caring for dogs is a calling for Remer, 62, who has trained more than 25,000 during her career. "I always say she has dog in her DNA," Garson said. And they didn't want to let down everyone who had invested in the business.

So Garson and Remer wrote a letter to clients, family, and friends and raised the $50,000 they needed for legal fees to file for bankruptcy.

When the facility finally opened in September 2010, a decade after the owners bought the property, the business had almost no money left, Garson said.

"It's like you were on a team that kind of fell behind and you wanted them to win," said Nancy Weaver of Malvern, who gave money for future services for her 3-year-old cockapoo, Wesly. "And they have won."

The business is still recovering from the bankruptcy, from which it emerged 15 months ago, but "we feel like we're coming out of the tunnel," Remer said. At Thanksgiving, the facility boarded 104 dogs, a 40 percent increase from last year.

Deborah Glass drives from her home in Bryn Mawr to take her two golden retrievers, 4-year-old Gus and his year-old sister, Lolly, to What A Good Dog for training, boarding, grooming, and day care. Glass is one of several partial owners who invested in the company to save it.

"I believed in their commitment to make the business work," Glass said. "I had to keep their business going, because they were just too good to fail."