function Drawer(rootElmtID)
{
	var rootElement = $('#'+rootElmtID);

	var children = rootElement.children(':even');
	children.click
	(
		function()
		{
			var next = $(this).next();
			var _this = $(this);
			if(next.is(':hidden'))
			{
				$(_this).css('margin-bottom', '0em');
				next.fadeIn('fast');
				//alert(next.html());
			}
			else
			{
				next.fadeOut('slow',
				function()
				{
					$(_this).css('margin-bottom', '1.25em');
					//alert('fadeOut')
				}
				);
			}
		}
	);
	children.each(function(){$(this).next().hide();});
	children.each(function(){$(this).css('margin-bottom', '1.25em');});
	children.first().click();
}

function makeSlide(root)
{
	$(root).children(':even').children('.foldable').click(
	function(event)
	{
		/*var targets = $(this).parent().next().children();
		for(var i = 0; i < targets.size(); i ++)
		{
			var target = $(targets[i]);
			if(!target.is(':hidden'))
			{
				target.hide();
				$(targets[(i+1)%(targets.size())]).fadeIn();
				//alert(i+$(targets[(i+1)%(targets.size())]).html());
				break;
			}
		}*/
		var target = $(this).parent().next().children(':first-child');
		if(target.is(':hidden'))
		{
			$(this).parent().children(':nth-child(3)').find('img').attr('src', '/images/unfold.jpg');
			//alert($(this).html());
			target.fadeIn();
			target.nextAll().hide();
		}
		else
		{
			$(this).parent().children(':nth-child(3)').find('img').attr('src', '/images/fold.jpg');
			target.hide();
			target.nextAll().fadeIn();
		}
		return false;
	}
	);
	$(root).children(':odd').children('.foldable').click(
	function(event)
	{		
		var target = $(this).parent().children(':first-child');
		if(target.is(':hidden'))
		{
			//alert($(this).html());
			$(this).parent().prev().children(':nth-child(3)').find('img').attr('src', '/images/unfold.jpg');
			target.fadeIn();
			target.nextAll().hide();
		}
		else
		{
			//alert($(this).html());
			$(this).parent().prev().children(':nth-child(3)').find('img').attr('src', '/images/fold.jpg');
			target.hide();
			target.nextAll().fadeIn();
		}
		return false;
	}
	);
}
