Some JS function helpers I use regularly