// ==UserScript==
// @name Shacknews Mod Marker
// @namespace http://misterphoton.shackspace.com/greasemonkey/
// @description Custom CSS for marking who the Shacknews mods are
// @include http://*.shacknews.com/laryn.x?*
// @include http://shacknews.com/laryn.x?*
// @exclude http://bananas.shacknews.com/*
// @exclude http://*.gmodules.com/*
// ==/UserScript==
/*
	Shacknews Mod Marker
	Author: Matt Lindell
   Inspired and assisted by: Thom Wetzel - www.lmnopc.com

	Revisions
	---------
	2010-02-23 
		* Added Dave-A
	
	2009-01-29
	  * Fixed so mods could potentially use this script and not lose the blue highlighting on their posts
	
	2009-01-29
	  * -chris remo
	  * +mikecyb	  
	
	2008-02-14
	 	- arhughes pointed out that var cs; should be var cs = '';

	2007-07-19
		- Initial release
*/
(function() {

	var benchmarkTimer = null;
	var scriptStartTime = getTime();
	function getTime() { benchmarkTimer = new Date(); return benchmarkTimer.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);
		}
	}

var mods = new Array(
		4		, // Steve Gibson
		43653 , // Maarten Goldstein
		3259	, // degenerate
		10028 , // drucifer
		168479, // ajax
		5334  , // dante
		7438  , // enigmatic
		169489, // s[genjuro]s
		8105  , // hirez
		5278  , // lacker
		6674  , // pupismyname
		32016 , // thekidd
		1194  , // zakk
		171402, // brickmatt
		6585  , // carnivac
		168256, // edgewise
		169197, // filtersweep
		9980  , // haiku
		44583 , // jokemon
		3243  , // p[multisync]p
		169049, // rauol duke
		8349  , // sexninja!!!!
		6933  , // tomservo
		9085  , // busdriver3030
		8048  , // cygnus x-1
		6380  , // dognose
		167953, // edlin
		12398 , // geedeck
		171127, // helvetica
		7570  , // kaiser
		8316  , // paranoid android
		9031  , // portax
		9211  , // redfive
		7660  , // sexpansion pack
		169927, // sgtsanity
		15130 , // utilitymaximizer
		169942, //mikecyb
		185650 // Dave-A
   );

	// create css rules
	var css = '';
	for (var i = 0; i < mods.length; i++)
	{
		css += 'div.olauthor_' + mods[i] + ' a.oneline_user, .fpauthor_' + mods[i] + ' span.author>a, ';
	}

	// truncate trailing ','
	if (css.length)
	{
		css = css.substr(0, css.length - 2);

		// add the color onto the css
		css += ' { color: #af0 !important; }';
		
		// fix so mods could potentially use this script: 
		css += 'div.oneline a.this_user { color: rgb(0, 191, 243) !important; }';
		
		// create the new style block
		addGlobalStyle(css);
	}

	// log execution time
	if (GM_log)
	{
		GM_log(location.href + ' / ' + (getTime() - scriptStartTime) + 'ms');
	}

})();

