To prevent future nonsense I suggest NOT using Internet Explorer for one.
When using Firefox or Chrome, install "NoScript" addon. It is a little pain in the butt at the beginning as it "learns" what you want to allow. Basically it blocks all scripts that are not native with the browser itself.
But a lot of sites use scripts (like this one) - you just have to click "ok" alot for a few days as you teach it what sites you allow scripts to run on.