Anarchy is the timeless spirit of animation. It's there in Bugs Bunny and Bullwinkle cartoons, in Fantasia and The Incredibles. It's there as well, in a megaplex-toddler-friendly way, in Madagascar, the delightfully wacked new digitally animated comedy in which a quartet of critters escape the Central Park Zoo to taste the freedom of the wild world beyond. Freedom doesn't agree with them, exactly; it makes them prickle and sweat. Yet that's the film's funky glory. Madagascar, which opens with a chorus of penguins singing ''Born Free'' (fear not it's a dream sequence), dishes up some very corny jokes, but the images have a brighter-than-life vivacity. The movie is so in love with craziness, with the infantile fun of What Comes Next, that it scarcely has time to worry about whether its heroes are being redeemed or not.
Directors Eric Darnell and Tom McGrath depict the Central Park Zoo in clean, crisp morning light, and from dramatic low angles, so that the skyscrapers of Manhattan are always looming in the background, rendering the zoo the grandest of sunstruck prisons. Alex the Lion, with his blow-dried pentagon of a mane, is voiced by Ben Stiller. In classic Stiller fashion, he's a polite and self-doubting egomaniac, at home in captivity, preening for adoring crowds like the domesticated muscleman of the jungle. His best friend, Marty the Zebra (Chris Rock), is a loyal, low-down neurotic who can't decide whether he's black with white stripes or vice versa. Marty, however, does know that he'd like to break away from behind bars. When he busts out of the zoo, Alex follows close behind, along with Melman the Giraffe (David Schwimmer), a nudnik hypochondriac, and Gloria the Hippo (Jada Pinkett Smith), a saucy scold.
For a while, they turn Manhattan into a gritty playground, but they end up cornered by police at Grand Central Terminal. Packed off in crates to a Kenyan wildlife reserve, they are shipwrecked on Madagascar, a tropical island that looks like Waikiki as drawn by Rousseau, and once there they meet the restless natives, a tribe of hard-partying lemurs whose self-proclaimed king, Julien, is the spirit the very soul of anarchy. Voiced by Sacha Baron Cohen, who is best known for his put-on alter ego, the brilliantly obtuse hip-hop interviewer Ali G, Julien is first seen leading a techno-disco horde as he sings, ''I like to moove-it! moove-it!'' I nominate that line as the single most demonically catchy in any movie this year. The song gets inside you like a cosmic goof, as Cohen voices Julien with an accent that's like 12 spices at once he mixes rasta exuberance with a touch of Indian singsong with his own special brand of mishegoss defiance. He makes this lemur king, with his wavery grin and oversize yellow saucer eyes, happily insane.
The madness escalates from there, as the lemurs send their zoo visitors, whom they dub the New York Giants, to a special lush corner of the island that's like a wild-kingdom Eden. Alex begins to feel free, all right. His inner carnivore awakens; he starts to fantasize about eating his friends, who turn into steaks before his eyes. In the old Warner Bros. cartoons, stuff like this happened when stranded characters ran out of food, but you've got to hand it to a kiddie flick that dares to present its hero's follow-your-dream ''liberation'' as his looming conversion into a flesh-hungry sociopath. That's untamed fun.