Event.observe(window, 'load', function() {
	$$('.more').each(function(s) {
		s.hide();
	});
	
	$('where').hide();
	
	$$('.show_more').each(function(s) {
		s.observe('click', showMore.bind(this));
	});
	
	$$('.hide_more').each(function(s) {
		s.observe('click', hideMore.bind(this));
	});
});

var electronic;
var acoustic;
var where;

function showMore(e) {
	var el = e.findElement();
	
	if ((el.name) == "pgroup_e_percussion") {
		if (!electronic) {
			electronic = true;
			var target = el.up().next('div');
			//new Effect.SlideDown(target, {duration:0.4});
			target.show();
			if (!where) {
				where = true;
				//new Effect.SlideDown('where', {duration:0.4});
				$('where').show();
			}
		}
	}
	
	if ((el.name) == "pgroup_a_percussion") {
		if(!acoustic) {
			acoustic = true;
			var target = el.up().next('div');
			//new Effect.SlideDown(target, {duration:0.4});
			target.show();
			if (!where) {
				where = true;
				// new Effect.SlideDown('where', {duration:0.4});
				$('where').show();
			}
		}
	}
}

function hideMore(e) {
	var el = e.findElement();
	
	if ((el.name) == "pgroup_e_percussion") {
		if (electronic) {
			electronic = null;
			var target = el.up().next('div');
			//new Effect.SlideUp(target, {duration:0.4});
			target.hide();
			if ((where) && (!acoustic)) {
				where = null;
				//new Effect.SlideUp('where', {duration:0.4});
				$('where').hide();
			}
		}
	}
	
	if ((el.name) == "pgroup_a_percussion") {
		if(acoustic) {
			acoustic = null;
			var target = el.up().next('div');
			//new Effect.SlideUp(target, {duration:0.4});
			target.hide();
			if ((where) && (!electronic)) {
				where = null;
				//new Effect.SlideUp('where', {duration:0.4});
				$('where').hide();
			}
		}
	}
}
