!function() { // Ancestor function n(n) { try { if(!window.location.ancestorOrigins)return; for(var r=0,o=window.location.ancestorOrigins.length;o>r;r++) n.call(null,window.location.ancestorOrigins[r],r) } catch(t) { } return[] } function r(n) { var r,o=[]; do try { r=r?r.parent:window,n.call(null,r,o) } catch(t) { return o.push({referrer:null,location:null,isTop:!1}),o } while(r!==window.top); return o }; var o=r( function(n,r) { try { r.push({referrer:n.document.referrer||null,location:n.location.href||null,isTop:n===window.top}) } catch(o) { r.push({referrer:null,location:null,isTop:n===window.top}) } } ); n(function(n,r){o[r].ancestor=n}); for(var a="",t="",e=!1,i=o.length-1,l=o.length-1;l>=0;l--) { if(t=o[l].location,!t&&l>0&&(t=o[l-1].referrer,t||(t=o[l-1].ancestor)),t) { e=window.location.ancestorOrigins?!0:l==o.length-1&&o[o.length-1].isTop; t=encodeURIComponent(t);a="&a"+l+"="+t+a } } var viewportwidth; var viewportheight; if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } // Position tag document.write(''); function getPosition(element) { var xPosition = 0; var yPosition = 0; while(element) { xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft); yPosition += (element.offsetTop - element.scrollTop + element.clientTop); element = element.offsetParent; } return { x: xPosition, y: yPosition }; } var myElement = document.querySelector("#cpmaff620126858"); var position = getPosition(myElement); document.write("