Better use jquery's .each to avoid messing up old browsers here.