IE7 js error fix

IE7 doesn't allow access to char in a string using index