window.addEventListener('DOMContentLoaded', function () {
var ua = navigator.userAgent;
if ((document.cookie.indexOf('aaac_sd_ima=true') != -1) || (/iPhone OS/.test(ua) && ua.match(/iPhone OS (\d+)/)[1] < 10)){
return;
}
var isIos = function () {
var b, c, d;
b = window.navigator.userAgent.toLowerCase();
c = 0 <= b.indexOf('iphone');
d = 0 <= b.indexOf('ipod');
b = 0 <= b.indexOf('ipad');
return c || d || b ? !0 : !1
}
var iPhoneModels = { 479: "iphone3", 480: "iphone4", 568: "iphone5", 667: "iphone6", 736: "iphone6p", 737: "iphone6"}
var displayMinSize = 479;
var displayMaxSize = 737;
var getModelName = function (b) {
return !1 === isIos() ? '' : iPhoneModels[displayMinSize > b ? displayMinSize : displayMaxSize < b ? displayMaxSize : b]
};
var i_type = getModelName(window.screen.height);
var sc = document.createElement('script');
sc.type = 'text/javascript';
sc.src = 'https://ap.octopuspop.com/deliver/?_spot=22025&_iphone_type=' + i_type + '&callback=octopusMovieSDCallback&_ver=' + new Date().getTime();
var parent = document.getElementsByTagName('script')[0];
parent.parentNode.insertBefore(sc,parent);
});
var octopusMovieSDCallback = function(jsondata){
var link_url = jsondata['click_url'];
var view_url = jsondata['view_url'];
if (link_url === undefined || link_url == '' || view_url == undefined || view_url == '') {
return;
}
if (
typeof jsondata['vt_url'] !== "undefined"
&& typeof jsondata['vt_time'] !== "undefined"
){
var vt_url = jsondata['vt_url'];
var vt_time = jsondata['vt_time'];
} else {
var vt_url = false;
var vt_time = false;
}
var hide_logo;
switch (jsondata['hide_logo']) {
case 0:
hide_logo = 'false';
break;
case 1:
hide_logo = 'true';
break;
default:
hide_logo = 'false';
break;
}
var article_id = link_url.match(/\d+$/)[0];
var json_url = 'https://srv1.aaacompany.net/om_res.php?spot=22025&article=' + article_id + '&_=' + new Date().getTime();
var xhr_success = function(data){
if (typeof data == 'string'){
data = JSON.parse(data);
}
var link_url_a = data['click'];
var view_url_a = data['imp'];
var vt_url_a = data['view'];
var movie_url = data['article']['movie'];
var cookie_time = data['cookie'];
if (!((Math.random() * 100) < data['rate']) || (!movie_url)){ return; }
var iframe;
var iframe_flag = false;
var a;
var tag_image = '';
var iframe_create = function(){
iframe = document.createElement('iframe');
iframe.style.width = '100%';
iframe.style.height = '100%';
iframe.style.position = 'absolute';
iframe.style.left = '0';
iframe.style.top = '0';
iframe.style.border = 'none';
iframe.style.padding = '0';
iframe.style.margin = '0';
iframe.id = 'iframe_movie_sd_ad';
wrap.appendChild(iframe);
iframe.contentWindow.document.write(
'