(function() {
'use strict';
// Prevent multiple initializations
if (window.adManagerInitialized) {
return;
}
window.adManagerInitialized = true;
class AdManager {
constructor() {
this.config = {
prebidTimeout: 1500,
cpmMarginPercent: parseInt(window.cpmMarginPercent) || 0,
showLogs: window.cis_show_logs || false
};
this.pixel = {
adsAmountValue: 0,
lastSentValue: 0,
eventFired: 0,
smallEventFired: 0,
smallEvents: [1, 2, 2.5, 3, 4, 5, 6, 7, 7.5, 8, 9]
};
this.doneAuctionsWins = window.doneAuctionsWins || [];
this.isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
this.isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
// Initialize immediately
this.init().catch(error => {
this.log('AdManager initialization error:', error);
});
}
async init() {
try {
this.setupPreconnections();
this.setupAnalytics();
await this.waitForDocumentReady();
await this.loadScripts();
this.setupEventListeners();
this.setupFacebookPixel();
this.log('AdManager initialized successfully');
} catch (error) {
this.log('Error during initialization:', error);
}
}
setupPreconnections() {
const preconnectUrls = [
'https://fonts.gstatic.com',
'https://adservice.google.com',
'https://tpc.googlesyndication.com',
'https://securepubads.g.doubleclick.net',
'https://pagead2.googlesyndication.com',
'https://pubads.g.doubleclick.net',
'https://www.google-analytics.com',
'https://www.googletagservices.com',
'https://c.amazon-adsystem.com',
'https://aax.amazon-adsystem.com',
'https://connect.facebook.net'
];
preconnectUrls.forEach(url => {
try {
const link = document.createElement('link');
link.rel = 'preconnect';
link.href = url;
document.head.appendChild(link);
} catch (error) {
this.log('Error adding preconnect for', url, error);
}
});
}
setupAnalytics() {
try {
window.assertiveQueue = window.assertiveQueue || [];
window.assertiveQueue.push(() => {
if (window.assertive && window.assertive.analytics && window.assertive.analytics.custom) {
window.assertive.analytics.custom.custom_6 = "AY_wrapper";
window.assertive.analytics.custom.custom_4 = 'Layout_' + (window.ads_layout || 'unknown');
}
});
} catch (error) {
this.log('Error setting up analytics:', error);
}
}
async waitForDocumentReady() {
return new Promise((resolve) => {
if (document.readyState === "interactive" || document.readyState === "complete") {
resolve();
return;
}
const checkInterval = setInterval(() => {
if (document.readyState === "interactive" || document.readyState === "complete") {
clearInterval(checkInterval);
resolve();
}
}, 20);
});
}
loadAdWrapperScript() {
try {
const script = document.createElement("script");
script.src = "https://jk3yfTwHczNirJfKt.ay.delivery/manager/jk3yfTwHczNirJfKt";
script.referrerPolicy = "no-referrer-when-downgrade";
document.head.appendChild(script);
} catch (error) {
this.log('Error loading ad wrapper script:', error);
}
}
async loadScripts() {
try {
// Load ad wrapper
this.loadAdWrapperScript();
// Load Facebook pixel noscript
this.setupFacebookNoscript();
// Load P1 script
await this.loadP1Script();
// Set prebid timeout
window.PREBID_TIMEOUT = this.config.prebidTimeout;
} catch (error) {
this.log('Error loading scripts:', error);
}
}
setupFacebookNoscript() {
try {
const noscript = document.createElement("noscript");
const img = document.createElement("img");
img.height = "1";
img.width = "1";
img.style.display = "none";
img.src = "https://www.facebook.com/tr?id=1581007252192655&ev=PageView&noscript=1";
noscript.appendChild(img);
document.head.appendChild(noscript);
} catch (error) {
this.log('Error setting up Facebook noscript:', error);
}
}
async loadP1Script() {
return new Promise((resolve) => {
try {
const script = document.createElement("script");
script.id = "script_p1";
script.src = "https://cdn.historycollection.com/wp-content/uploads/2024/03/p1.js";
script.onload = () => resolve();
script.onerror = () => resolve(); // Continue even if script fails
document.head.appendChild(script);
// Fallback timeout
setTimeout(resolve, 5000);
} catch (error) {
this.log('Error loading P1 script:', error);
resolve();
}
});
}
setupFacebookPixel() {
try {
// Initialize pixel globals
window.pixel_ads_amount_value = this.pixel.adsAmountValue;
window.pixel_last_sent_value = this.pixel.lastSentValue;
window.pixel_event_fired = this.pixel.eventFired;
window.pixel_small_event_fired = this.pixel.smallEventFired;
window.pixel_small_events = this.pixel.smallEvents;
} catch (error) {
this.log('Error setting up Facebook pixel:', error);
}
}
setupEventListeners() {
try {
// Revenue tracking
window.addEventListener("assertive_predictedRevenue", (event) => {
this.handlePredictedRevenue(event);
}, false);
// Impression logging
window.addEventListener("assertive_logImpression", (event) => {
this.handleLogImpression(event);
});
} catch (error) {
this.log('Error setting up event listeners:', error);
}
}
handlePredictedRevenue(event) {
try {
const data = event.data;
if (!data || !data.predictedRevenueCPM) {
return;
}
let winnerCPM = data.predictedRevenueCPM.impression;
if (winnerCPM === 0) return;
this.log("assertive_predictedRevenue", window.assertive && window.assertive.analytics && window.assertive.analytics.custom ? window.assertive.analytics.custom.custom_6 : 'unknown', winnerCPM);
// Update aggregated value and send pixel events
this.sendPurchaseAggregatedValue(winnerCPM);
// Apply margin if configured
if (this.config.cpmMarginPercent > 0) {
winnerCPM = winnerCPM - (winnerCPM * this.config.cpmMarginPercent) / 100;
}
if (winnerCPM < 0) return;
// Prepare Facebook pixel data
const fbPixelData = {
value: winnerCPM,
currency: "USD",
content_ids: window.location.href.split("/")[3] || '',
content_type: "Product",
bidder: "Google",
adUnit: data.meta ? data.meta.slotId : '',
};
// Determine winner and platform
const winnerInfo = this.determineWinner(data);
// Report to external systems
this.reportWin({
biddingPlatformId: winnerInfo.biddingPlatformId,
partnerAuctionId: data.meta ? data.meta.auctionId : '',
bidderCode: winnerInfo.winner,
prebidAuctionId: data.meta ? data.meta.auctionId : '',
cpm: winnerCPM,
currency: "USD",
originalCpm: winnerCPM,
originalCurrency: "USD",
status: "rendered",
placementId: data.meta ? data.meta.slotId : '',
});
// Send Facebook pixel event
if (typeof fbq !== "undefined") {
fbq("track", "Purchase", fbPixelData);
}
// Update analytics
this.updateAnalytics();
} catch (error) {
this.log('Error handling predicted revenue:', error);
}
}
determineWinner(data) {
let biddingPlatformId = 3; // Default to Google
let winner = "Google";
try {
if (data.meta && data.meta.dfpResponseInformation) {
const advertiserId = data.meta.dfpResponseInformation.advertiserId;
if (advertiserId === 4566943199) {
biddingPlatformId = 1; // Prebid
winner = data.meta.highestBid ? data.meta.highestBid.bidderCode : winner;
} else if (advertiserId === 4726541655) {
biddingPlatformId = 2; // Amazon
winner = "amazon";
}
}
} catch (error) {
this.log('Error determining winner:', error);
}
return { winner: winner, biddingPlatformId: biddingPlatformId };
}
sendPurchaseAggregatedValue(winnerCPM) {
try {
this.pixel.adsAmountValue += winnerCPM;
window.pixel_ads_amount_value = this.pixel.adsAmountValue;
if (typeof fbq === "undefined") return;
// Process small events
this.processSmallEvents();
// Process $10 increments
this.processIncrementalEvents();
// Process milestone events
this.processMilestoneEvents();
} catch (error) {
this.log('Error sending purchase aggregated value:', error);
}
}
processSmallEvents() {
try {
this.pixel.smallEvents.forEach((threshold, index) => {
if (this.pixel.smallEventFired <= index && this.pixel.adsAmountValue > threshold) {
this.pixel.smallEventFired++;
window.pixel_small_event_fired = this.pixel.smallEventFired;
const eventName = (threshold / 10) + "R" + (window.site_prefix || '');
this.sendCustomEvent(eventName, {
currency: "USD",
value: threshold,
});
}
});
} catch (error) {
this.log('Error processing small events:', error);
}
}
processIncrementalEvents() {
try {
while (
this.pixel.adsAmountValue > 10 &&
this.pixel.adsAmountValue < 310 &&
this.pixel.adsAmountValue > this.pixel.lastSentValue + 10
) {
this.pixel.lastSentValue += 10;
window.pixel_last_sent_value = this.pixel.lastSentValue;
const eventName = (this.pixel.lastSentValue / 10) + "R" + (window.site_prefix || '');
this.sendCustomEvent(eventName, {
currency: "USD",
value: this.pixel.lastSentValue,
});
}
} catch (error) {
this.log('Error processing incremental events:', error);
}
}
processMilestoneEvents() {
try {
const milestones = [
{ threshold: 30, event: "HC_30" },
{ threshold: 50, event: "HC_50" },
{ threshold: 80, event: "HC_80" },
{ threshold: 100, event: "HC_100" }
];
milestones.forEach((milestone, index) => {
if (this.pixel.adsAmountValue > milestone.threshold && this.pixel.eventFired === index) {
this.pixel.eventFired++;
window.pixel_event_fired = this.pixel.eventFired;
this.sendCustomEvent(milestone.event, {
currency: "USD",
value: this.pixel.adsAmountValue,
});
}
});
} catch (error) {
this.log('Error processing milestone events:', error);
}
}
sendCustomEvent(eventName, data) {
try {
if (typeof fbq !== "undefined") {
fbq("trackCustom", eventName, data);
}
if (typeof cis_send_custom_event !== "undefined") {
cis_send_custom_event(eventName, data);
}
} catch (error) {
this.log('Error sending custom event:', error);
}
}
handleLogImpression(event) {
try {
const payload = event.data ? event.data.payload : null;
if (!payload) return;
const mediaType = (payload.highestBid && payload.highestBid.mediaType) || "banner";
if (payload.unfilled || payload.sourceInternal !== "gpt") {
return;
}
// Apply iOS bias for banner ads
if (mediaType === "banner" && this.isIOS) {
payload.revenueBias = 0.975;
}
} catch (error) {
this.log('Error handling log impression:', error);
}
}
reportWin(winData) {
try {
// Report to IntentIQ (if not Chrome)
if (!this.isChrome && typeof intentIq_612283370 !== "undefined" && intentIq_612283370.reportExternalWin) {
intentIq_612283370.reportExternalWin(winData);
}
} catch (error) {
this.log('Error reporting win:', error);
}
}
updateAnalytics() {
try {
if (typeof intentIq_612283370 !== "undefined" && intentIq_612283370.intentIqConfig) {
const testGroup = intentIq_612283370.intentIqConfig.abTesting ? intentIq_612283370.intentIqConfig.abTesting.currentTestGroup : null;
if (window.assertive && window.assertive.analytics && window.assertive.analytics.custom) {
window.assertive.analytics.custom.custom_8 = testGroup === "A" ? "IIQ_Enabled" : "IIQ_Disabled";
}
if (testGroup === "A") {
window.iiqCallbackMethod_init = true;
}
}
} catch (error) {
this.log('Error updating analytics:', error);
}
}
log() {
if (this.config.showLogs && typeof console !== 'undefined' && console.log) {
try {
console.log.apply(console, arguments);
} catch (e) {
// Silent fail if console is not available
}
}
}
}
// Initialize the ad manager
try {
window.adManager = new AdManager();
} catch (error) {
if (typeof console !== 'undefined' && console.error) {
console.error('Failed to initialize AdManager:', error);
}
}
// Add Impact site verification meta tag
try {
const metaTag = document.createElement('meta');
metaTag.name = 'impact-site-verification';
metaTag.content = 'bd46cba2-8f9e-4fd2-97e3-030369b052ff';
document.head.appendChild(metaTag);
} catch (error) {
if (typeof console !== 'undefined' && console.error) {
console.error('Failed to add meta tag:', error);
}
}
})();
Punish the Non-Believers: 6 Cruel Torture Methods of the Spanish Inquisition
Donna Patricia Ward - April 8, 2017
Ferdinand and Isabella, the Spanish Catholic monarchs, established the Tribunal of the Holy Office of the Inquisition in 1478. Commonly referred to as the Spanish Inquisition, all of Spain and its colonies in Europe and the Americas fell under its authority. Initially, it was created to ensure orthodoxy from those Christians that had converted from Judaism and Islam. Royal decrees issued in 1492 and 1502 demanded that all Jews and Muslims convert to Christianity or leave Spain . At the same time of these decrees, Spain had claimed much of the New World for itself and began a process of spreading Christianity over thousands of miles.
Charges of heresy were serious offenses. When a person violated the important teachings of Christianity, the Inquisition Tribunal would charge them as a heretic. If they confessed, their punishment was not too harsh. If they refused to confess, they were tortured until officials heard a confession. The Inquisition in Spain looked different from the Inquisition in New Spain, Peru, New Granada, or Rio de la Plata. The Inquisition began in the fifteenth century and was brutally harsh. When it finally ended in the nineteenth century, its authoritative power had greatly subsided. Below are several torture methods used during the Spanish Inquisition in the New World.
The Strappado by Jacques Callot. Public Domain
Strappado
The use of the strappado or Corda had three variations. The accused would have their hands tied behind their back, similar in nature to modern-day handcuffing. A rope would be tied to the wrists and passed over a pulley, beam, or hook, depending upon the place where the torture took place. As the accused was pulled off of the ground, they were hanging from their arms.
Variations on the strappado included using weights to cause more resistance and pain. The inverted and extended shoulders would separate from their sockets. At times, jerking the hanging victim would cause the shoulders to break. An especially torturous variation on the strappado was tying the wrists of the accused in front along with the ankles, then adding weights before pulling the victim off of the ground to hang.
Even in its less-invasive state, the strappado would separate the shoulders and cause agonizing pain to the accused. Physical damage to the accused would be obvious to any onlookers as shoulders separated from their sockets. If the ankles were also tied, hips and legs would also suffer damage.
The length of time for the strappado was relatively short. Reports of its use during the Inquisition had the entire process completed in 60 minutes or less. Of course, a person’s individual threshold for pain would have ultimately determined the strappado’s success of eliciting a confession or information sought by the tribunal. While death did not happen with this torture method, permanent nerve, ligament, and tendon damage was likely to occur in the victim.