It's probably already infected your machine. Go get copies
of Ad-Aware and Spybot (both free) and run them. That
should clean your machine.
When done you might want to consider a different browser
such as Firefox, Opera, Konqueror, etc which have built in
pop-up blocking to prevent ads from appearing in the first
place.
Another option might be to get Googles Toolbar which has
pop-up blocking built in as well.