including many useful javascript funcs