The film's history traces back to when the project was originally at Miramax under Disney's banner around 1995, when the Weinsteins were running that division. This is one of several projects that they took with them when they sold their stake of Miramax to Disney outright in 2005 and then announced a distribution deal with MGM soon after that this film was among those such as Lucky Number Slevin (2006), Clerks II (2006) and 1408 (2007) to name a few.
The release date changed several times because the film has undergone a series of re-shoots after it's original completion date in January 2006.
All the scenes involving corrupt cop Ferris Britton (Johnny Knoxville) were cut from the final movie because test screenings audiences didn't like the character.