if (collageAdCalculateFunctions === undefined) var collageAdCalculateFunctions = [] var rndId = Math.floor(Math.random() * 1000000); document.write(''+ ''+ '
' + '' + '
'); (function(){ var wrapper = document.getElementById('wrapper' + rndId); var iframe = document.getElementById(''+rndId); function resizeIframe(){ var wrapperWidth = wrapper.clientWidth; if(wrapperWidth < 968){ if(wrapperWidth < 538){ iframe.style.width = 338 + 'px'; iframe.style.height = 619 + 'px'; } else{ iframe.style.width = 538 + 'px'; iframe.style.height = 619 + 'px'; } } else{ iframe.style.width = 968 + 'px'; iframe.style.height = 619 + 'px'; } }; function checkForWrapperLoaded(callback){ if(wrapper.clientWidth === 0){ setTimeout(function(){checkForWrapperLoaded(callback)}, 500); } else{ callback() } } resizeIframe(); checkForWrapperLoaded(resizeIframe); window.addEventListener('resize', resizeIframe, false); })();