You'll probably want to take a shower after watching "Middle Men," just to wash all the "ick" off yourself. And that's a compliment.

This inspired-by-a-true-story film about the birth of Internet porn is giddily sleazy, full of convincing crazies and criminals, as well as the scumbags and wannabes who surround them.

Writer-director George Gallo seems to have been influenced here by "Boogie Nights" and "Goodfellas," not just in their subject matter but in their fast-paced, in-your-face hodgepodge of images, styles and music. (The soundtrack, featuring period-appropriate songs from Moby and Fatboy Slim and a particularly apt use of the Rolling Stones' "You Can't Always Get What You Want," must have cost a fortune.) It's a predictable rise-and-fall tale of people who get in over their heads with no clue about how to get out, but at least it's fun while it lasts.

Besides, the details and the characters are what make these types of movies work. And Gallo, who previously wrote "Midnight Run" and "Bad Boys," creates some lively figures for many of his actors to inhabit. Giovanni Ribisi is gloriously over-the-top as former veterinarian Wayne Beering, who helps come up with the idea of distributing porn online in the late 1990s when he becomes bored with his own, um, inspirational material. Coked up and chain smoking, rambling and usually ready for a fight, he's a complete idiot but he might also be a genius.

The real brains behind the operation is former NASA technician Buck Dolby (Gabriel Macht), who creates a program within minutes that allows users to provide their credit card information online and receive photos and videos in return. (It almost seems quaint to look back at a not-so-distant time when Internet porn didn't exist, given how pervasive it is now.)

Neither of these guys knows how to handle the millions of dollars they make; at one point, even after they form an actual billing company and move into a legitimate office building, they forget a $2 million check that's just sitting in a desk drawer. But while Buck is just as much of a coke fiend as Wayne, he's comparatively coherent. So when they find themselves in deep trouble with a bunch of Russian mobsters (led by the formidable Rade Sherbedgia) and get beaten bloody in a trashed Las Vegas hotel suite, Buck kinda-sorta has enough sense to figure a way out.

Unfortunately, that involves bringing in the well-connected and opportunistic lawyer Jerry Haggerty (a perfectly ruthless James Caan), who in turn brings in Jack Harris (Luke Wilson), a Texas businessman with a knack for solving problems. And Jack is actually the one at the centre of "Middle Men," the straight man amid these larger-than-life lowlifes. After all, someone's got to anchor all this mayhem. But Wilson plays him a little too straight. He's so low-key it's difficult to connect with him and, at least until nearly the end, hard to know whether his various alliances ever plague on his conscience.

Jack glides among and manipulates all these people with such blase ease, he may as well be ordering take-out over the phone. He has a wife (Jacinda Barrett) and two kids back home in Houston, but his work in Los Angeles -- which he likes to think of as above-board, since all he's doing is running a billing company -- keeps him away for longer and longer stretches. It also leads to a dalliance with a 23-year-old porn star (Laura Ramsey).

We get a lot of voiceover from Wilson -- probably too much -- but then again, there are so many intertwined characters perpetrating so many scams, perhaps Gallo felt the device was necessary to help us keep track of everyone and everything.

"Middle Men" is based on the experiences of Christopher Mallick, one of the film's producers, and it's hard to tell what's real and what's fictionalized. Maybe it doesn't matter though -- maybe it's just as well if we view it all as artifice and illusion, not unlike Internet porn itself.

Two and a half stars out of four.