// ==UserScript==
// @name          	Plain Old Fanfiction
// @namespace     	http://www.animejb.net
// @description  	Turns colorful pages to black and white for work-safe reading. :) 
// @version       	1.1
// @include	http://jeruind.i8.com/*
// @include	http://dilbertblog.typepad.com/the_dilbert_blog/*
// @include	http://anime.adultfanfiction.net/*
// @include	http://www.digital-quill.org/*
// ==/UserScript==

//accepts a CSS string and dynamically adds it to the head of the document
function buildStyle(cssStr){
	var newStyle = document.createElement("style");
	newStyle.setAttribute("type", "text/css");
	if(newStyle.styleSheet){// IE
		newStyle.styleSheet.cssText = cssStr;
	} else {// w3c
		var cssText = document.createTextNode(cssStr);
		newStyle.appendChild(cssText);
	}
		
	document.getElementsByTagName("head")[0].appendChild(newStyle);
}

var cssStr =  "body, p, div, table, tr, td, li, h1, h2, h3, h4, h5, blockquote, span {font: 1em/1.5 serif !important; background: #FFF !important; color: #000 !important; }";
	cssStr += "a:link, a:active, a:hover { color: blue !important; font: 1em/1.5 serif !important;}";
	cssStr += "a:visited { color: #551A8B !important; font: 1em/1.5 serif !important;}";
	cssStr += "img, object, embed { display:none !important; }";

buildStyle(cssStr);
