Some helpful javascript utilities