',
'
',
'
',
'
'];
var sizeLR = [sizeLeft,sizeRight],
bottoms = ['-620px','-620px','-270px','-220px','-220px','-220px'],
path = vid+"ads/",numImg,numSize,linkDirect,multiAd;
var direct = [
'https://shorten.asia/dGq9P865',
'https://shorten.asia/KRBSAwTU',
'https://shorten.asia/HswEGdnW',
'https://shorten.asia/4Vur9JBX',
'https://shorten.asia/bn4TasRw',
'https://shorten.asia/xRYgZRfD',
];
var clickAds = ['https://shorten.asia/F7hERujV'],
propellerAds = ['https://shorten.asia/MceSvBY2'],
vipAds = ['https://shorten.asia/z2J9DDAq'];
//clickAds.push(direct);
//propellerAds.push(direct);
//vipAds.push(direct);
function redirect(k) {
numSize = isMobile()? 3: Math.floor(Math.random() * (imgs.length - k)) + k;//size ngau nhien tu so k
multiAd = path+multi[numSize];
numImg = Math.floor(Math.random() * imgs[numSize].length);//image ngau nhien
if(numImg==0)
linkDirect = clickAds[Math.floor(Math.random() * clickAds.length)];
else if(numImg==1)
linkDirect = propellerAds[Math.floor(Math.random() * propellerAds.length)];
else if(numImg==2)
linkDirect = vipAds[Math.floor(Math.random() * vipAds.length)];
else
linkDirect = direct[Math.floor(Math.random() * direct.length)];
}
function jq_show() {
jQuery(document).ready(function() {
redirect(2);//size ngau nhien tu so 2
var sizeDiv = sizeLR[Math.floor(Math.random() * sizeLR.length)][numSize];
jQuery('body').prepend(sizeDiv+'

');
Math.floor(Math.random() * 2)==0?vast_show('phim79-sli'):setTimeout(function(){jq_hide();jq_show();},10000);//10s
jQuery('#phim79-sli').css('bottom', bottoms[numSize]);
var space = 0;
if(numSize<2)
space=(jQuery(window).height() - 615) / 2;
jQuery('#phim79-sli').animate({bottom:space}, 5000);
});
}
function jq_hide() {
document.getElementById('phim79-sli').remove();
}
function vast_show(idPlay) {
var divAdSlider = document.getElementById(idPlay);
var sliderVast = document.createElement('iframe');
sliderVast.setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;border:0;z-index:100');
sliderVast.setAttribute('scrolling', 'no');
sliderVast.setAttribute('allow', 'accelerometer;encrypted-media;gyroscope;picture-in-picture');
divAdSlider.appendChild(sliderVast);
if(Math.floor(Math.random() * 6) == 0) {
sliderVast.setAttribute('src', path+"ad.html");
var sliderInterval = setInterval(function() {
var nameClass = sliderVast.contentWindow.document.getElementById('inspectorPlayer').className;
if(nameClass!=""&&nameClass!="inspectorPlayer") {
clearInterval(sliderInterval);
sliderVast.setAttribute('src', multiAd);
}
},1000);//1s
} else {
sliderVast.setAttribute('src', multiAd);
}
document.getElementById('phim79-ban').remove();
setTimeout(function(){jq_hide();jq_show();},30*60000);//30m
}
function hide_left_right() {
document.getElementById('phim79-left').remove();
document.getElementById('phim79-right').remove();
setTimeout(function(){show_widget()},3*60000);//3m
}
function show_left_right(id, size, ad) {
jQuery(document).ready(function() {
jQuery('body').prepend(size+'
'+ad+'
');
jQuery(id).css('bottom', bottoms[1]);
var space = (jQuery(window).height() - 615) / 2;
jQuery(id).animate({bottom:space}, 5000);
});
}
function show_bottom() {
jQuery(document).ready(function() {
redirect(3);//size ngau nhien tu so 3
var sizeDiv = sizeLR[Math.floor(Math.random() * sizeLR.length)][numSize];
jQuery('body').prepend(sizeDiv+'




');
jQuery('#phim79-sli').css('bottom', bottoms[numSize]);
var space = 0;
jQuery('#phim79-sli').animate({bottom:space}, 5000);
});
}
function show_widget() {
if (jQuery(window).width() >= 1600) {
show_left_right('#phim79-left', sizeLR[0][0], '
');//left
show_left_right('#phim79-right', sizeLR[1][0], '
');//right
//show_left_right('#phim79-left', sizeLR[0][0], '

');//left
//show_left_right('#phim79-right', sizeLR[1][0], '

');//right
} else {
//jq_show();
}
}
show_widget();
show_bottom();
//directlink monetag
jQuery(document).ready(function ($) {
setTimeout(function () {
// ensure all images without alt get your default alt
// $("img:not([alt])").attr("alt", "phim79.com");
function getCookie(name) {
const nameEQ = name + "=";
const ca = document.cookie.split(';');
for (let c of ca) {
c = c.trim();
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length);
}
return '';
}
function setCookie(name, value, hours) {
const d = new Date();
d.setTime(d.getTime() + hours * 60 * 60 * 1000);
document.cookie = `${name}=${value}; expires=${d.toUTCString()}; path=/`;
}
$(document).click(function () {
let clicks = getCookie('p79') || '0';
if (clicks === '0') {
setCookie('p79', '1', 2);
const links = [
'https://otieu.com/4/9828125',
'https://otieu.com/4/4637268',
'https://otieu.com/4/6013052',
'https://otieu.com/4/5907700',
'https://otieu.com/4/5293583',
'https://otieu.com/4/5293582',
'https://otieu.com/4/5907699',
'https://otieu.com/4/5907701',
'https://otieu.com/4/9828289',
];
//links.push(direct);//đẩy direct vào links
window.open(links[Math.floor(Math.random() * links.length)], '_blank');
window.focus();
}
});
}, 3000); // chạy sau 3 giây
});