I thought they would be unrelated.
Im about 90 percent certain that your mac has been infected with viruses, and adware.
Mac are relatively new to the virus scene, but there are free programs we can run that will help remove the viruses causing these popups, and protect your safety on the computer.
Lets try this program first :: Virus barrier x6 http://www.intego.com/virusbarrier
Im not suggesting that you purchase the program, What I would like you to do though is download the Free Trial.
Once downloaded, install the free trial.. Then, run the Virus Barrier program
let it scan your entire mac, and im certain that this should find viruses.. let it remove any viruses it finds.
Once it has removed the viruses.. restart the mac.
Then we need to do one more manual repair.
To open Disk Utility, from the Applications folder, open Utilities, and then double-click the Disk Utility icon.
In the column on the left, click your startup disk.
Click the First Aid tab, and then click Repair Disk Permissions. Disk Utility will reset any files and folders with incorrect settings.
Once this is done.. test out safari.. Are the random popup messages gone now?
If you run into any issues, or if this doesnt work, let me know so that I can continue to assist you.
You can get back to me on this same question, the same way you have been doing.. Just send me a reply.
Log into JustAnswer.com, then on the Top right, click on my questions
Then, click the "reply to expert" next to my face..
If my answer helped, please click one of the smiley faces to rate the solution, and then click the green accept button to accept the answer..
If my answer did not work, please wait to rate the answer and also wait to accept and instead send me a reply so that I can continue to assist you as needed.