var elementToScaleFound=!1,elementToScale=null;const creativeResize=function(e,t,l){let n=l,i=t,o=e;n.offsetHeight>1&&n.offsetWidth>1&&(i=n.offsetHeight,o=n.offsetWidth);let f=o,a=i;if(i<t||o<e){let c=1;if(e/t>o/i?(f=o*(c=t/i),a=t):(c=e/o,f=e,a=i*c),f<e&&(n.style.marginLeft=(e-f)/2+"px"),a<t){let d=(t-i)/2+"px";n.style.transform+="translate(0px,"+d+")"}n.style.transform+="scale("+c+","+c+")"}},findElementBySize=function(e,t,l){if(e.offsetHeight===l&&e.offsetWidth===t&&(elementToScale=e,elementToScaleFound=!0),0!==e.children.length)for(var n=0;n<e.children.length&&!elementToScaleFound;n++)findElementBySize(e.children[n],t,l)},updateCreativeSize=function(e,t){elementToScale=null,elementToScaleFound=!1;findElementBySize(document.getElementById("hybid-ad"),320,480),elementToScaleFound&&null!=elementToScale&&creativeResize(e,t,elementToScale)};
