javascript utilities