Great stuff Ricardo! Thanks for doing this. Just a small warning: you said "which equals the element's index in relation to its parent". Whilst this probably does work in most cases, be aware that (as far as I know) DOM elements are not guaranteed to be returned in the order they appear in the source (although they probably are most of the time). I think there was a recent jquery-dev thread discussing this.
@Aaron - I'm really interested to know if this solutions works - could you please report back if Ricardo's code fixes your IE z-index problem? Cheers Joel Birch.