prova così e fammi sapere
codice:
function capitaliseFirst( str ) {

   var apice=str.Replace("'","#")

    var str = apice.toLowerCase();
    var words = str.split(' ');
    for (x=0; x<words.length-1; x++ )
      words[x]=words[x].substring(0,1).toUpperCase() + words[x].substring(1);

   

    return ( words.join(' ').Replace("#","'") );
}