A set of JavaScript utility functions