There is almost no chance that your computer has contracted a virus.
Not impossible, but rather unlikely since there are other things you
may have downloaded by accident in the process of getting other
content, that can cause a computer to act up.
Could be an Adware product that has your system messing up; or
perhaps some kind of thing that generally can be called malware.
•Tech Guides - TheSafeMac:
http://www.thesafemac.com/tech-guides/
Mac Malware Guide:
http://www.thesafemac.com/mmg/
Some kinds of things can re-direct your browser, so you always get
certain content or popups, and if you click on them, then you may
actually install something bad. More adware or a malware product.
If your computer has more than one user account, you could restart
the computer into a different account and access the internet to do
research, and then be careful what you choose, & where you get it.
For this to work, it needs to first connect to TheSafeMac.
•Ad Medic - adware removal:
http://www.thesafemac.com/admedic/
You could get and try this Adware removal tool, to see if the problem
is resolved. The product will work without charge, & is donationware.
A method of manually removing adware is covered in this page:
•Adware Removal Guide:
http://www.thesafemac.com/arg/
Sometimes you can start a computer in SafeBoot mode, to see about
removing some items affecting a browser, add-ons & extensions such
as those which are installed by adware or other dubious products.
You could get & run this product* and post the report it generates to
an ASC discussion here, so those who may read it and recognize
some of the topical and incidental evidence of adware or other, can
suggest removal methods. Most methods are covered in above links.
*Etrecheck: (see the 'read about' link, too)
http://www.etresoft.com/etrecheck
Usually an antivirus scan cannot find much in a Mac because there are
no known in-the-wild viri that attack the Mac OS X. But A.V. scanning
and bulk waste of processor cycles can slow down a Mac and also
some of those applications people get to fix their mac mess it up bad.
You may have installed a 'cleanmymac' or mackeeper, etc, so check
to see how to remove that, and then look again. Odds are anything
you remove incorrectly will still affect the system, and some uninstall
methods proposed by adware and malware makers, add more junk.
You could try to start the Mac in Recovery mode, and reinstall the OS X.
Hopefully you can remove the problematic items w/o messing up OS X.
Good luck & happy computing! 🙂