Code from Brig's talk on javascript functions