a useful javascript function library