Keeping Your Elements’ Kids in Line with Offspring by Alex Bischoff and published over at A List Apart is an excellent article introducing a Javascript library for mimicking CSS pseudo classes such as :first-child, :last-child, and so forth.
An excellent resource considering the number of browsers (including Firefox) that have spotty support for some of these selectors.