use charAt() instead of brackets to access string character

IE7 does not support bracket access to string characters and errors:
http://stackoverflow.com/questions/5943726/string-charatx-or-stringx