Version one of the kinky-sweet, naughtily delicious Secretary was a 22-minute short by Steven Shainberg, a Yale grad, when he matriculated at the American Film Institute. Based on the Mary Gaitskill story from her celebrated 1988 collection, Bad Behavior, it told of a low-esteem young woman whose budding secretarial career turns weird when her employer, a lawyer, gives her sadistic spankings and, one unhappy day, masturbates on her.

"I was moved by Gaitskill's writings, what was said about male-female relationships that I'd never before read about," Shainberg told me at this September's Toronto International Film Festival. "The short was good but, when I went to make it into a feature, everyone asked, how does the secretary get over her problem? I said, 'She now doesn't have a problem.' The story was a jumping off point, but I was more interested in a different tone, flipping it."

Shainberg's savvy decision: in his feature, Lee's masochism (a blockage in the story) would be her pathway to bliss and liberation. The lawyer, a disgusting brute in Gaitskill, would be a lonely, screwed-up guy who can be freed by Lee, the uninhibited woman who grooves on his spankings. Shainberg: "I looked at Hepburn-Spencer Tracy movies in planning. I love those movies, but I twisted the paradigm into something not quite recognizable." Erin Cressida Wilson's screenplay for Shainberg evolved into an S&M screwball comedy.

Shainberg and Gaitskill were longtime friends, ever since he secured her permission for his short of Secretary. He invited her to Secretary, the feature. "After twenty minutes, Mary turned to me and said, 'I love it, but it has nothing to do with my story.' That's true, other that a girl gets a job with a lawyer and gets spanked."

James Spader as the lawyer? "I had stars who said the project was very interesting, but who were afraid to take a chance. Look at films like Sex, Lives, and Videotape and Crash, and you can't find a major actor who has done such sexually explicit films as Spader. I say, God bless him! The key here was that he'd be willing to remove the mask he had in Crash. I love David Cronenberg, but Spader's too cold! In White Palace, he showed his vulnerability."

Maggie Gyllenhaal, so superb as the secretary? "She was the very first person to come in for casting. I said to the producers, 'You might think I'm insane, but I think I've already found the girl. She has tenderness, honesty, a sense of humor, and an odd physicality that could lead to something beautiful. And you feel she's making her own choices, and is never going to be taken advantage of.

"Then I looked at 60 or 70 other actresses. A star sees a part like this, and all the people around her worry, about her wearing a saddle, being masturbated on at work."

That wasn't Gyllenhaal's reaction. Said the 1999 Columbia University graduate at Toronto: "I read three quarters of the script, got really excited, called my agent, and said, 'It's fuckin' awesome.' I said, 'Call Steve,' and then got really nervous, not because of the S&M and masturbation, but because it could come out as an anti-feminist film.

"My mother, who is a screenwriter, was really worried about me when I was shooting. She didn't trust the script. 'Who is this guy, the director?' But now my mom loves Steve."

And the strictures of feminism? "They need to be shaken up a bit. Secretary is a forward step. What Lee and the lawyer are after is 'feelings,' and the only way they can feel is to hurt themselves awake. So many people are asleep, and need waking up."

Talking passionately about Secretary, Gyllenhaal smiled. "This film is so fuckin' good," she said.