This line is pretty critical also...
setInterval(updateLayout, 1400);
So, every 1.4 seconds it will check the width of the browser window in the updateLayout function.
They have a variable called isiPhone that checks the user agent for the string "iPhone". Otherwise it would work in any browser with a width of 320px and change on any other width.