Using A Variable In A String Javascript Substring From Right