i looks very lonely as the initialisation of
for (i; i < len; i++). Maybe it works but I've never seen it (and I'm pretty sure it won't work but without wanting to look at the official spec I can't be 100% sure).
Instead it should be
for (i[B]=0[/B]; i < len; i++)
Then you can also rewrite
var i = 0;
var len = allLabels.length;
var i, len = allLabels.length;
because you don't need to initialise
i outside the loop, just declaring it is enough.