$(document).ready(function() {
	
	// First check for empty paragraphs
	
	$("p:empty").remove();
	
	
	/*  Add the reveal functionality
	*   
	*	It looks for divs of revealblock class, uses the first child element as
	*   the "trigger". It puts a line of instructional text before the first instance
	*	of the class.
	*	All child elements are hidden on page load, and toggled in with a fade on trigger click
	*
	*/
	
   var el = $('div.revealblock');
   $(el).eq(0).before("<span class=\"ui_instruction\">(click the heading to reveal the text)</span>");
	$(el).children(":not(:first-child)").hide();
   		
		$(el).children(":first-child").addClass("revealHeader").css({cursor:"pointer"});
		$(el).toggle(
			function() {
				$(this).children(":not(:first-child)").fadeIn("slow");
				if (jQuery.browser.msie) {
					$(this).children(":not(:first-child)").style.removeAttribute('filter');
					$(this).children(":not(:first-child)").css("background","#7d8254");
				}

			},
			function() {
				$(this).children(":not(:first-child)").fadeOut("slow");
			});	
 });
//-->