This is the source codes for farbox.com, it also can be treated as a template.