It would help a great deal if we had some details about those pop-ups. And also about the 'unrelated link' once clinked on. Are the pop-ups always the same? What do they say? Are they ads?
Do you know what contextual advertising is? Could it be contextual advertising you're referring to?
Under certain circumstances, I might suggest installing the Adblock Plus add-on. Under other circumstances, I might suggest NoScript. Without knowing more about the pop-ups, the above would only be considered "a stab in the dark". It's why details are important.
In the meantime, I would suggest scanning with the below, if you haven't done so already.
ESET's Online Scanner - Their FAQ and Help sections should answer any questions you might have. (Temporarily disable NIS prior to running the scan)
Hitman Pro - It's free to use without a license. If a virus is found, you will receive a free 30-day license to remove the threat. Note: There are separate downloads for 32 and 64-bit versions of Windows 7.
"It's all in the details"
I am a Win 7 user, browsing with Firefox. Lately I have found that when I mouse over any hyperlink in web text, I get a pop-up that is unrelated to the link and if I click on it it takes me to the unrelated link. I have scanned for adware and virus infection, but nothing changes. I use Norton Internet security.