I felt it would be a more logical order to get the zindex ready before displaying it.

Seems weird ot display something that is not there yet to display, even if it is just for a flash or if a browser handles it.