petcube

$(‘#” + slotName + “‘).responsiveAd(screenSize:’971 1115’, scriptTags: []);if (Object.keys(IDG.GPT.companions).length > 0) IDG.GPT.refreshAd(‘” + slotName + “‘);”;
var adDivString = “

” + adString + “

“;

placementDiff = applyInsert($(this), adDivString);
if (debug)
console.log(“Simply positioned an Advert and the placementDiff is: ” + placementDiff);

placementTarget = cumulativeHeight + placementDiff + interModuleHeight + adHeightBuffer;

else
var moduleDivString = “”;
var elementId = “drr-mod-“+moduleCounter;
moduleDivString = “”;
modules.push(elementId);

placementDiff = applyInsert($(this), moduleDivString);
if (debug)
console.log(“Just placed a module and the placementDiff is: ” + placementDiff);

placementTarget = cumulativeHeight + placementDiff + interModuleHeight + moduleHeightBuffer;
moduleCounter++;

loopCounter++;

// Avoid inserting Components too soon as a result of non-Large figures inflating the cumulative Height
if ($(this).is(“Figure”) && !$(this).is(“Figure.Huge”))
cumulativeHeight += grafHeight;

else
cumulativeHeight += $(this).Height() + grafHeight;

);

// clone Related Tales module to come in after eighth para in article physique for Mobile breakpoint display
var $relatedStories = $(‘.Related-promo-wrapper’);
if ($relatedStories.size)
var $relatedStoriesClone = $relatedStories.clone();
$relatedStoriesClone.insertAfter( “#drr-container > p:eq(7)”);

// For Mobile simplest, Location Ad after 2d paragraph.
if (firstMobileAdHtml)
$(firstMobileAdHtml).insertAfter(“#drr-container > p:eq(1)”);

var $insiderPromo = $(‘.insider-promo-wrapper’);
if ($insiderPromo.length)
var $insiderPromoClone = $insiderPromo.clone();
$insiderPromoClone.insertAfter( “#drr-container > p:eq(1)”);

//Place left aspect Element
cumulativeHeight = Zero;
var leftPlacementTarget = tagHeight = leftPlacementTarget)
if (debug)
console.log(“congratulations… we’ve got passed the preliminary Start point”);

if (leftPlacementIndex == null)
//it is Not just right enough to Not be a left Keep Away From – it also will not be a

with an in an instant preceding small or medium picture left Steer Clear Of.
if (!isLeftAvoid($(this)) && noPrevFigures($(this)) )
leftPlacementIndex = $(this).index();
$leftPlacementElement = $(this);
leftPlacementLookaheadStart = cumulativeHeight;
if (debug)
console.log(“will not be a left Keep Away From and no prev figures. ########## set placementIndex (“+leftPlacementIndex+”) and lookaheadStart (“+leftPlacementLookaheadStart+”) ##########”);

else
if (debug)
console.log(“is a left Avoid or has previous figures. continue”);

else
if (debug)
console.log(“#### leftPlacementIndex already set to “+leftPlacementIndex+”. having a look AHEAD…”);

//No Longer null; has been set
if ((cumulativeHeight – leftPlacementLookaheadStart) > leftIntervalHeight)
if (debug)
console.log(“###### THRESHOLD REACHED. LOOKAHEAD FULL. End ###### (cumulativeHeight – leftPlacementLookaheadStart) (“+(cumulativeHeight-leftPlacementLookaheadStart)+”) > leftIntervalHeight (“+leftIntervalHeight+”).”);

return false;
else
if (debug)
);

if (leftPlacementIndex != null && elementNotNearEnd($leftPlacementElement, leftPixelWindow))
if (debug)
console.log(” insert into index “+leftPlacementIndex);

$(“#drr-container”).youngsters().eq(leftPlacementIndex).ahead of(“

“);

IDG.GPT.trackOmniture();

// Add Right rail module content
for (var i=0; i” + adString + “