added some javascript snippets