From your description, it sounds like 'Keyword Advertising'.
The links and the popups are created by javascript which is called up by the web-page - so they're legitimately part of the site.
From my own experience, the scripts are most often provided by a site called "intellitxt.com".
So, blocking scripts from that site will usually get rid of the annoyances.
There's a wikipedia article which describes this tuff :
"http://en.wikipedia.org/wiki/Intellitext"