function vpmcReceiveMessage2(event) {
if ( event.origin !== "https://secure.pilotonline.com" &&
event.origin !== "https://managesubscription.pilotmediacompanies.com" &&
event.origin !== 'https://secure2.pilotonline.com' &&
event.origin !== 'https://pilotonline.com' &&
event.origin !== 'https://admin-chicago2.bloxcms.com' &&
event.origin !== 'https://certification27.bloxcms.com' &&
event.origin !== 'https://sandbox.tinypass.com' &&
event.origin !== 'https://experience.tinypass.com' &&
event.origin !== 'https://buy.tinypass.com'
) {
return;
}
if (event && typeof event.data != 'undefined' && typeof event.data == 'object' &&
typeof event.data.piano == 'object' ) {
var result = event.data.piano;
/* Message came from Piano on the PO level*/
if (typeof result.object != 'undefined' && 'message' in result.object) {
var msg = result.object.message;
if (msg && typeof msg == 'string' && result.success) {
var subWin = document.getElementById("vpmc_subscriptions_signin_modal");
if (subWin && typeof subWin.contentWindow == 'object') {
/* If we got a message from top level Piano that this template is visible,
we want to pass the message "iframe-view-modal" down through the secure iframe,
so it can load Tag Manager only when actually being viewed. */
subWin.contentWindow.postMessage(msg, '*');
}
}
}
}
if (event && (event.data == 'signedIn')) {
/* If iframe tells us the user is signed in, we send our own post message
to the main parent window (pilotonline) */
window.parent.postMessage('signedIn', '*');
}
}
window.addEventListener("message", vpmcReceiveMessage2, true);