Different javascript snippets