$(function () {
		$('div.textEntry').each(function(i){
				var myheight = $(this).attr('name');
				$(this).attr('id','upDown' + i + '').after('<div class=\"tecontent' + i + '\" style="height: '+ myheight +'px; overflow: hidden;\"></div><div class=\"itemHeader\"><a href=\"#\" class=\"closeEl\" id=\"anim' + i + '\" name=\"' + myheight + '\"><img src=\"/_image/icons/icon_arrow_close.gif\" /></a></div>').css('display','none');
				$('div.tecontent'+ i +'').html($(this).html());					
			}
		)
		$('a.closeEl').bind('click', toggleUpDown); 
	}
);
var toggleUpDown = function(e) {
	var myID     = $(this).attr('id').substr($(this).attr('id').length-1,$(this).attr('id').length);
	var myheight = $(this).attr('name');
	eval('var targetHeight  = $(\'#upDown'+ myID +'\').height();');
	eval('var targetContent = $(\'div.tecontent'+ myID +'\', this.parentNode.parentNode);');
	
	if (targetContent.css('height') == ''+ myheight +'px') {		
		targetContent.animate( { height: ''+targetHeight+'px' } );
		$(this).html('<img src=\"/_image/icons/icon_arrow_close.gif\" />');
	} else {		
		targetContent.animate( { height: ''+myheight+'px' },{},{},targetContent.css("overflow","hidden") );
		$(this).html('<img src=\"/_image/icons/icon_arrow_open.gif\" />');
	}
	return false;
};
