// Use the following code with the jquery dependency of:
// https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js
$(window).load(function() {
var stoAd = $(".sto-ads-content > div[id^='div-gpt-ad']");
if ($.cookie('noSto')) $('.sto-ads').hide();
else {
if(stoAd.length > 0){
$('.sto-ads .slide-close').on('click', function(){
$(this).parent().parent().removeClass('in');
});
if ($('body').hasClass('front')) {
setTimeout(function(){
$('.sto-ads').addClass('in');
},300);
console.log('front');
}
else {
// do not show the slide in the beginning
setTimeout(function(){
$('.sto-ads').addClass('in');
},300);
console.log('not-front');
}
}
$.cookie('noSto', true);
}
});