Miscellaneous javascript utilities.