The worst day, as screenwriter Eleanor Bergstein remembers it, was when Vestron executives brought in movie producer Aaron Russo to advise how to salvage Dirty Dancing.

"Burn the negative and collect the insurance money," he reportedly suggested.

Had the execs heeded Russo's advice, the indie movie - released 25 years ago this week - would not have gone on to earn an Oscar, $214 million, and the fervent love of generations of moviegoers.

The story behind Dirty Dancing is much like that of Bergstein's heroine, Baby (Jennifer Grey), who tries, fails, and tries again to make the leap into the arms of Johnny Castle (Patrick Swayze).

Every studio in Hollywood passed on the screenplay. The indie outfit that produced it considered it a straight-to-video release. After all these false starts, the movie no one wanted leaped into the hearts of filmgoers around the world.

Bergstein reckons that the gestation of Dirty Dancing took about seven years. Now 74, she grew up in the Brooklyn, N.Y., neighborhood of Kensington. As she tells it, "I was a teenage mambo queen."

In the '70s she became a novelist. In 1980, she wrote her first screenplay, It's My Turn, an entertaining and criminally underknown comedy starring Jill Clayburgh and Michael Douglas. Its script included a scene of an erotic dance as the foreplay to a mutual seduction. The studio cut it. What's left is a shot of Douglas unbuttoning Clayburgh's blouse.

"A few years later I was walking down the street and I ran into a crew member from It's My Turn," recalls Bergstein. "He said, 'I remember when you taught us all how to dirty-dance.' " The proverbial lightbulb flicked on.

For inspiration, Bergstein listened to her old 45s. She emceed dance parties at her home in Princeton (her spouse is poet and professor emeritus Michael Goldman). If she put on a cut and the guests jumped to dance, it became a "priority recording." She picked the music first, she says, and "then I dreamed through the story."

She set the film in 1963, the summer of the Rev. Dr. Martin Luther King Jr.'s march on Washington, months before the assassination of John F. Kennedy. It had to be '63, Bergstein says, because a year later, "everyone upstairs was listening to 'downstairs music.' "

Her upstairs/downstairs film about the guests and the staff at a Catskills resort is semiautobiographical. Like Baby, Bergstein had a father who was a doctor, they went to the Catskills in the summer, and she had an older sister.

The script had a fearless symmetry. "It's the classic story of the girl who feels unattractive falling in love with, and being loved by, the handsome boy," observes Lindsay Doran, a Hollywood producer. "And it's also the reverse of that, the classic story of a boy who feels worthless falling in love with a girl above his station."

"When I read the finished script, I thought, so much heart, sexiness, and real," recalls Ileen Maisel, the MGM executive who helped Bergstein develop the screenplay. From the first, Dirty Dancing resonated with females at the studios, not so much with males. What the guys liked was the music on the cassette Bergstein attached to the screenplay.

Though Maisel advocated on behalf of Dirty Dancing, she lost her job in a corporate regime change. Linda Gottlieb, another MGM exec and the film's ultimate producer, also fought for it. But in the end, new management put it in turnaround, trying to unload it.

Meanwhile, Dirty Dancing got manhandled by more guys than a dime-a-dance floozy. In that era of music-driven films such as Flashdance, one exec after another passed on the screenplay but pocketed the cassette, with its danceable hits such as "Hey! Baby" and "Do You Love Me."

MGM dropped its option. Bergstein's agent sent the orphaned screenplay to a video distributor called Vestron. To stay alive, the little video company had decided to make low-budget movies and distribute them itself.

At a time when the average cost of making a movie was between $15 million and $25 million, Vestron offered $4.7 million for the film. Bergstein and Gottlieb jumped at it.

The producer and screenwriter tapped Emile Ardolino, Oscar-winning director of the Jacques d'Amboise documentary He Makes Me Feel Like Dancin'. "We liked him because he shot dance from the perspective of the dancer," says Bergstein. Ardolino hired choreographer Kenny Ortega, a protégé of Gene Kelly.

