$(function(){$(window).resize(function(){var f=0,i,r,u;$(".js-infoblock-1 .tab-item-1:not(:last)").each(function(){f+=$(this).height()});i=0;$(".js-infoblock-1 .tab-item-2:not(:last)").each(function(){i+=$(this).height()});r=0;$(".js-infoblock-2 .tab-item-1:not(:last)").each(function(){r+=$(this).height()});u=0;$(".js-infoblock-2 .tab-item-2:not(:last)").each(function(){u+=$(this).height()});var n=Math.max(f,i,r,u),t=$(".js-infoblock-1 .tab-item-1:not(:last)").length,e=parseInt(Math.ceil((n-f)/t)),o=parseInt(Math.ceil((n-i)/t)),s=parseInt(Math.ceil((n-r)/t)),h=parseInt(Math.ceil((n-u)/t));$(".js-infoblock-1 .tab-item-1:not(:last)").each(function(){$(this).css("margin-bottom",32+e)});f+e*t>n&&$(".js-infoblock-1 .tab-item-1:first").css("margin-bottom",parseInt($(".js-infoblock-1 .tab-item-1:first").css("margin-bottom"),10)-(f+e*t-n));$(".js-infoblock-1 .tab-item-2:not(:last)").each(function(){$(this).css("margin-bottom",32+o)});i+o*t>n&&$(".js-infoblock-1 .tab-item-2:first").css("margin-bottom",parseInt($(".js-infoblock-1 .tab-item-2:first").css("margin-bottom"),10)-(i+o*t-n));$(".js-infoblock-2 .tab-item-1:not(:last)").each(function(){$(this).css("margin-bottom",32+s)});r+s*t>n&&$(".js-infoblock-2 .tab-item-1:first").css("margin-bottom",parseInt($(".js-infoblock-2 .tab-item-1:first").css("margin-bottom"),10)-(r+s*t-n));$(".js-infoblock-2 .tab-item-2:not(:last)").each(function(){$(this).css("margin-bottom",32+h)});u+h*t>n&&$(".js-infoblock-2 .tab-item-2:first").css("margin-bottom",parseInt($(".js-infoblock-2 .tab-item-2:first").css("margin-bottom"),10)-(u+h*t-n))});$(window).trigger("resize")})