Common use JavaScript functions and snippets