Improve sorting of links

* more stable in IE7
* prevent potential change of sort order in the unlabelled items