adding javascript snippets