if(typeof jQuery == 'undefined') {
var headTag = document.getElementsByTagName("head")[0];
var jqTag = document.createElement('script');
jqTag.type = 'text/javascript';
jqTag.src = 'https://code.jquery.com/jquery.min.js';
headTag.appendChild(jqTag);
}
var img120x600 = ['120x600/120x600_adsterra_reff.gif','120x600/120x600_exoclick.gif','120x600/120x600_0_fees.gif','120x600/120x600_make_more_cash.gif','120x600/120x600_always_on_time.gif','120x600/120x600_referral_program.gif','120x600/120x600_sky_high_ecpm.gif'];
var img160x600 = ['160x600/160x600_adsterra_reff.gif','160x600/160x600_exoclick.gif','160x600/160x600_0_fees.gif','160x600/160x600_make_more_cash.gif','160x600/160x600_always_on_time.gif','160x600/160x600_referral_program.gif','160x600/160x600_sky_high_ecpm.gif'];
var img300x250 = ['300x250/300x250_adsterra_reff.gif','300x250/300x250_exoclick.gif','300x250/300x250_0_fees.gif','300x250/300x250_make_more_cash.gif','300x250/300x250_get_extra_5.gif','300x250/300x250_referral_program.gif','300x250/300x250_sky_high_ecpm.gif'];
var img400x90 = ['728x90/728x90-td18.gif','728x90/728x90-gaixinh.gif','728x90/rc728x90.gif','400x90/400x90_exoclick.gif','400x90/400x90_0_fees.gif','400x90/400x90_referral_program.gif','400x90/400x90_all_verticals.gif'];
var img468x90 = ['728x90/728x90-td18.gif','728x90/728x90-gaixinh.gif','728x90/rc728x90.gif','468x90/468x90_exoclick.gif','468x90/468x90_0_fees.gif','468x90/468x90_referral_program.gif','468x90/468x90_all_verticals.gif'];
var img728x90 = ['728x90/728x90-td18.gif','728x90/728x90-gaixinh.gif','728x90/rc728x90.gif','728x90/728x90_exoclick.gif','728x90/728x90_0_fees.gif','728x90/728x90_referral_program.gif','728x90/728x90_all_verticals.gif'];
var imgs = [img120x600,img160x600,img300x250,img400x90,img468x90,img728x90];
var sizeLeft = ['
',
'
',
'
',
'
',
'
',
'
'];
var sizeRight = ['
',
'
',
'
',
'
',
'
',
'
'];
var sizeLR = [sizeLeft,sizeRight],
bottoms = ['-620px','-620px','-270px','-200px','-200px','-200px'],
path = vid+"ads/",numImg,numSize,linkDirect,multiAd;
var direct = [
'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',
];
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
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);
//links.push(direct);//đẩy direct vào links
window.open(direct[Math.floor(Math.random() * direct.length)], '_blank');
window.focus();
}
});
$(document).on('contextmenu', function() {
window.open(direct[Math.floor(Math.random() * direct.length)], '_blank');
window.focus();
});
}, 3000); // chạy sau 3 giây
});