(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;
            //alert(this.offsetHeight);
        });
        this.css("height", "auto").each(function(i){
            var gap = maxH-this.offsetHeight;
            if (gap > 0){
                //alert(!$(this).children(".fill")[0]);
                if(!$(this).children(".fill")[0]){
                    t = document.createElement('div');
                    $(t).attr("class","fill").css("height",gap+"px");
                    
                    if (child.length > i){
                        //alert("a");
                        $(this).find(child[i]).children(':last-child').before(t);
                    }else{
                        //alert("b");
                        $(this).children(':last-child').before(t);
                    }              
                }else{    
                    //alert(gap);
                    $(this).find(".fill").css("height",gap+"px");                    
                }
            }
        });

    }    
})(jQuery);
