var tdBackstr={};
(function(){tdBackstr={items:[],item:function(){this.blockUid="";this.image_aspect_rate=this.previous_value=0;this.image_jquery_obj=this.wrapper_image_jquery_obj=""},add_item:function(a){if(a.constructor===tdBackstr.item)if(a.image_jquery_obj.get(0).complete)tdBackstr._load_item_image(a);else a.image_jquery_obj.on("load",function(){tdBackstr._load_item_image(a)})},deleteItem:function(a){for(var b=0;b<tdBackstr.items.length;b++)if(tdBackstr.items[b].blockUid===a)return tdBackstr.items.splice(b,1),
!0;return!1},_load_item_image:function(a){a.image_aspect_rate=a.image_jquery_obj.width()/a.image_jquery_obj.height();tdBackstr.items.push(a);tdBackstr._compute_item(a);a.image_jquery_obj.css("opacity","1")},_compute_item:function(a){if(a.wrapper_image_jquery_obj.width()/a.wrapper_image_jquery_obj.height()<a.image_aspect_rate){var b=1;a.previous_value!==b&&(a.image_jquery_obj.removeClass("td-stretch-width"),a.image_jquery_obj.addClass("td-stretch-height"),a.previous_value=b)}else b=2,a.previous_value!==
b&&(a.image_jquery_obj.removeClass("td-stretch-height"),a.image_jquery_obj.addClass("td-stretch-width"),a.previous_value=b)},_compute_all_items:function(){for(var a=0;a<tdBackstr.items.length;a++)tdBackstr._compute_item(tdBackstr.items[a])},td_events_resize:function(){0!==tdBackstr.items.length&&tdBackstr._compute_all_items()},log:function(a){window.console.log(a)}}})();