They auditioned a lot of actors to play the leads, including Winona Ryder, then 15. The executive team agreed that Jennifer Grey, daughter of Cabaret star Joel, and Patrick Swayze, a Joffrey Ballet dancer sidelined by a knee injury, were safe bets because they could both act and dance. The actors had previously worked together, with some antipathy, on Red Dawn.

Production designer David Chapman was working on a Michael Keaton movie when he was offered Dirty Dancing. Chapman liked the script so much that he promptly found a replacement for the Keaton film. "I love musicals because they make people happy," says Chapman.

"I used all the theater tricks I could think of," he says. The French doors in the ballroom? A silhouette of a plywood cutout. "We had zero in the way of a building budget, so we had to choose good locations - the Mountain Lake resort in Virginia and Lake Lure in North Carolina." To visually "connect" these locations, "we put colored lanterns all over the place."

"As much as we could, we incorporated rehearsal footage into the film," Chapman remembers. Ardolino kept the camera running during rehearsals and wouldn't shoot a scene if he thought the rehearsal takes were usable.

Like the sequence in which Swayze shows Grey how to begin the dance, stroking her side while he raises her left arm. It tickled. She giggled. Swayze was exasperated by having to do take after take. It's in the finished film. So is the scene where Grey teases Swayze and they dance and lip-sync to Mickey & Sylvia's "Love Is Strange."

Was it a happy set? "Yes and no," Chapman says. "We were living on top of each other and in each other's hair."

Vestron execs told the producers that no one would buy Swayze going for Baby over Penny, the Vanna White-like blonde played by Cynthia Rhodes. (In his 2009 memoir, Swayze concurred.)

Grey's agent saw the finished film and told Bergstein and Gottlieb that it was so terrible it would make everyone involved a laughingstock. Distributors and exhibitors didn't like it any better.

Clearasil had signed on to do a cross-promotional campaign. When ad executives previewed it and saw that the film included an abortion, they asked Bergstein to take out the scene. Without Penny's abortion, she explained, Baby wouldn't have to substitute as Johnny's partner and there would be no story. In hindsight, Doran observes, it is those "serious issues - a botched abortion and class prejudice in the midst of what seems on the surface to be an unserious movie" - that make it so effective.

It was with little enthusiasm that I dragged myself from home that muggy August night to review the movie with the faintly smutty title.

Mitch Russell, my neighbor, a young lawyer engaged to be married, was watering his windowboxes. Amy Falk, his fiancee, was away. "Come to the movies. Most likely a dog," I warned. "Better to be in air conditioning than in the stifling heat."

From the opening credits of dancers thrusting to "Be My Baby," we were hooked on the driving energy of the soundtrack. Thirty minutes into the film, when Swayze's swaggering Johnny teaches Grey's timid Baby how to mambo, I heard something rare in movie theaters. Rapt silence. It was so quiet that you could hear Raisinets kiss. It was so quiet that when Mitch whispered, "Don't tell Amy you brought me. This movie is the moral equivalent of adultery," my stifled giggle was louder than a hacking cough during the finale of La Boheme.

Roger Ebert gave Dirty Dancing one star. Pauline Kael condescendingly called it "the girl's version of The Summer I Grew Up and Everything Changed."

Vincent Canby of the New York Times liked it. So did I. I wrote that it used dance to express its characters' intimate feelings and to foreshadow the sexual and political revolutions that were coming.

(Privately, Canby agreed with me that, as with Desperately Seeking Susan, the critical resistance to Dirty Dancing might have been because it was a female-centered story.)

Everyone was surprised when Dirty Dancing turned out to be, like its heroine, a Sleeping Beauty of a sleeper. Its $214 million box office amounts to more than $400 million in 2012 dollars. Its soundtrack sold 45 million units. It won the Oscar for best song, "(I've Had) The Time of My Life." In its day it was the most successful indie movie ever made.

The night before Dirty Dancing opened, Bergstein walked up and down Columbus Avenue on New York's Upper West Side with Ardolino and Ortega. She had bought yo-yos for the three of them.

They walked all night, up and down, up and down, spooling and unspooling the toys. "We said, 'We've been up and down,' " Bergstein recalls. "We were sure the next day we'd be down.

"We never dreamed the movie would go on to another generation."