Some JavaScript snippets.