// ==UserScript==
// @name           Toadless
// @namespace      http://www.biancolo.com
// @description    Hide Toad's posts on RSD in Google Groups
// @include        http://groups.google.com/group/rec.sport.disc/*
// ==/UserScript==


function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('.bye { display: block; font-size: 0.8em; color: #666; text-decoration: none; padding: 0; margin: 0; }');

// Add jQuery
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

// Check if jQuery's loaded
function GM_wait() {
   if(typeof unsafeWindow.jQuery == 'undefined') { 
      window.setTimeout(GM_wait,100); 
   }
   else {
      $ = unsafeWindow.jQuery; 
      letsJQuery(); 
   }
}
GM_wait();

// All your GM code must be inside this function
function letsJQuery() {
   $(".bye").live("click", function() {
      $(this).hide();
      $(this).siblings("#inbdy").show();
      return false;
   });

   // Add users to filter here, start with Toad
   var bye = $("input[value^='ulticritic']");

   // Uncomment the line below (remove slashes) to filter Gerics.  Copy it and modify to block others.
   // bye = bye.add("input[value^='Reggie Fanelli']");  

   bye = bye.siblings("#body").children("#inbdy");
   bye.before('<a href="#" class="bye">&lt;show&gt;</a>');
   bye.hide();
}

