' + ad_content + '';
var found = false;
var last_found;
$('div#article-content > p.body').each(function(){
last_found = $(this);
if ( $(this).offset().top >= target_offset ) {
$(this).after( ad_content );
found = true;
mobile_target = $(this);
return false;
}
});
if ( found == false && typeof last_found !== 'undefined' ) {
$(last_found).after( ad_content );
mobile_target = last_found;
}
target_offset = target_offset + 500;
}
}
var ad_content = ``;
ad_content = ad_content.replace("SCRIPTEND", "' + ad_content + '';
var mobile_ad_content = '
' + ad_content + '
';
ad_content = '' + ad_content + '
';
var found = false;
var last_found;
$('div#article-content > p.body').each(function(){
last_found = $(this);
if ( $(this).offset().top >= target_offset ) {
if(mobile_target)
{
$(this).after( mobile_ad_content );
$(mobile_target).after( ad_content );
}
else {
$(this).after( ad_content );
}
found = true;
return false;
}
});
if ( found == false && typeof last_found !== 'undefined' ) {
if(mobile_target)
{
$(last_found).after( mobile_ad_content );
$(mobile_target).after( ad_content );
}
else {
$(last_found).after( ad_content );
}
}
}
}
var ad_content = ``;
ad_content = ad_content.replace("SCRIPTEND", "' + ad_content + '';
var found = false;
var last_found;
$('div#article-content > p.body').each(function(){
last_found = $(this);
if ( $(this).offset().top >= target_offset*2 ) {
$(this).after( ad_content );
found = true;
return false;
}
});
if ( found == false && typeof last_found !== 'undefined' ) {
$(last_found).after( ad_content );
}
}
}
var ad_content = ``;
ad_content = ad_content.replace("SCRIPTEND", "' + ad_content + '';
var found = false;
var last_found;
var target_offset = 1000;
$('div#article-content > p.body').each(function(){
last_found = $(this);
if ( $(this).offset().top >= target_offset ) {
$(this).after( ad_content );
found = true;
return false;
}
});
if ( found == false && typeof last_found !== 'undefined' ) {
$(last_found).after( ad_content );
}
}
}
var ad_content = ``;
ad_content = ad_content.replace("SCRIPTEND", "' + ad_content + '';
var found = false;
var last_found;
var target_offset = 2000;
$('div#article-content > p.body').each(function(){
last_found = $(this);
if ( $(this).offset().top >= target_offset ) {
$(this).after( ad_content );
found = true;
return false;
}
});
if ( found == false && typeof last_found !== 'undefined' ) {
$(last_found).after( ad_content );
}
}
}
$(".second_ready").click( function(){
var that = $($(this).children()[0]);
var pos = null;
if(that.attr('ccposition')) {
pos = that.attr('ccposition');
}
else {
var parent = that.parent();
if(parent.attr('ccposition')){
pos = parent.attr('ccposition');
}
else {
parent = parent.parent();
pos = parent.attr('ccposition');
}
}
window.dataLayer.push({
'ccSponsor': that.attr("ccsponsor"),
'ccZoneID': that.attr("cczoneid"),
'ccSize': that.attr("ccsize"),
'ccId': that.attr("ccid"),
'ccPosition': pos,
'ccType': 'Click'
});
});
$(".second_ready").each(function() {
var that = $($(this).children()[0]);
// element is now visible in the viewport
var pos = null;
if(that.attr('ccposition')) {
pos = that.attr('ccposition');
}
else {
var parent = that.parent();
if(parent.attr('ccposition')){
pos = parent.attr('ccposition');
}
else {
parent = parent.parent();
pos = parent.attr('ccposition');
}
}
window.dataLayer.push({
'event': 'webccImpression',
'ccSponsor': that.attr("ccsponsor"),
'ccZoneID': that.attr("cczoneid"),
'ccSize': that.attr("ccsize"),
'ccId': that.attr("ccid"),
'ccPosition': pos,
'ccType': 'Impression'
});
});
var offset = $('#article-content p:nth-of-type(5)').offset();
console.log(offset);
offset.left = offset.left + ($('#article-content p:nth-of-type(5)').width() /
3);
$('#blurred-signup').offset(offset);
$(function() {
$('#peer-reviewed').tipsy({ fade: true, gravity: 'w' });
});
});