Several things.
We do not know what browser you are using for starters. It could be a toolbar for the browser, a BHO, a rogue app, a plugin, a search hijack, a registry hijack or a dns exploit at play. It does not even need to be a browser issue itself, it could simply be a program running in the background. Just to name the basic ones as there are others that can do the same things.
Few rules of the road,
*) Uninstall all toolbars, even google, yahoo, aol, all of them remove them.
*) remove any program you are not using in control panel - add/remove programs (or modern os programs and features_
*)
ccleaner, purge that old junk. you want to check some additional boxes but read what they do first.
*) program called '
rogue killer' you can get it from major geeks, 2 versions, 32 bit and 64 bit. run that. do the scan and afterwards delete and 'fix' everything except the shortcuts, even if it's 'clean', that would be dns.
Browsers must be closed for those 2 programs to work properly.
Adblock plus in firefox is a blessing. I also recommend flash block.