Philosophically, the Sundance Film Festival's most important goal is to give independent films from around the world a venue in which to be seen by enthusiastic audiences, but there's no denying Sundance's other major function: to help the filmmakers sell their movies to distributors, who can then sell them to the movie-going public.

For the industry, Sundance is like a big ol' bazaar, where the merchandise is of varying quality and you're free to browse before you buy. You might get something at a bargain price and turn a handsome profit when it goes to theaters later on; or you might pay through the nose for something you're sure will be a hit, only to lose your shirt when it tanks. It's always a crapshoot (often heavy on the crap), and the only way to know for sure whether the purchase was shrewd is in retrospect.

So here's some retrospect! You'll note that it has nothing to do with quality -- all 10 of these movies are good. Yet somehow, their fates ranged from the miraculous to the tragic.
5 Best Sundance Purchases

'sex, lies and videotape' (1989). This was the sale that established Sundance as a marketplace rather than just an exhibition venue. It also put Bob and Harvey Weinstein's company, Miramax, on the map, and during the indie revolution of the 1990s, it was Miramax that stood at the forefront. Oh, and it launched Steven Soderbergh's career, too. Sundance sale price: $1 million. Domestic box office: $25 million.

'The Blair Witch Project' (1999). This would be a milestone film even if all it did was spawn the now-inescapable genre of "found footage" horror movies. But that is not all it did! It was also the first movie to benefit heavily from Internet marketing (the term "viral marketing" wasn't common yet in those days). After it scared the poop out of Sundance audiences, Artisan bought it for a million bucks, then spent another $25 million on marketing -- an absurd investment that wound up paying serious dividends. Sundance sale price: $1 million. Domestic box office: $140 million.

'Napoleon Dynamite'
(2004). Yes, there was a backlash. Yes, a lot of people honestly hated it from the beginning. But you wouldn't have known that in Park City that cold January seven years ago. As soon as Jared Hess' oddball comedy had its first public screening, the town was abuzz. (The town was also soon inundated with "Vote for Pedro" stickers.) Fox Searchlight bellied up to the bargaining table and made themselves a tidy pile of quesadilla money. Sundance sale price: $3 million. Domestic box office: $46 million.

'Little Miss Sunshine' (2006). Two years after its 'Napoleon Dynamite' success, Fox Searchlight struck gold again, this time breaking records in the process. The distributor paid $10.5 million for the film -- the biggest deal in Sundance history -- and bought not just U.S. rights but worldwide rights. (Normally a distributor will buy a film for North America only, leaving foreign companies to strike their own deals for worldwide distribution.) Some Oscar nominations came along eventually, but in the meantime... Sundance sale price: $10.5 million. Domestic box office: $60 million. Foreign box office: $40 million. Total box office: $100 million.

'Precious: Based on the Novel Push By Sapphire' (2009). It was just called 'Push' when it premiered at Sundance, and Oprah Winfrey and Tyler Perry had nothing to do with it. Then Lionsgate snatched it up for $5 million, Winfrey and Perry lent their names to its promotion, and soon all America was marveling at Mo'Nique's villainy and Mariah Carey's mustache. Sundance sale price: $5 million. Domestic box office: $48 million.

5 Worst Sundance Purchases

'Happy, Texas' (1999). Oh, man. This is the 'Ishtar' of Sundance deals. The light comedy -- with Steve Zahn and Jeremy Northam as escaped criminals hiding in a small town by pretending to be the gay organizers of a beauty pageant -- was purchased by the Weinsteins, back when Miramax was the heavy hitter in this world. They upset a lot of people in the process (as described in this contemporary account in the Los Angeles Times), allegedly throwing their weight around and muscling other distributors out of the bargaining process. Miramax says it paid $2.5 million for the film, but pretty much everyone else says it was actually more like $10 million. Either way, it was a bust. What was supposed to be a big crossover hit -- the quirky indie comedy that regular folks will love, too! -- tanked. Miramax's luster was already fading after a decade of influence, and this accelerated the process. Sundance sale price: somewhere between $2.5 and $10 million. Domestic box office: $2 million.

'Son of Rambow' (2007). After an intense bidding war, Paramount Vantage paid $8 million for this nostalgic and raucous English comedy about two mischievous young boys, and I was one of many people who thought they could make a fortune with it. Then, for reasons that remain mysterious, they waited a year and a half to release the film, then delivered it during the competitive summer months. It's a shame, because this one deserved a lot more attention than it got. Sundance sale price: $8 million. Domestic box office: $1.8 million.

'Grace Is Gone'
(2007). The Weinsteins again, now operating as The Weinstein Company and showing they could screw things up just as efficiently as they had when they were Miramax. John Cusack starred in this drama about a father who must tell his young daughters that their mother has died in Iraq, and some people were talking Oscars as soon as it played at Sundance. The Weinsteins grabbed it, gunning to reclaim their former glory, held it for the end-of-the-year awards season ... and then saw it disappear. Unable to gain any traction with critics or audiences, it never played on more than seven screens and was quickly forgotten. Sundance sale price: $4 million. Domestic box office: $50,000 (that is, $0.05 million).

'Hamlet 2' (2008). Steve Coogan's surreal and outlandish comedy about a delusional drama teacher was a last-minute addition to the 2008 festival, and it sparked an all-night bidding war once it screened. As R-rated comedies were becoming a box-office commodity again, this looked like it could be a major hit. Focus Features shelled out $10 million for it, promoted the living crap out of it all year, opened it in wide release, then watched in what must have been horror and alarm as it crashed and burned. Sundance sale price: $10 million. Domestic box office: $4.8 million.

'Buried' (2010). Here's another one that looked like a sure-fire hit. Ryan Reynolds is a big star; the concept is cool; it got great reviews right out of the gate from critics of all stripes; what could go wrong? That's what Lionsgate was thinking, anyway, when it paid $3.2 million for it. What Lionsgate was thinking when it subsequently dumped the film on a hundred screens, basically burying it, is anyone's guess. Sundance sale price: $3.2 million. Domestix box office: $1 million. (It made another $17 million internationally -- but Lionsgate only had the North American rights. That $17 million went to a variety of other distributors.)