window.addEventListener('DOMContentLoaded', function () { var ua = navigator.userAgent; if ((localStorage.getItem('aaac_pr_ima') != undefined && localStorage.getItem('aaac_pr_ima') > (new Date().getTime())) || (navigator.userAgent.indexOf('Mobile') != -1 && navigator.userAgent.indexOf('Firefox') != -1)) { return; } var aaa_xhr_success = function (data, link_url, view_url, vt_url, vt_time, hide_logo_data) { if (typeof data == 'string') { data = JSON.parse(data); } if ( !((Math.random() * 100) < data['rate']) || (!data['article']['movie']) || (!data['prop']['movie']) ) { return; } var link_url_a = data['click']; var view_url_a = data['imp']; var vt_url_a = data['view']; var movie_width = data['prop']['movie'].match(/^\d+/)[0]; var movie_height = data['prop']['movie'].match(/\d+$/)[0]; var movie_url = data['article']['movie']; var endcard_url = data['article']['endcard']; if (typeof endcard_url === 'undefined') { endcard_url = false; } var button_type = data['button_type']; var cookie_time = data['cookie']; var movie_selector = data['selector']; var movie_flag = data['flag']; if (movie_flag === ""){ return; } var hide_logo; switch (hide_logo_data) { case 0: hide_logo = 'false'; break; case 1: hide_logo = 'true'; break; default: hide_logo = 'false'; break; } if (movie_flag == 2){ var wraps = document.querySelectorAll(movie_selector); if (wraps.length === 0){ return; } var maplist = []; for (var i = 0; i < wraps.length; i++) { (function (wrap) { var map = document.createElement('div'); map.style.setProperty('margin', '0', 'important'); map.style.setProperty('border', 'none', 'important'); map.style.setProperty('padding', '0', 'important'); map.style.setProperty('position', 'absolute', 'important'); map.style.setProperty('min-width', 'auto', 'important'); map.style.setProperty('max-width', 'none', 'important'); map.style.setProperty('min-height', 'auto', 'important'); map.style.setProperty('max-height', 'none', 'important'); map.style.setProperty('z-index', '100000000', 'important'); document.body.appendChild(map); var watch_wrap_to_map = setInterval(function(){ if (map === null || map.parentNode === null){ clearInterval(watch_wrap_to_map); } var clientRect = wrap.getBoundingClientRect(); map.style.setProperty('left', (window.pageXOffset + clientRect.left) + 'px'); map.style.setProperty('top', (window.pageYOffset + clientRect.top) + 'px'); map.style.setProperty('width', wrap.clientWidth + 'px'); map.style.setProperty('height', wrap.clientHeight + 'px'); }, 100); maplist.push(map); map.addEventListener('click', function (e) { for (var t = 0; t < maplist.length; t++){ maplist[t].parentNode.removeChild(maplist[t]); } var iframe = document.createElement('iframe'); iframe.style.setProperty('margin', '0', 'important'); iframe.style.setProperty('border', 'none', 'important'); iframe.style.setProperty('padding', '0', 'important'); iframe.style.setProperty('position', 'absolute', 'important'); iframe.style.setProperty('min-width', 'auto', 'important'); iframe.style.setProperty('max-width', 'none', 'important'); iframe.style.setProperty('min-height', 'auto', 'important'); iframe.style.setProperty('max-height', 'none', 'important'); iframe.style.setProperty('z-index', '100000000', 'important'); localStorage.setItem('aaac_pr_ima', new Date().getTime() + (cookie_time * 1000)); iframe.id = 'iframe_movie_pr_ad'; document.body.appendChild(iframe); iframe.contentWindow.document.write( '