Added a shim for the forEach method.

To stop this script from breaking in browsers running in IE7/IE8 incompatibility mode, added a shim for the forEach method of an array.