/*
* jQuery dixheight v1.0
* http://dixso.net
* Date: 2011-11-08 19:43:00 - (Martes, 08 Nov 2011)
*
*/
(function($){
    $.fn.dixheight = function(opc) {
		var opc = $.extend( $.fn.dixheight.defaults , opc);
		var heightnew=0;
		var contador=0;
		this.each(function(){
			if ((opc.items)&&(!opc.element)){
				contador++;
				if(contador<=opc.items){
					$(this).addClass('dixheight');
					var height = $(this).height();
					if(height > heightnew){
						heightnew = height;
					}
				}
				if(contador==opc.items){
					$('.dixheight').height(heightnew).removeClass('dixheight');
					contador=0;
				}
			}else{
				if(!opc.element){
					contador++;
					$(this).addClass('dixheight');
					var height = $(this).height();
					if(height > heightnew){
						heightnew = height;
					}
				}
			}
			if(opc.element){
				var count=$(opc.element,this).size();
				$(opc.element,this).each(function(){
					contador++;
					if(contador<=count){
						$(this).addClass('dixheight');
						var height = $(this).height();
						if(height > heightnew){
							heightnew = height;
						}
					}
					if(contador==count){
						$('.dixheight').height(heightnew).removeClass('dixheight');
						heightnew=0;
						contador=0;
					}
				});
			}
		});
		if (!opc.items){
			$('.dixheight').height(heightnew).removeClass('dixheight');
		}
	};
	$.fn.dixheight.defaults = {  
		items: false
		,element: false
	};
})(jQuery);
