Just some javascript code snippets