Javascript String toUrl()
toUrl()
String.prototype.toUrl = function() { return this.replace(/ /g,'_'); };