I know you say you've fixed the problem, but to avoid it from happening again, or if it happens again, I would suggest the following:
What browser are you using? If you are using Internet Explorer, I would say stop. Use Firefox. Mozilla, or Opera browsers. The newest I.E. is better than past versions, but I would still suggest Firefox or one of the others before IE.
The best thing to do would probably be for you to back up your important files, like whatever music, video, images, or anything else you don't want to lose, put those files on an external hard drive or burn them to disc and then reinstall your operating system.
You could also consider installing a Linux operating system. Ubuntu is one of the easier ones for people unfamiliar with Linux. You probably don't want to or have time to fuck with Linux though. If you do , look into it. You won't get bullshit pop-ups. That is jsut the beginning though, Linux systems give you much more control, if you are willing to learn how they work.
Avoid shady warez sites and shadier porn sites. Don't just blindly install any download you are offered, this often leads to more problems.
Or you could just buy a Mac.