Elizabeth Halsey (Cameron Diaz) did not get to know her fellow teachers during her one year as a middle school English teacher, but none of that matters now as she is off to marry a wealthy man and live a life of leisure. Unfortunately, that man has a mother and that mother doesn’t approve of this obvious gold digger so on the day she merrily speeds away from her middle school, Elizabeth comes home to find herself getting dumped.

Skip to the beginning of the next school year and she is unhappily back at John Adams Middle School and working hard to figure out how to do something with her life other than working hard. She decides that a boob job is her ticket to a better class of man and therefore a better life, but where to get the $10,000 she needs? Skimming off the school car wash and asking for “tutoring money” from her students’ parents only gets her so far. And the situation becomes all the more desperate when an attractive, wealthy and recently single substitute arrives.

Scott Delacorte (Justin Timberlake) is just the kind of rich moron Elizabeth is looking for, but cornball teacher Amy Squirrel (Lucy Punch) also has her eyes on him. Thinking that only boobs will save her, Elizabeth learns of another way to make some extra scratch — the annual bonus that goes to the teacher whose students score the highest on the standardized test. To get her to her desired cup size, Elizabeth may have to do the unthinkable — teach her students.

Movies with nutball central characters need voice-of-reason supporting characters, and here that role is filled by Jason Segel, who plays Russell the gym teacher. He likes Elizabeth in spite, and maybe a bit because, of her horrible self, likes her even as she nakedly chases Scott for less than romantic reasons. That Segel is able to do this without making his character a doormat is actually pretty impressive. Segel is quite good at playing this particular flavor of schlub.

In fact, there are several pretty decent performances in this movie. Lucy Punch makes her goody-good teacher someone with several screws loose. She is what Tracy Flick of Election would turn into if she were only moderately successful at reaching her goals. Even at her most good-hearted, Amy is a woman who could do with some sedatives and a few weeks in some place with the words “wellness” and “facility” in its name. The more Elizabeth needles her, the more unhinged she becomes. Phyllis Smith (Phyllis in The Office) also has a solid supporting role as a teacher who seems both horrified by and fascinated with Elizabeth. She is the timid friend who knows she can’t emulate the bad-girl rebel but likes to be in proximity.

Timberlake’s role is about 70 percent of successful. Syrupy square Scott Delacorte could have used a few more minutes in the oven to get rid of some of his mushy parts. He is at his best when he is playing his character as kind of a screwy church youth group counselor. Other times, however, the movie seems to want to make him more of a cad or more of an idiot and it makes the character feel like a punch line rather than a real person. (Not to say he isn’t a good punch line — Timberlake’s one big singing scene in the movie is pretty great.)

And then there’s Diaz, about half of a good character. Her awfulness is great fun to watch. But the story also needs her to have moments of heart deep down. The movie contains relatively believable examples of both of these, but it isn’t able to completely mesh them together. “Now we need her to learn,” says the movie as it takes an abrupt turn and the feeling part of the movie begins.

So, yes, if you’ve seen the trailers you have seen many, perhaps not all, but many of the best parts of the movie. Still, considering that and the shakiness of some of the characters, I don’t completely not-recommend this movie. If you are looking for a tart alternative to feel-good movies, kid fare and big-explosion-filled action, Bad Teacher is sort-of worth your (matinee) ticket purchase. C+

Rated R for sexual content, nudity, language and some drug use. Directed by Jake Kasdan and written by Gene Stupnitsky and Lee Eisenberg, Bad Teacher is an hour and 29 minutes long and is distributed by Columbia Pictures.