// ==UserScript==
// @name Safe-For-Work Shack
// @namespace http://www.lmnopc.com/greasemonkey/safeShack/
// @description Custom CSS for making Shacknews a little more safe-for-work
// @include http://*.shacknews.com/*
// @include http://shacknews.com/*
// @exclude http://www.shacknews.com/online/online_jazz.x
// ==/UserScript==

	var version = 20070618;

/*

	Safe-For-Work Shack v 2007-06-11
	Author: Thom Wetzel - www.lmnopc.com
	(C)2007 Thom Wetzel

	If you like this script show me some love (or shiny things)
	Amazon Wish List: http://amazon.com/gp/registry/1YRBQ22VGN9PR

	Revisions
	---------
	2007-07-23
		- Fixed spoiler tag issue for Stylish users.  Doesn't really affect the 
			users of the Greasemonkey script, but I wanted to keep them synced up. 
	2007-07-20
	 	- PhotonTheGreat: Added CSS that fixes search results
	2007-06-21
		- Fixed postmeta so inf/nws banners show up
	2007-06-18
		- Spoiler tags fixed (AGAIN)
		- Misc things
	2007-06-11
		- Shack 2.0
	2006-07-21
		- Taken out of beta
	2006-03-29
		- Fixed the alt-post form preview
	2006-03-21 BETA
		- Fixed missing text in profile window
	2006-03-17 BETA
		- Fixed the spoiler tag again  ;)
		- Fixed the shack message navigation text
	2006-03-15 BETA
		- Experimenting with coloring some of the blocks
		- Modified formatting on the front page to help make it easier to read
	2005.07.06
		- Replaced document.title -- It Gets You Chicks isn't very work-appropriate  ;)
		- Replaced alert() with confirm() that will automatically open the script's
			homepage when the user clicks OK in the new version notification dialog
		- Fix: Users won't be notified of an update more than once now
	2005.07.01
		- Fix: .cmtprevline borders changed from transparent -> white for IE
	2005.06.30
		- addGlobalStyle() replaced and it's now faster and IE/Turnabout compatible
	2005.06.29
		- Fixed p, .highlight a
	2005.06.28
		- Automatic new version notification (test)
		- Shackmessage envelope image replacement
	2005.06.27
		- Tons of little fixes; most noteable is that the spoiler tag works again.
	2005.06.23
		- Initial release
*/

	// don't process the iframe
	if (window.name == 'bufferFrame')
		return;

	function getTime()
	{
		// Author: ThomW
		benchmarkTimer = new Date();
		return benchmarkTimer.getTime();
	}

	// grab start time of script
	var benchmarkTimer = null;
	var scriptStartTime = getTime();

	// thx http://meyerweb.com/eric/thoughts/2004/11/10/s5-11a2/
	function addGlobalStyle(string){
		if(/microsoft/i.test(navigator.appName) && !/opera/i.test(navigator.userAgent)){
			document.createStyleSheet().cssText=string;
		}
		else {
			var ele=document.createElement('link');
			ele.rel='stylesheet';
			ele.type='text/css';
			ele.href='data:text/css;charset=utf-8,'+escape(string);
			document.getElementsByTagName('head')[0].appendChild(ele);
		}
	}

	// replace document.title
	document.title = 'sfwShack';

