Forget about the bad times, dancing queens. Madonna has decided to get back into the celebratory groove, where she belongs.

Following the critical and commercial failure of 2003's ponderous, pensive electro-folk song cycle "American Life," the pop icon has returned to the discotheque in search of redemption, not to mention her musical mojo.

She's found both: Her new album, "Confessions on a Dance Floor," is worthy of a rave. Featuring some sharp electronica production and more than a few moments of pose-striking irresistibility, it's also worthy of praise as Madonna's best album at least since 1998's "Ray of Light" -- and possibly since 1989's "Like a Prayer."

Though she's never actually left clubland behind, "Confessions on a Dance Floor" is Madonna's first end-to-end dance-music studio album since her eponymous debut 22 years ago. It's driven by thumping, four-on-the-floor beats bolstered by vintage disco samples and the sort of meaty hooks that were decidedly lacking on "American Life."

To further add to the danciness of it all, the CD's tracks are presented in fluid club-mix form without any breaks between the shimmering slices of guilty-pleasure pop-techno.

Thus, after opening with the euphoric and bewitching first single "Hung Up," which borrows liberally from Abba's "Gimme! Gimme! Gimme!," the album downshifts the BPMs some and segues into the trancey "Get Together." That swirling song melts into the multilingual "Sorry" and its Jacksons bassline (from "Can You Feel It?"), which then gives way to the buzzing, textured techno of "Future Lovers," whose percolating synth line comes courtesy of Donna Summer's disco classic "I Feel Love."

The samples may have cost Madonna a pretty penny, but the price was right. They serve the songs and the clubby feel of the album exceptionally well.

The Price was right, too. Though Madonna is the reason consumers are likely to seek out a dance album even if they don't know their L.T.J. Bukem from their LBJ, the album works largely because of producer Stuart Price.

Price did a fine job of framing Madonna's limited vocals in generally flattering ways, and he managed to coax an assured, less-affected-than-usual performance out of the singer, with whom he's worked since 2001, when he served as the musical director on her "Drowned" world tour. He produced one song ("X-Static Process") on "American Life." But where most of that album was rhythmically tentative, Price constructed "Confessions' " beats with brio, giving the set the kind of swagger that Madonna's albums have largely been missing since 1992's underrated "Erotica."

It's no surprise, really, given Price's track record in the studio and the clubs, as a producer (New Order, Diddy), remixer (Missy Elliott, the Killers, Depeche Mode, Gwen Stefani), one-man band (Les Rythmes Digitales) and DJ (usually working under the pseudonym Jacques Lu Cont). Price has his finger firmly on the pulse of danceville, and his artistic instincts have helped Madonna once again to sound relevant and smart.

Well, mostly. Although the album features a few production misses (the plodding, vocoderized "Forbidden Love," for instance, sounds like a stale Erasure leftover), most of the misfires come from the lyrics.

By far the worst are found on "I Love New York," which opens with the following couplet: "I don't like cities, but I like New York / Other places make me feel like a dork."

The Madonna-for-poet-laureate campaign begins here and now, reader.

At least she leaves behind most of the politics and proselytizing (not to mention the ill-advised quasi-rapping) that marred "American Life." In the record company propaganda, the artist occasionally known as Esther goes so far as to say that "Confessions" is "about having a good time straight through and nonstop. I want people to jump out of their seats."

Still, Madonna is Madonna, which means we're expected to jump for the requisite Kabbalah song ("Isaac") as well as the thematically dull tracks on which she considers fame ("Let It Will Be") and her considerable fortune ("How High"). And on the throbbing, swirling "Push," which faintly echoes the Tom Tom Club, she pays tribute to husband Guy Ritchie, apparently having forgiven him for "Swept Away."

Hey, Madge, whatever keeps your feet -- and ours -- happy.

Madonna is back in her element in "Confessions on a Dance Floor."