That sounds like you may have a slight infection or similar initially, nothing sinister as such from what you've said, but possibly a minor hijack attempt, albeit a minor one, my suggestion is to get some protection and run some scans to check and be safe, obviously you have your wits about you, thats a massive part of the battle, but even clicking a pop up to close it can "sometimes" be enough to do something.
Not knowing what protection you may have\run, I suggest the following tools incase you don't have them, needless to say update and run full scans initially, then use as part of regular maintenance say running 1 tool a week or similar for peace of mind:-
SUPERAntiSpyware Free Edition
Once those are done to aid blocking such events in the future I suggest you get and use the following tools, you need to check them for updates and apply when needed, these tools will aid blocking known bad sites:-
(requires special procedure for vista and windows 7, it gives instructions on the page if needed)
(helps block flash based files)
I also suggest the following junk file cleaners for use in general maintenance, these will help remove cookies etc that can be used to track your usage and steer you to related type sites in searches etc, but as well as that they just remove junk etc and help make the system run smoother:-
Check the boxes, select Options and check the top box that says "Delete Locked Files..." then save and run, you only need to access the options once, but as you use tools for the 1st time with this installed more boxes will appear so check those when they come up to clear junk from those as well.
Watch out for the list of check boxes during the install, remove the bottom one for installing the Yahoo toolbar, unless you want it that is.
Especially useful for cleaning after an infection, the link to download it is in the small print text in the description, click on it's name for the download, hopefully this will make sense when you see it.
Now I don't use Firefox for my main browser, so don't really know the best add in's to use with it, but I'm sure if you go to the Firefox site, you will find numerous additions for it to aid with blocking pop up's and the like, my best advice is if they have a most popular type listing then you should have a good idea of the most sort after extras, then with all this done you should find the issues you currently face far and few between, hope this helps.