for loop change

using for (i=0;i<array.length;i++) rather than for (i in array) for support in non-JSON browsers