Mootools compatibility patch.

Changed for in loops to basic for loops in order to avoid iterating over prototype items added by mootools.