rewrite iphone.js in OO by coffee-script