You've downloaded some adware somewhere. This will probably be one of the apps you've downloaded (I don't think an advertising script in a browser could do what you describe, though I'd clear your browser caches anyway). To confirm try running in safe mode: if it doesn't happen there it's one of your apps. Then the problem is working out which one.
It could be something installed not long before this started, but it could also be an update to a previously benign app.