Changed "string[i]" references to "string.charAt()".
This was done for compatibility mode when running google earth in IE 10 & 11.
Compatability mode, I'm told, forces IE 7 standards and you can't reference a string by index in IE 7.