addGlobalStyle(' \
* { line-height: normal !important; background-color: inherit !important; } \
a { color: #00f !important; } \
body, div, p, input, textarea { color: #000 !important; background-color: #fff !important; } \
input { border: 1px solid #000 !important; } \
div.oneline0 span.oneline_body { color: #000 !important; } \
div.oneline1 span.oneline_body { color: #111 !important; } \
div.oneline2 span.oneline_body { color: #222 !important; } \
div.oneline3 span.oneline_body { color: #333 !important; } \
div.oneline4 span.oneline_body { color: #444 !important; } \
div.oneline5 span.oneline_body { color: #555 !important; } \
div.oneline6 span.oneline_body { color: #666 !important; } \
div.oneline7 span.oneline_body { color: #777 !important; } \
div.oneline8 span.oneline_body { color: #888 !important; } \
div.oneline9 span.oneline_body { color: #999 !important; } \
div.threads ul ul li { background-image: url(data:image/gif;base64,R0lGODlhDAAyALMAAAAAACgoKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAMADIAAAQ8MIBJK5DW4kw3v18XTh5XZkGqruoIjqfmxhUtwnOO76FN6j3gx%2FcK8oZCUxK1lB2VT2bUaawip7VmdhQBADs%3D) !important; } \
div.threads ul ul li.last{ background-image: url(data:image/gif;base64,R0lGODlhDAAJAIAAACgoKAAAACH5BAEAAAEALAAAAAAMAAkAAAIRRI4ZpsqNHlwz1iNhbqD73xUAOw%3D%3D) !important } \
.postnumber a:link,.postnumber a:visited,.postnumber a:active,.postnumber a:hover { background-image: url(data:image/gif;base64,R0lGODlhZAAUALMAAAAAAP8A%2F8DAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAABkABQAAARlMMhJq7046827%2F2AojmRpnmiqrqngvi%2FbAXRdy5yA6XgGYL%2FeLgDj8YSWny0YRFaOT2cSKI0WJdCq0iZpVrGXrPbi%2FRJdWPH3FqCZh%2Bp3ey4Px%2BXuun7P7%2Fv%2FgIGCg4SFhociEQAAOw%3D%3D) !important; } \
.refresh a:link,.refresh a:visited,.refresh a:active,.refresh a:hover{ background-image: url(data:image/gif;base64,R0lGODlhZAAUALMAAAAAAP8A%2F8DAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAABkABQAAARWMMhJq7046827%2F2AojmRpnmiqrqvgsiMgw6Ew2bQHTHvO4TffpscTaoASpLFClDSXFKBrCmXyZLNq9PbSUohYb0UqtjrL6LR6zW673%2FC4fE6v2%2B%2F4dwQAOw%3D%3D) !important; } \
div.treecollapse { background-color: transparent !important; } \
div.treecollapse a:link,div.treecollapse a:visited,div.treecollapse a:active,div.treecollapse a:hover{ background-image: url(data:image/gif;base64,R0lGODlhHgA8ALMAAP%2F%2F%2F4CAgAAAAP%2F%2F%2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8A%2FyH5BAEAAA8ALAAAAAAeADwAAASA8MlJq7046827%2F2AojmRpnmiqrmzrvnAsV0Ft29utP8HVaz8az5cjBilHoqXHvA2BD4FUOkxKrMLlM5vBMpVdow4HHNdm6LR6zW67T%2BZz2bxFFrXB%2FD06%2BV77ewKATThYdlNUfluGgBKCf3p%2FUI6DYBhePHE5mm%2Bdnp%2BgoaIYEQAAOw%3D%3D) !important; } \
/* front page fixes */ \
div#topad { border-bottom: none; } \
div#header, div#masthead { background-image: none !important; } \
div#masthead h1 a { background-image: none !important; text-indent: 0 !important; font-size: 200% !important; } \
div#features { display: none !important; } \
div.topstories h3, div.topstories h4 { text-indent: 0 !important; font-size: 150% !important; } \
div#features div.community h2 { text-indent: 0 !important; font-size: 150% !important; } \
h2 { color: #000 !important; background-image: none !important; text-indent: 0 !important; font-size: 120% !important; line-height: 25px !important; } \
div.line { background-image: none !important; } \
div.headerbar * { background-image: none !important; text-indent: 0 !important; } \
h2.latestheadlinesheader { text-indent: 0 !important; font-size: 125% !important; } \
div#section3 h3 a { background-image: none !important; font-size: 120% !important; text-indent: 0 !important; } \
div#section3 a { color: #00f !important; } \
div#section3 div.feed { background-image: none !important; } \
span.hotfiles a { text-indent: 0; background-image: none !important; } \
span.jt_spoiler { color: #dddddd !important; background-color: #dddddd !important; } \
div.postmeta { background-color: transparent !important; } \
td.date {color: #000 !important; } \
tr.odd {background-color: #eee !important; } \
div.interiorcontent th, div.interiorform label { color: #000 !important; } \
');

	// log execution time
	GM_log((getTime() - scriptStartTime) + 'ms');

