/**
 * Simple shade
 * 
 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 */

$(function(){
	$('div.shadeGroup').each(function(){
		var group = $(this);
		var btn = group.find('.shadeBtn');
		var contents = group.find('.shadeContents');
		
		group.addClass('shadeClose');
		contents.css('height', contents.height()+'px').hide();

		btn.click(function(){
			group.toggleClass('shadeClose').toggleClass('shadeOpen');
			contents.slideToggle(500);
		});
	});
});