use `substring(0, 1)` instead of `[0]` to get the first character of a string, because IE7 does not support the latter one.