jQuery.fn.fixMargins = function(settings) {
    settings = jQuery.extend({
            margin : 6
    }, settings);
    
    oldoffset = null; 
    
    return this.each(function(){

            $(this).css({
                    'margin-right' : settings.margin,
                    'margin-bottom' : settings.margin
            }).each(function(i){
                    offset = $(this).offset();
                    //console.log(oldoffset + ':' + offset["top"]);
                    if(offset["top"] != oldoffset && oldoffset != null){
                       margin = $(this).css("margin-right");
                       $(this).css("margin-right",0);
                       newoffset = $(this).offset();
                       if(newoffset["top"] == offset["top"]){
                        	$(this).siblings(".smartbox:eq("+(i-1)+")").css("margin-right",0);
                       }
                    }
                    oldoffset = offset["top"];
            });
    });
};

jQuery(function($) {
	$(".tx-tcsmartbox-pi1 .smartbox").fixMargins({'margin':11});

});