Extracting Parts of Strings in JavaScript: a substr Example