It's not really that complicated, if in fact my suggestion worked without causing any additional problem(s), the most likely possible problem being that the random link would then become the same throughout an entire session, though I tend to doubt that's possible.
Assuming all is well, here's the explanation -
The code in menuCode.txt is run twice per page load. Once (presumably the first time, but that might not be crucial) with $menuType set as 'button'. That produces the left side menu. Then another time with $menuType not set as 'button' (but, a fine point admittedly but perhaps of note, presumably set to something), that produces the bottom menu. If we make sure to only set $menuLabelIndex one out of these two times (as my code suggestion virtually guarantees), then you will have the same random link in both iterations. And, as I say, the most likely complication would be if $menuLabelIndex somehow survives into subsequent page load(s) in the session. That's doubtful, but to know that for sure I would need to see more code and/or run the pages numerous times and see what happens after the change. Anyways, if that were to be the case (unintended persistence beyond a single page), then the random link would persist throughout a given user's session - presumably until they left the site, or perhaps until they closed their browser.
As I say though - that's unlikely. If the new code doesn't present any persistent problems like that in - say 5 experimental tries, it's most likely a non-issue.
All that said, and even if it works as desired without any issues, I understand how leaving it as it was might be preferable. After all, as it was before we started investigating this it produced 2 random links per page - which isn't the worst thing, might actually be making things more interesting than the consistency you originally sought.
Edit: Was just looking at the pages again, looks like it's working with no problems.
Bookmarks