(function($) {
  $.fn.equalizeCols = function(children){
    var child = Array(0);
    if (children) child = children.split(",");
    var maxH = 0;
    this.each(
      function(i) 
      {
        if (this.offsetHeight>maxH) maxH = this.offsetHeight;
      }
    ).css("height", "auto").each(
      function(i)
      {
        var gap = maxH-this.offsetHeight;
        if (gap > 0)
        {
          t = document.createElement('div');
          $(t).attr("class","fill").css("height",gap+"px");
          if (child.length > i)
          {
            $(this).find(child[i]).children(':last-child').after(t);
          } 
          else 
          {
            $(this).children(':last-child').after(t);
          }
        }
      }  
    );
    
  }
})(jQuery);

jQuery.fn.vjustify=function() {
    var maxHeight=0;
    var ctr = 0;

    this.each(function(){
        	if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
    });

    this.each(function(){
	if (ctr != 0) {
        	$(this).height(maxHeight + "px");
        	if (this.offsetHeight>maxHeight) {
            		$(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");
        	}
	}
	ctr = ctr + 1;
    });

};
