Capitalize From http://codereview.stackexchange.com/questions/77614/capitalize-the-first-character-of-all-words-even-when-following-a
String.prototype.capitalize = function(){
return this.toLowerCase().replace( /\b\w/g, function (m) {
return m.toUpperCase();
});
};
var myString = 'foo';
window.alert(myString.capitalize());