A one-second google search turned up this:
<a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1118198&#x2F;how-can-you-figure-out-the-highest-z-index-in-your-document" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1118198&#x2F;how-can-you-figur...</a><p>They should just use that to find the highest z-index, then add 1.  Totally future proof.