if(!window.currSite.isPreview) {
$(document).ready(function() {
// real ads
$(".gg-box").each(function(i) {
var viewType = $(this).data('view_type')
var location = $(this).data('location')
var locationAdItem = "." + viewType + "-" + location + '-ad-item'
if(location && $(locationAdItem).length > 0) {
if($(locationAdItem).html().length == 0) {
$(locationAdItem).html($(this).contents())
if(locationAdItem.indexOf("-top") > -1) {
$(locationAdItem).addClass("mb-12")
}
else if(locationAdItem.indexOf("-bottom") > -1) {
$(locationAdItem).addClass("mt-12")
}
}
}
})
// let's wait 1 second to check if there is an ad blocker
// if there is, we will replace the content with non-gg-box
setTimeout(function() {
var adblockEnabled = false;
// add test element and get its styles
// document.body.innerHTML += '
';
var adElement = document.getElementsByClassName('adBanner')[0]
var adElementStyle = getComputedStyle(adElement, null)
if(adElementStyle.display === 'none') { // Adblock enabled
$(".non-gg-box").each(function(i) {
var viewType = $(this).data('view_type')
var location = $(this).data('location')
var locationAdItem = "." + viewType + "-" + location + '-ad-item'
if(location && $(locationAdItem).length > 0) {
$(locationAdItem).html($(this).contents())
}
})
}
}, 1000);
})
}