added some useful js snippets