To Title case from text

From http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript/196991#196991