Skip to content

Instantly share code, notes, and snippets.

@Hebo
Created August 30, 2012 03:33
Show Gist options
  • Select an option

  • Save Hebo/3522042 to your computer and use it in GitHub Desktop.

Select an option

Save Hebo/3522042 to your computer and use it in GitHub Desktop.
this.RMIFOnLoad = function(AV, AZ) {
var AT = AV.frameElement;
var AR = AT.parentNode;
var AS = AT.parentNode.parentNode;
var AW = AZ.getElementById("adDiv");
var AU;
var Aa;
AS.style.width = "auto";
AS.style.height = "auto";
AS.overrideAdObj = new Object();
if (AR.callbackObj.isBlank == 1) {
AR.callbackObj.isFloat = 0;
if (AS.localAdObj.DEFHTML == undefined) {
AS.style.display = "none";
n("RMIFOnLoad: ad is blank and there is no DEFHTML. Hiding the placeholder.")
} else {
var AX = document.createElement("span");
AX.className = "defhtml";
if (typeof (AS.localAdObj.DEFHTML) != "undefined") {
AX.innerHTML = AS.localAdObj.DEFHTML
}
AS.insertBefore(AX, AR);
AT.style.display = "none";
n("RMIFOnLoad: ad is blank but there is DEFHTML. Hiding the iframe.")
}
} else {
var AY = document.createElement("span");
AY.className = "fifpre";
if (typeof (AR.callbackObj.FIFPRE) != "undefined") {
AY.innerHTML = AR.callbackObj.FIFPRE
}
AS.insertBefore(AY, AR);
var Ab = document.createElement("span");
Ab.className = "fifpost";
if (typeof (AR.callbackObj.FIFPOST) != "undefined") {
Ab.innerHTML = AR.callbackObj.FIFPOST
}
AS.insertBefore(Ab, null);
if (AR.childNodes.length == 1) {
Aa = AW.offsetWidth;
AU = AW.offsetHeight;
AR.callbackObj.isFloat = 0;
AT.style.width = Aa + "px";
AT.style.height = AU + "px";
AT.style.marginRight = "auto";
AT.style.marginLeft = "auto";
n("RMIFOnLoad: ad is not blank and not float. Setting height/width of iframe. h= " + AU + " w=" + Aa)
} else {
AR.callbackObj.isFloat = 1;
AT.style.width = "0px";
AT.style.height = "0px";
AT.style.display = "none";
n("RMIFOnLoad: ad is not blank but is a float ad. Hiding the iframe.")
}
}
if (typeof AR.callback == "function") {
n("RMIFOnLoad: calling single ad 'onload' callback");
AR.callback(AR.callbackObj)
}
AN.fireEvent("adOnload", AR.callbackObj);
x.trackDivLoaded(AR.reqId, AS.getAttribute("id"), AR.callbackObj);
if (AS.metaAdObj) {
AS.metaAdObj.isLoaded = 1
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment