Note that getPanels() returns an array (children) and it is unsafe to use a for-in loop on arrays in JavaScript.