window.addEvent('domready', function() {
	$each($$("a.closed"), function (e, index){
	   e.addEvent('click', doExpandCollapse);								
	});
	
	$each($$("a.opened"), function (e, index){
	   e.addEvent('click', doExpandCollapse);								
	});
});

function doExpandCollapse(){
  var h = $(this.getParent());	
  var lst = $(h).getNext();
  var isOpen = $(this).hasClass('opened');
  if (isOpen){
     $(lst).setStyle('display', 'none');
	 $(this).removeClass('opened');
	 $(this).addClass('closed');
	 $(this).setHTML('&rarr;');
  }
  else {
     $(lst).setStyle('display', 'block');
	 $(this).addClass('opened');
	 $(this).removeClass('closed');
	 $(this).setHTML('&darr;');
  }

  return false;
}