// Extra-good text formatting hints for RedBubble.
// Version 0.2
// 2008-03-07
// Copyright (c) 2007-2008, Dave Pearson <http://www.davep.org/>
// Released under the GPL
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.  To install it, you need
// Greasemonkey: http://www.greasespot.net/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "RedBubble Text Format Hints", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          RedBubble Text Format Hints
// @namespace     http://www.davep.org/
// @description   Gives extra-good text formatting hints.
// @include       http://www.redbubble.com/*
// ==/UserScript==

// First we grab all the ul tags in the page.
var ulists = document.getElementsByTagName( 'ul' );

// Now we loop over them looking for those of id 'formatting-hints'.
for ( i = 0; i < ulists.length; i++ )
{
   // If we've found one...
   if ( ulists[ i ].id == 'formatting-hints' )
   {
      // ...nuke it with webgrrl's extra-handy cheatsheet.
      ulists[ i ].innerHTML = '<a href="http://www.redbubble.com/people/webgrrl/art/84227-7-the-unofficial-redbubble-format-cheatsheet-thang" target="_blank"><img src="http://images-3.redbubble.com/img/art/size:large/view:main/84227-7-the-unofficial-redbubble-format-cheatsheet-thang.jpg" /></a>';
   }
}
