some javascript utilities