client side of a javascript widget: fun stuff