Some useful javascript functions from me