CERRITOS – Three decades before Harry Potter, Samantha Stephens was casting spells and magic on the campy TV sitcom “Bewitched.”

Samantha (played by Elizabeth Montgomery) was a witch married to a mortal man, and she couldn’t resist using her magic powers – by twitching her nose – to solve her family’s problems.

The show ran from 1964 to 1972 and was a hit thanks to its eccentric characters, outlandish costumes and Samantha’s comical attempts to live the life of an average suburban wife.

But beneath the surface, the show at times had a serious message, says Cerritos resident Herbie J Pilato, 52, author of the new book, “Twitch Upon A Star: The Bewitched Career and Life of Elizabeth Montgomery.”

The season-seven episode “Sisters At Heart,” for example, featured a theme designed to combat prejudice, Pilato said.

In the episode, the Stephenses’ supernatural daughter, Tabitha, befriends Lisa, a young black girl, and the two friends want to be sisters. But after a bully in the park tells them it’s impossible because they have disparate physical appearances, Tabitha employs “wishcraft” (whatever she wishes comes true) to make them the same color.

Before casting the remedy spell, Bombay tells Tabitha and Lisa: “All men are brothers, even if they’re girls.”

“Elizabeth loved the episode. That’s what she wanted `Bewitched’ to be,” said Pilato, who also authored 1992’s “The Bewitched Book” and 2004’s “Bewitched Forever.” “The prejudice message wasn’t directly talked about, but everybody knew. It was an underlying theme.”

Cerritos resident Herbie J Pilato is the author of the new book, “Twitch Upon A Star,” a biography of “Bewitched” TV star Elizabeth Montgomery. (Brittany Murray/Staff Photographer)

“Twitch Upon A Star” is based on Pilato’s exclusive interviews prior to Montgomery’s 1995 death from cancer. She was 62.

The book follows her career before, during and after “Bewitched,” and goes behind the scenes chronicling her political activism.

The book also explores Montgomery’s tumultuous relationships with her father, screen legend Robert Montgomery, and her four marriages.

Besides the anti-prejudice message of “Bewitched,” “Twitch Upon A Star” reveals other behind-the-scenes anecdotes about the show and Montgomery’s life.

In an interview with Out in the 562, Pilato shared other information about the actress, her life and career.

Pilato will sign copies of his book Noon Dec. 9. Barnes & Noble Bookstar in Studio City. He also will sign books at The Hollywood Show, a classic TV show convention, Jan. 12 and 13 at The Westin Los Angeles Airport.

Out in the 562: How did Elizabeth Montgomery twitch her nose as Samantha on “Bewitched”?

Herbie Pilato: The night before they began rehearsals, Nov. 21, 1963, they were trying to figure a way for Samantha to manifest the magic. Director-producer Bill Asher, who was married to Elizabeth, turned to her and said, “What’s the thing you do with your face when you get nervous?” Elizabeth had no idea what he was talking about, but he kept prodding her. The more he asked her the more nervous she got, and then she did it. He said, “That’s it.” It’s not her nose. She moves her upper lip, and then the nose falls into place.

H.P.: Bill Asher loved women, and women loved him. He allegedly began having an affair during the third or fourth season of “Bewitched.” When Elizabeth couldn’t take it anymore, she banned him from the set. By the show’s eighth season, Elizabeth allegedly began an affair with an assistant director on the show. She was tired of the show and tired of the marriage. When the show ended, so did the marriage.

OIT562: In the mid-1980s, Elizabeth was an early advocate for people with AIDS. How did she began that activism?

H.P.: “Elizabeth was a very caring human being. She knew there were more important things in the world than acting. But she also knew that if she was going to be in the public eye, then she was going to do something positive with her public persona. Her father had been one of the first entertainment professionals to connect with political advocacy, and she followed in his footsteps in that regard, just as she had with acting.

Also, when she met and fell in love with actor Robert Foxworth, on the set of her 1974 TV-movie “Mrs. Sundance,” he encouraged her to become involved with charity work. Both of them were always for the underdog, and those suffering from AIDS certainly fit into that category, especially in the 1980s when few celebrities had the courage to support the cause. Elizabeth said people in Hollywood weren’t as damn liberal as they thought.

OIT562: She also was a champion for the disabled community?

H.P.: Shortly before her death, Elizabeth donated her time to many recordings for the blind and did a television public service announcement seeking funding to help the visually impaired. In fact, she twitched her nose in those commercials. That was monumental because she had not done so since she left “Bewitched.” But she knew that doing so for the PSA would bring attention and additional funding to a good cause.

People in the disabled community, visually or hearing impaired, were attracted to Elizabeth’s performances in many ways. The visually impaired were attracted to her unique voice and the hearing-impaired were attracted to her expressive face.