Java script utilities