var safariCookieCheck = function(cookieName) { var isSafari = navigator.userAgent.indexOf("Safari") > -1; var isChrome = navigator.userAgent.indexOf('Chrome') > -1; if ((isChrome) && (isSafari)) { isSafari = false; } if (isSafari) { if (document.cookie.indexOf(cookieName) === -1) { document.cookie = cookieName + '=fixed; expires=Tue, 19 Jan 2028 13:37:00 UTC; path=/'; window.location.replace("https\u003A\/\/twomonkeys.evezing.com\/iframe\/cookie\u002Dredirect"); } } }; safariCookieCheck('evezing_safari'); if (window.addEventListener) { window.addEventListener('message', receiveMessage, false); } else if (window.attachEvent) { window.attachEvent('onmessage', receiveMessage, false); } goEvezing(); function receiveMessage (event) { var iframeObject = document.getElementById('evezing-iframe-guadalupe-plata'); var origin = event.origin || event.originalEvent.origin; if (0 !== iframeObject.src.lastIndexOf(origin, 0)) { return; } switch (event.data.type) { case 'resize': iframeObject.height = event.data.parameters.height; break; case 'scrollBottom': iframeObject.scrollIntoView(false); break; case 'scrollTop': iframeObject.scrollIntoView(true); break; case 'scrollTo': window.scrollTo(0, iframeObject.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop) + event.data.parameters.position - 50) break; case 'scrollTopIfHidden': if (iframeObject.getBoundingClientRect().top < 0) { iframeObject.scrollIntoView(true); } break; } } function goEvezing () { function getParameterByName(name) { var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); } function getUrl() { var baseUrl = "https://twomonkeys.evezing.com/iframe/event/guadalupe-plata"; var queryParametersToSearchInParentUrl = [ "utm_campaign", "utm_source", "utm_term", "utm_content", "utm_medium", "utm_campaign_id", "utm_adwords_id", "utm_display_ads_id", "prp" ]; if (baseUrl.indexOf('?') === -1) { baseUrl += '?'; } var parametersLength = queryParametersToSearchInParentUrl.length; var firstParameter = true; for (i = 0; i < parametersLength; i++) { var value = getParameterByName(queryParametersToSearchInParentUrl[i]); if (value !== undefined && value !== '' && value !== null) { if(!firstParameter) { baseUrl += '&'; firstParameter = false; } baseUrl += queryParametersToSearchInParentUrl[i] + '=' + encodeURI(value); } } return baseUrl; } var iframeShop = document.createElement('iframe'); iframeShop.setAttribute('width', '100%'); iframeShop.setAttribute('height', '0'); iframeShop.setAttribute('allowTransparency', 'true'); iframeShop.setAttribute('frameborder', '0'); iframeShop.setAttribute('scrolling', 'no'); iframeShop.setAttribute('style', 'overflow:hidden;'); iframeShop.setAttribute('id', 'evezing-iframe-guadalupe-plata'); iframeShop.src = getUrl(); iframeShop.onload = function () { divShop.removeChild(divLoading); } var divShop = document.getElementById('evezing-shop-guadalupe-plata'); var divLoading = document.createElement('div'); divLoading.innerHTML = divShop.innerHTML; divShop.innerHTML = ''; divShop.appendChild(divLoading); divShop.appendChild(iframeShop); }