javascript substring from right