cascaded cf's parent might have multiple values selected

see also #16336
nothing else but indent fix
Iterate JS arrays with a C-style for loop, not for-in

for-in is not guaranteed to walk the arrays in order (although it often
does on most browsers).  Preserving order is important since we're
cloning and appending elements into another select.
Use local variable declarations instead of polluting global space
Merge branch '4.0/cascade-cf-with-multi-selected-parent' into 4.0-trunk