The story for the film was originally inspired by a piece of graffiti director Robbie Moffat saw on a toilet wall in Glasgow. Securing a grant from the Scottish Arts Council in late 2003, he developed a unique 'interactive community collaboration program' where the initial synopsis was plastered on the walls of public toilets in Glasgow, Edinburgh, Abderdeen and John O'Groats and further plot developments were added by members of the public, chain-story style. The various plot developments were then posted on the now defunct 'RainingintheToilet.com' website created for the film, and the public were invited to vote on which ones should be included in the screenplay for the finished film. Although only 37 people responded - the majority either members of the cast and crew or their immediate family - this formed the finished screenplay. To add a further element of 'serendipitous chaos,' the cast were only given a broad outline of the story and only told of the content of scenes before they were filmed. In three cases, most notably the key robbery scene, the cast were not told the content of the scene until after it had been filmed because Moffat hoped the actors would inhabit their roles so completely that they would intuitively do what was in the script. Although this did not prove to be the case, Moffat left the cast's version of the robbery in the film on the grounds that "it was raw honesty, and truth is always better than fiction."