Client side javascript utilities