well.. he is right but you can some work at server also, in squid we uses acls to block specifc urls which might be ads,
To block some ads in squid ie.. the url with words ads, also some movie , mp3 etc then
acl BlockExt url_regex -i \.mp3$ \.asx$ \.wma$ \.wmv$ \.avi$ \.mpeg$ \.mpg$ \.qt$ \.ram$ \.rm$ \.iso$ \.wav$ \.exe$ \.ads$ \.popup$
# the above is single line
http_access deny BlockExt all
At browser level, in firefox there is a popup blocker , give it a try.