(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);

var lastBlock='';
var Key_Technologies_Blocks = {

	init : function() {
		lastBlock='';
		$('.button-click-to-open').click(function(){ Key_Technologies_Blocks.toggle(this);return false; });
		$('.close-link').click(function(){Key_Technologies_Blocks.closeLastBlock();return false; });
	},
	
	toggle : function(elt) {
		Key_Technologies_Blocks.closeLastBlock();
		$(elt).hide();
		$('.key-tech-content',$(elt).parents('tr')).slideToggle('medium');
		$('.btnclose',$(elt).parents('tr')).slideToggle(); 
		lastBlock=elt;
	},
	closeLastBlock : function() {
		if(lastBlock!='')
		{
		 $('.key-tech-content',$(lastBlock).parents('tr')).slideToggle('medium');
	     $('.btnclose',$(lastBlock).parents('tr')).slideToggle('medium');
		 $(lastBlock).slideToggle('slow');
		 lastBlock='';

		
		}
	}
}
$(document).ready(function() {
   Key_Technologies_Blocks.init();
   $( "#key-technologies-list tr" ).each(
	function( intIndex ){
      $('.key-tech-content',this).equalHeights();
	}
   );
 });