BEVERLY HILLS –The ad world of “Mad Men” meets the modern-day world of sitcoms in a coming new comedy.

“The Crazy Ones” marks Robin Williams’s first regular appearance in a series since “Mork & Mindy,” Sarah Michelle Gellar’s return to television post “Buffy the Vampire Slayer” and creator and executive producer David E. Kelley’s first foray into the 30-minute comedy genre.

“The half hour genre is not my turf,” Kelley said at the Television Critics Association summer press tour Monday. To help out, Kelley said he searched for veterans from “Arrested Development” and “Will & Grace” and drew from the personal life and work of John Montgomery, an ad executive based in Chicago.

Premiering Sept. 26 on CBS, “The Crazy Ones” follows a father/daughter team (Williams/Gellar) through the topsy turvy world of running an advertising agency. “The Big Bang Theory” will function as the show’s lead in, and “Two and a Half Men” will follow.

James Wolk, aka Bob Benson on “Mad Men,” also stars in the show. “I now only [do] strictly advertising and marketing shows,” he joked.

Although there were six people on the panel, it was Williams’ show. Keeping the audience laughing, he managed to work in a Carlos Danger reference (“I’m getting a text from Carlos… even his phone is saying ‘no more,’”) made fun of his time in rehab (“I went to rehab in wine country to keep my options open”) and invented a new Apple product, the iEye, a proposed implant to compete with Google Glass.

Kelley and Jason Winer, an executive producer and the director of the pilot, repeatedly said the show largely stuck to the script, despite Williams’s penchant for improv.

“Improv is the icing, not the cake,” said Winer, who also explained that Williams and the cast did the scenes using the script first and then he and Kelley would open it up to improv, some of which made it into the final cut.

To ground the show in reality, the ad firm present in the show also uses real companies like McDonald’s, which is featured in the pilot.

Winer said so far, no money has exchanged hands for product placement and that McDonald’s “didn’t have final approval over the pilot.”