var slt = { /* Shorten the link trail by chopping off links from the beginning of it until it's no longer wider than the screen */ init: function() { slt.lt = document.getElementById('linktrail'); if (!slt.lt) return; /* Try and add links, in case we've just resized the window to be bigger */ var canContinue = true; while (canContinue && (slt.findRightEdge() < document.body.offsetWidth)) { canContinue = slt.addLinktrailElement(); } /* Now remove links until the linktrail is narrower than the window */ canContinue = true; while (canContinue && (slt.findRightEdge() > document.body.offsetWidth)) { canContinue = slt.removeLinktrailElement(); } }, findRightEdge: function() { /* get the position of the far right-hand-edge of the rightmost element in the linktrail */ var maxright = 0; for (var i=0;i maxright) maxright = rightedge; } } return maxright; }, removeLinktrailElement: function() { /* Walk through the link trail until we find a complete link; when we do, change its displayed text to "…", put its actual text in a tooltip, and return */ var links = slt.lt.getElementsByTagName('a'); for (var i=0;i