Once you are certain you have no malware installed there is an Adblock plus Pop-up Addon you can install to stop the gambling ad appearing if you are using Firefox and Adblock plus.

https://addons.mozilla.org/en-US/firefox/addon/adblock-plus-pop-up-addon/

It "extends the blocking functionality of Adblock Plus to those annoying pop-up windows that open on mouse clicks and other user actions."

 
Did you manage to get your machine functioning as expected using CCleaner?