/*
 * Advert killing user CSS file
 *
 * Author: Thomas Hurst <freaky@aagh.net>
 *                      <tom.hurst@clara.net>
 *
 * Version: 1.13
 *
 * Released: 06 Apr 2002
 * Revised:  22 May 2002 (Couple more iframes)
 * Revised:  05 Jun 2002 (More /. banners; they're now even bigger)
 * Revised:  25 Jul 2002 (Kill new freshmeat banners)
 * Revised:  01 Oct 2002 (Kill even bigger freshmeat banners (160*600)
 * Revised:  15 Oct 2002 (Kill 0-width cookie setters, kill a[target="_blank"])
 * Revised:  21 Oct 2002 (Be more thorough with Wired ads)
 * Revised:  28 Oct 2002 (Add CSS3-based href/src killers for Mozilla)
 * Revised:  29 Oct 2002 (Unkill a[target="_blank"] due to false positives)
 * Revised:  02 Nov 2002 (Kill adview.php, unblock /banner, block /banner/)
 * Revised:  12 Dec 2002 (Kill 180*150 as specified in new IAB recommendations)
 * Revised:  15 Dec 2002 (Remove spurious { in URL filters, spotted by Olivier Mengué)
 * Revised:  06 Apr 2003 (Remove td[valign="top"] a img[width="150"], it breaks "Gallery")
 * Revised:  20 Apr 2003 (CSS href killers for logging.to seen on thehun (hi alastair!))
 * Revised:  16 Jun 2005 (Click to run Flash)
 *
 * Latest release: http://www.aagh.net/files/anti-banner.css
 *
 * This stylesheet is emailware.  If you use it and find it useful (or not),
 * drop me an email so I can use it to stroke my ego or make the stylesheet
 * better.
 *
 * Any modifications are welcome and encouraged, but do please keep my
 * authorship attached to the relevent parts if you do use it elsewhere.
 */

/*
 * Various standard banner sizes; often hidden behind an iframe so the image
 * lacks size. May be worth investigating changing the 'a' to a[target="_top"]
 */

iframe[width="120"][height="600"], a img[width="120"][height="600"],
iframe[width="125"][height="600"], a img[width="125"][height="600"],
iframe[width="150"][height="100"], a img[width="150"][height="100"],
iframe[width="150"][height="600"], a img[width="150"][height="600"],
iframe[width="160"][height="600"], a img[width="160"][height="600"],
iframe[width="180"][height="150"], a img[width="180"][height="150"],
iframe[width="300"][height="250"], a img[width="300"][height="250"],
iframe[width="336"][height="280"], a img[width="336"][height="280"],
iframe[width="468"][height="60"],  a img[width="468"][height="60"],
iframe[width="470"][height="62"],  a img[width="470"][height="62"],
iframe[width="728"][height="90"],  a img[width="728"][height="90"],
iframe[width="730"][height="92"],  a img[width="730"][height="92"] {
	display: none !important;
}

/* Generic Doubleclick iframes */
body > a[target="_top"] > img {
	display: none !important;
}

/*
 * Generic Doubleclick <script> hacks 
 *
 * Really we want to select only img without width/height.  Maybe with CSS3.
 */
/* Disabled
a[target="_blank"] img {
	display: none;
} */

/*
 * More generic banner killing making use of most common attributes.
 * Potential false positives on frames based sites; unlikely, though,
 * since their nagivation bars will rarely target outside the frameset.
 * I don't think Opera supports selecting on border, unfortunately.
 */
a[target="_top"] img[border="0"],a[target="_blank"] img[border="0"] {
	display: none !important;
}

/*
 * CSS3 selectors
 *
 * src/href selecting, mostly from Adrian Holovaty;
 * <F4gh7lReFYEgaA4FuSq0000a673@hotmail.com> on css-discuss
 */
*[href*="doubleclick.net"], *[href*="doubleclick.net"] *,
*[src*="doubleclick.net"], *[src*="doubleclick.net"] *,
*[href*="/adx/"], *[href*="/adx/"] *,
*[src*="/adx/"], *[src*="/adx/"] *,
*[href*="/ads/"], *[href*="/ads/"] *,
*[src*="/ads/"], *[src*="/ads/"] *,
*[href*="/adserver."], *[href*="/adserver."] *,
*[src*="/adserver."], *[src*="/adserver."] *,
*[href*="/adfarm."], *[href*="/adfarm."] *,
*[src*="/adfarm."], *[src*="/adfarm."] *,
*[href*="/adlog.pl"], *[href*="/adlog.pl"] *,
*[src*="/banner/"], *[src*="/banner/"] *,
*[src*="/adview.php"], *[src*="/adview.php"] *,
*[href*="logging.to"] {
        display: none !important;
}

/*
 * Site-specific rulesets
 */

/* The Register */
/* FIXME: can probably match something specific to gallery to avoid this */
/*td[valign="top"] a img[width="150"],*/
img[alt="Advertisement"], .advert {
	display: none !important;
}

/* The Inquirer, with it's Flash-based adverts */
iframe[width="600"][height="120"], object[width="125"][height="300"] {
	display: none !important;
}

/* SlashDot middle-of-the-article ads */
table table table[width="346"][height="280"] {
	display: none !important;
}

/* Freshmeat's new side adverts */
a[target="_top"] img[width="125"][height="375"] {
	display: none !important;
}

/*
 * Webbugs - of questionable value and potentially breaking spacer-gif using
 * sites.  Seems OK here, *shrug*.
 *
 * Won't help much in Opera, which requests banners even with display: none;
 */
img[width="1"][height="1"] { display: none; }

/* The Register and their oddball zero size cookie setting images */
img[width="0"][height="0"] { display: none; }

/* Set flash to click-to-run, probably only works properly in Opera */
embed[type="application/x-shockwave-flash"] {content:"Flash"; outline: 1px dotted gray; color: gray; background: black} 
embed[type="application/x-shockwave-flash"].zichtbaar {content: normal; outline: none} 

body:before {
position: absolute; visibility: hidden; 
background-image: url("javascript:(function(){window.onclick=function(){var srcElem=window.event.srcElement;var tag=srcElem.tagName;if(tag=='EMBED') srcElem.className='zichtbaar'};})()"); 
content:""
}
