misc javascript utility functions created over time and needed in different project