Event.observe(window,'load',function() {
 
 if($$('div.feature_long_text').length>0){
    var hideText='div.feature_long_text';
 }else{
    var hideText='div.knowledge_item_content';
 }

 $$(hideText).invoke('hide');

  
	
  $$('a.learn_more').invoke('observe', 'click', function(evt){
	evt.stop();
	
	var textNode = $(this.parentNode.parentNode.parentNode.parentNode).select(hideText).first();
	
	if(this.getAttribute('status') == 'closed')
	{
	  if($('activeItem'))
	  {
		Effect.SlideUp('activeItem', {duration: 0.5});
		
		$($('activeItem').parentNode.parentNode.parentNode.parentNode).select('a.learn_more').first().setAttribute('status', 'closed');
		
		$('activeItem').id = null;
	  }
	  
	  textNode.id = 'activeItem';
	  
	  Effect.SlideDown(textNode, {duration: 0.5});
	  this.className = 'link learn_less';//min tonen
	  this.setAttribute('status', 'open');
	}
	else
	{
	  textNode.id = null;
	  Effect.SlideUp(textNode, {duration: 0.5});
	  this.className = 'link learn_more';//plus tonen
	  this.setAttribute('status', 'closed');
	}
  });
  
  $$('a.learn_more').each(function(element){
	element.setAttribute('status', 'closed');
  });
});
