// ==UserScript==
// @name           Brainstorm Enhancements
// @author         Andrew Keyes
// @homepage       http://www.ahotw.com/
// @version        0.0.01
// @description    Hides the solutions to make it easier to quickly scan a list of Ideas. Solutions can be restored by a simple click. Alpha version.
// @namespace      http://www.ahotw.com/gmscripts/brainstormenhancements
// @include        http://brainstorm.ubuntu.com/*
// @exclude        http://brainstorm.ubuntu.com/idea/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

$ = unsafeWindow.jQuery;
$(".choicelisting > tbody > tr > td > table:last-child").each(function () {
	var buttonStyle = {
		'-moz-border-radius':	'5px',
		'cursor':				'pointer',
		'padding':				'.2em 1em',
		'text-align':			'center',
		'border':				'1px solid #CCC1A3',
		'background-color':		'#CCC1A3',
		'color':				'#5A3320',
		'font-weight':			'bold'
	}
	$(this).before("<div class='hide hideshow'>Hide Ideas</div>");
	$(this).hide();
	$(this).siblings(".hide").hide();
	$(this).before("<div class='show hideshow'>Show Ideas</div>");
	$(".hideshow").css(buttonStyle);
	$(this).siblings(".show").click(function () {
		$(this).siblings(":last").show(300);
		$(this).hide();
		$(this).siblings(".hide").show();
	});
	$(this).siblings(".hide").click(function() {
		$(this).hide();
		$(this).siblings(":last").hide(300);
		$(this).siblings(".show").show();
	});
});