Javascript String replaceExtension(newExtension)
String.prototype.replaceExtension = function (newExtension) { return this.substring(0, this.lastIndexOf('.')) + newExtension; }