Capitalize first letter of words of a string
function capitalizeWords(str) {
var splitStr = str.split(' ');
for(var i in splitStr){
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
}
return splitStr.join(' ');
}