The third shell can hold up to 18 electrons (2 in the 3s, 6 in the 3p, and 10 in the 3d), but the 4s orbital starts filling before the 3d orbitals. Similarly the 5s orbital fills up before the 4d and 4f orbitals. Because the 3d orbitals don't fill up until after the 4s orbital fills, the 3d electrons are considered valence electrons for atoms in the 4th period, not atoms in the third period. As a result, 3rd period atoms can have only 8 valence electrons, while 4th period atoms can have 18 valence electrons (however, there are exceptions where the valence shell of 3rd period atoms expand to include the 3d orbitals). For more info see
http://en.wikipedia.org/wiki/Aufbau_PrincipleHowever, the side column looks like it has some wrong info. I should go fix that.
[edit: I added some clarification to the section on valence electrons in the wikipedia article. Let me know if this helps clarify things.]