Common javascript utilities.