Collection of useful small javascript function.