document.write('');
if(typeof(dartCallbackObjects) == "undefined")
var dartCallbackObjects = new Array();
if(typeof(dartCreativeDisplayManagers) == "undefined")
var dartCreativeDisplayManagers = new Object();
if(typeof(dartMotifAds) == "undefined")
var dartMotifAds = new Array();
if(!self.dartLoadedGlobalTemplates_55_04) {
self.dartLoadedGlobalTemplates_55_04 = {};
}
if(self.dartLoadedGlobalTemplates_55_04["@GT_TYPE@"]) {
self.dartLoadedGlobalTemplates_55_04["@GT_TYPE@"].isLoaded = true;
}
function RichMediaCore_55_04() {
this.isPageLoaded = false;
this.CREATIVE_TYPE_EXPANDING = "ExpandingFlash";
this.CREATIVE_TYPE_FLOATING = "FloatingFlash";
this.CREATIVE_TYPE_INPAGE = "InpageFlash";
this.CREATIVE_TYPE_INPAGE_WITH_FLOATING = "InpageFlashFloatingFlash";
this.CREATIVE_TYPE_FLOATING_WITH_REMINDER = "FloatingFlashReminderFlash";
this.CREATIVE_TYPE_INPAGE_WITH_OVERLAY = "InpageFlashOverlayFlash";
this.ASSET_TYPE_FLOATING = "Floating";
this.ASSET_TYPE_INPAGE = "Inpage";
this.ASSET_TYPE_EXPANDING = "Expanding";
this.ASSET_TYPE_REMINDER = "Reminder";
this.ASSET_TYPE_OVERLAY = "Overlay";
this.STANDARD_EVENT_DISPLAY_TIMER = "DISPLAY_TIMER";
this.STANDARD_EVENT_INTERACTION_TIMER = "INTERACTION_TIMER";
this.STANDARD_EVENT_INTERACTIVE_IMPRESSION = "EVENT_USER_INTERACTION";
this.STANDARD_EVENT_FULL_SCREEN_VIDEO_PLAYS = "";
this.STANDARD_EVENT_FULL_SCREEN_VIDEO_COMPLETES = "";
this.STANDARD_EVENT_FULL_SCREEN_AVERAGE_VIEW_TIME = "";
this.STANDARD_EVENT_MANUAL_CLOSE = "EVENT_MANUAL_CLOSE";
this.STANDARD_EVENT_BACKUP_IMAGE = "BACKUP_IMAGE_IMPRESSION";
this.STANDARD_EVENT_EXPAND_TIMER = "EXPAND_TIMER";
this.STANDARD_EVENT_VIDEO_PLAY = "EVENT_VIDEO_PLAY";
this.STANDARD_EVENT_VIDEO_VIEW_TIMER = "EVENT_VIDEO_VIEW_TIMER";
this.STANDARD_EVENT_VIDEO_VIEW_COMPLETE = "EVENT_VIDEO_COMPLETE";
this.STANDARD_EVENT_VIDEO_INTERACTION = "EVENT_VIDEO_INTERACTION";
this.STANDARD_EVENT_VIDEO_PAUSE = "EVENT_VIDEO_PAUSE";
this.STANDARD_EVENT_VIDEO_MUTE = "EVENT_VIDEO_MUTE";
this.STANDARD_EVENT_VIDEO_REPLAY = "EVENT_VIDEO_REPLAY";
this.STANDARD_EVENT_VIDEO_MIDPOINT = "EVENT_VIDEO_MIDPOINT";
this.STANDARD_EVENT_VIDEO_FULLSCREEN = "";
this.STANDARD_EVENT_VIDEO_STOP = "EVENT_VIDEO_STOP";
this.STANDARD_EVENT_VIDEO_UNMUTE = "EVENT_VIDEO_UNMUTE";
this.STANDARD_EVENT_FULLSCREEN = "EVENT_FULLSCREEN";
this.STANDARD_EVENT_DYNAMIC_CREATIVE_IMPRESSION = "DYNAMIC_CREATIVE_IMPRESSION";
};
RichMediaCore_55_04.prototype.csiTimes = new Object();
RichMediaCore_55_04.prototype.setCsiEventsRecordedDuringBreakout = function(creative) {
this.csiTimes["gb"] = creative.gtStartLoadingTime;
};
RichMediaCore_55_04.prototype.csiHasValidStart = function(creative) {
return ((creative.csiAdRespTime >= 0) && (creative.csiAdRespTime < 1e5));
};
RichMediaCore_55_04.prototype.shouldReportCsi = function(creative) {
return this.csiHasValidStart(creative) || (Math.floor(Math.random() * 1001) == 1);
};
RichMediaCore_55_04.prototype.shouldCsi = function(asset, creativeType) {
switch (creativeType) {
case this.CREATIVE_TYPE_INPAGE_WITH_FLOATING:
return asset.assetType == this.ASSET_TYPE_INPAGE;
case this.CREATIVE_TYPE_FLOATING_WITH_REMINDER:
return asset.assetType == this.ASSET_TYPE_FLOATING;
case this.CREATIVE_TYPE_INPAGE_WITH_OVERLAY:
return asset.assetType == this.ASSET_TYPE_INPAGE;
default: return true;
}
};
RichMediaCore_55_04.prototype.trackCsiEvent = function(event) {
this.csiTimes[event] = new Date().getTime();
};
RichMediaCore_55_04.prototype.getCsiServer = function() {
return (self.location.protocol &&
self.location.protocol.toString().toLowerCase() == 'https:') ?
"https://static.doubleclick.net" : "http://static.2mdn.net";
};
RichMediaCore_55_04.prototype.reportCsi = function(creative) {
if (!creative.previewMode && creative.logCsi) {
var url = this.getCsiServer() + "/csi/d?s=rmad&v=2&rt=";
for(var event in this.csiTimes) {
url += event + "." + (this.csiTimes[event] - creative.csiBaseline) + ",";
}
url = url.replace(/\,$/, '');
var regEx = new RegExp(/(.*\/\/)/);
url += "&adi=asd_" + creative.adServer.replace(regEx, '')
+ ",csd_" + creative.mediaServer.replace(regEx, '')
+ ",gt_" + creative.globalTemplateJs.replace(/(.*\/)/, '');
if (this.csiHasValidStart(creative)) {
url += "&srt=" + creative.csiAdRespTime;
}
this.trackUrl(url, true, creative.previewMode);
}
};
RichMediaCore_55_04.prototype._isValidStartTime = function(startTime) {
return this._isValidNumber(startTime);
};
RichMediaCore_55_04.prototype._convertDuration = function(duration) {
if(duration) {
duration = duration.toString().toUpperCase();
switch(duration) {
case "AUTO": return "AUTO";
case "NONE": return 0;
default: return (this._isValidNumber(duration) ? eval(duration) : 0);
}
}
return 0;
};
RichMediaCore_55_04.prototype.convertUnit = function(pos) {
if(pos != "") {
pos = pos.toLowerCase().replace(new RegExp("pct", "g"), "%");
if(pos.indexOf("%") < 0 && pos.indexOf("px") < 0 && pos.indexOf("pxc") < 0)
pos += "px";
}
return pos;
};
RichMediaCore_55_04.prototype._isValidNumber = function(num) {
var floatNum = parseFloat(num);
if(isNaN(floatNum) || floatNum < 0)
return false;
return (floatNum == num);
};
RichMediaCore_55_04.prototype.writeSurveyURL = function(creative) {
if(!creative.previewMode && creative.surveyUrl.length > 0) {
document.write('');
}
};
RichMediaCore_55_04.prototype.postPublisherData = function(creative, publisherURL) {
if(!creative.previewMode && this.isInterstitialCreative(creative) && publisherURL != "") {
var postImg = new Image();
postImg.src = publisherURL;
}
};
RichMediaCore_55_04.prototype.isInterstitialCreative = function(creative) {
return (creative.type == this.CREATIVE_TYPE_FLOATING
|| creative.type == this.CREATIVE_TYPE_FLOATING_WITH_REMINDER);
};
RichMediaCore_55_04.prototype.isBrowserComplient = function(plugin) {
return (this.isInternetExplorer() || this.isFirefox() || this.isSafari() || this.isChrome()) && (this.isWindows() || this.isMac()) && this.getPluginInfo() >= plugin;
};
RichMediaCore_55_04.prototype.shouldDisplayFloatingAsset = function(duration) {
return !this.isInternetExplorer() || this._convertDuration(duration) || this.getIEVersion() >= 5.5;
};
RichMediaCore_55_04.prototype.isWindows = function() {
return (navigator.appVersion.indexOf("Windows") != -1);
};
RichMediaCore_55_04.prototype.isFirefox = function() {
var appUserAgent = navigator.userAgent.toUpperCase();
if(appUserAgent.indexOf("GECKO") != -1) {
if(appUserAgent.indexOf("FIREFOX") != -1) {
var version = parseFloat(appUserAgent.substr(appUserAgent.lastIndexOf("/") + 1));
return (version >= 1);
}
else if(appUserAgent.indexOf("NETSCAPE") != -1) {
version = parseFloat(appUserAgent.substr(appUserAgent.lastIndexOf("/") + 1));
return (version >= 8);
} else {
return false;
}
}
else {
return false;
}
};
RichMediaCore_55_04.prototype.isSafari = function() {
var br = "Safari";
var index = navigator.userAgent.indexOf(br);
var appVendor = (navigator.vendor != undefined) ? navigator.vendor.toUpperCase() : "";
return (navigator.appVersion.indexOf(br) != -1) && parseFloat(navigator.userAgent.substring(index + br.length + 1)) >= 312.6 && (appVendor.indexOf("APPLE") != -1);
};
RichMediaCore_55_04.prototype.isChrome = function() {
var appUserAgent = navigator.userAgent.toUpperCase();
var appVendor = (navigator.vendor != undefined) ? navigator.vendor.toUpperCase() : "";
return (appUserAgent.indexOf("CHROME") != -1) && (appVendor.indexOf("GOOGLE") != -1);
};
RichMediaCore_55_04.prototype.isMac = function() {
return (navigator.appVersion.indexOf("Mac") != -1);
};
RichMediaCore_55_04.prototype.isInternetExplorer = function() {
return (navigator.appVersion.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") < 0);
};
RichMediaCore_55_04.prototype.getIEVersion = function() {
var version = 0;
if(this.isInternetExplorer()) {
var key = "MSIE ";
var index = navigator.appVersion.indexOf(key) + key.length;
var subString = navigator.appVersion.substr(index);
version = parseFloat(subString.substring(0, subString.indexOf(";")));
}
return version;
};
RichMediaCore_55_04.prototype.getPluginInfo = function() {
return (this.isInternetExplorer() && this.isWindows()) ? this._getIeWindowsFlashPluginVersion() : this._detectNonWindowsFlashPluginVersion();
};
RichMediaCore_55_04.prototype._detectNonWindowsFlashPluginVersion = function() {
var flashVersion = 0;
var key = "Shockwave Flash";
if(navigator.plugins && (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins[key])) {
var version2Offset = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins[key + version2Offset].description;
var keyIndex = flashDescription.indexOf(key) + (key.length+1);
var dotIndex = flashDescription.indexOf(".");
var majorVersion = flashDescription.substring(keyIndex, dotIndex);
var descArray = flashDescription.split(" ");
var minorVersion = (parseInt(descArray[descArray.length - 1].replace(new RegExp("[A-Za-z]", "g"), "")));
if(isNaN(minorVersion)) {
minorVersion = "0";
}
flashVersion = parseFloat(majorVersion + "." + minorVersion);
if(flashVersion > 6.0 && flashVersion < 6.65) {
flashVersion = 0 ;
}
}
return flashVersion;
};
RichMediaCore_55_04.prototype._getIeWindowsFlashPluginVersion = function() {
var versionStr = "";
var flashVersion = 0;
var versionArray = new Array();
var tempArray = new Array();
var lineFeed = "\r\n";
var defSwfVersion = 0;
var str = 'swfVersion = '+ defSwfVersion + lineFeed +
'mtfIsOk = ' + false + lineFeed +
'On Error Resume Next' + lineFeed +
'set motifSwfObject = CreateObject(\"ShockwaveFlash.ShockwaveFlash\")' + lineFeed +
'mtfIsOk = IsObject(motifSwfObject)' + lineFeed +
'if mtfIsOk = true then' + lineFeed +
'swfVersion = motifSwfObject.GetVariable(\"$version\")' + lineFeed +
'end if' + lineFeed + '';
window.execScript(str, "VBScript");
if(mtfIsOk) {
versionStr = swfVersion;
tempArray = versionStr.split(" ");
if(tempArray.length > 1) {
versionArray = tempArray[1].split(",");
var versionMajor = versionArray[0];
var versionRevision = versionArray[2];
if(versionMajor > 9 && versionArray.length > 3) {
versionRevision = versionArray[versionArray.length - 1];
}
flashVersion = parseFloat(versionMajor + "." + versionRevision);
}
}
return flashVersion;
};
RichMediaCore_55_04.prototype.trackBackupImageEvent = function(adserverUrl) {
var activityString = "eid1=9;ecn1=1;etm1=0;";
var timeStamp = new Date();
var postImage = document.createElement("IMG");
postImage.src = adserverUrl + "×tamp=" + timeStamp.getTime() + ";" + activityString;
};
RichMediaCore_55_04.prototype.trackUrl = function(url, createElement, previewMode) {
if(previewMode || url == "") {
return;
}
if (createElement) {
var postImage = document.createElement("IMG");
postImage.src = url;
}
else {
document.write('');
}
};
RichMediaCore_55_04.prototype.logThirdPartyImpression = function(creative) {
this.trackUrl(creative.thirdPartyImpUrl, false, creative.previewMode);
};
RichMediaCore_55_04.prototype.logThirdPartyBackupImageImpression = function(creative, createElement) {
this.trackUrl(creative.thirdPartyBackupImpUrl, createElement, creative.previewMode);
};
RichMediaCore_55_04.prototype.logThirdPartyFlashDisplayImpression = function(creative, createElement) {
this.trackUrl(creative.thirdPartyFlashDisplayUrl, createElement, creative.previewMode);
};
RichMediaCore_55_04.prototype.isPartOfArrayPrototype = function(subject) {
for(var prototypeItem in Array.prototype) {
if(prototypeItem == subject) {
return true;
}
}
return false;
};
RichMediaCore_55_04.prototype.toObject = function(variableName) {
try {
if(document.layers) {
return (document.layers[variableName]) ? eval(document.layers[variableName]) : null;
}
else if(document.all && !document.getElementById) {
return (eval("window." + variableName)) ? eval("window." + variableName) : null;
}
else if(document.getElementById && document.body.style) {
return (document.getElementById(variableName)) ? eval(document.getElementById(variableName)) : null;
}
} catch(e){}
return null;
};
RichMediaCore_55_04.prototype.getCallbackObjectIndex = function(obj) {
for(var i = 0; i < dartCallbackObjects.length; i++) {
if(dartCallbackObjects[i] == obj)
return i;
}
dartCallbackObjects[dartCallbackObjects.length] = obj;
return dartCallbackObjects.length - 1;
};
RichMediaCore_55_04.prototype.registerPageLoadHandler = function(handler, obj) {
var callback = this.generateGlobalCallback(handler, obj);
if(this.isInternetExplorer()) {
if(self.document.readyState == "complete")
callback();
else
self.attachEvent("onload", callback);
}
else if(this.isFirefox()) {
if(this.isPageLoaded) {
callback();
}
else {
self.addEventListener("load", callback, true);
}
}
else if(this.isSafari() || this.isChrome()) {
if(self.document.readyState == "complete")
callback();
else
self.addEventListener("load", callback, true);
}
};
RichMediaCore_55_04.prototype.pageLoaded = function() {
this.isPageLoaded = true;
};
RichMediaCore_55_04.prototype.registerPageUnLoadHandler = function(handler, obj) {
var callback = this.generateGlobalCallback(handler, obj);
if(this.isInternetExplorer() && this.isWindows()) {
self.attachEvent("onunload", callback);
}
else if(this.isFirefox() || this.isSafari() || this.isChrome()) {
self.addEventListener("unload", callback, true);
}
};
RichMediaCore_55_04.prototype.registerTimeoutHandler = function(timeout, handler, obj) {
window.setTimeout(this.generateGlobalCallback(handler, obj), timeout);
};
RichMediaCore_55_04.prototype.createFunction = function(name, ownerObject, args) {
var fun = "dartCallbackObjects[" + this.getCallbackObjectIndex(ownerObject) + "]." + name + "(";
for(var i = 0; i < args.length; i++) {
fun += "dartCallbackObjects[" + this.getCallbackObjectIndex(args[i]) + "]";
if(i != (args.length - 1))
fun += ",";
}
fun += ")";
return new Function(fun);
};
RichMediaCore_55_04.prototype.generateGlobalCallback = function(handler, obj) {
if(obj) {
var index = this.getCallbackObjectIndex(obj);
handler = "if(dartCallbackObjects["+ index +"] != null) dartCallbackObjects["+ index +"]." + handler;
}
return new Function(handler);
};
RichMediaCore_55_04.prototype.registerEventHandler = function(event, element, handler, obj) {
var callback = this.generateGlobalCallback(handler, obj);
if(this.isInternetExplorer() && this.isWindows()) {
self.attachEvent("on" + event, callback);
}
else if(this.isFirefox() || this.isSafari() || this.isChrome()) {
element.addEventListener(event, callback, false);
}
};
RichMediaCore_55_04.prototype.scheduleCallbackOnLoad = function(callback) {
var onloadCheckInterval = 200;
if(window.document.readyState.toLowerCase() == "complete")
eval(callback);
else
this.registerTimeoutHandler(onloadCheckInterval, "scheduleCallbackOnLoad('" + callback + "')", this);
};
RichMediaCore_55_04.prototype.getStyle = function(obj) {
if(window.getComputedStyle)
return window.getComputedStyle(obj, "");
else if(obj.currentStyle)
return obj.currentStyle;
else
return obj.style;
};
RichMediaCore_55_04.prototype.getWindowDimension = function() {
var dimension = new Object();
if(document.documentElement && document.compatMode == "CSS1Compat") {
dimension.width = document.documentElement.clientWidth;
dimension.height = document.documentElement.clientHeight;
} else if(document.body && (document.body.clientWidth || document.body.clientHeight) && !this.isSafari()) {
dimension.width = document.body.clientWidth;
dimension.height = document.body.clientHeight;
} else if(typeof(window.innerWidth) == 'number') {
dimension.width = window.innerWidth;
dimension.height = window.innerHeight;
}
return dimension;
};
RichMediaCore_55_04.prototype.getScrollbarPosition = function() {
var scrollPos = new Object();
scrollPos.scrollTop = 0;
scrollPos.scrollLeft = 0;
if(typeof(window.pageYOffset) == 'number') {
scrollPos.scrollTop = window.pageYOffset;
scrollPos.scrollLeft = window.pageXOffset;
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
scrollPos.scrollTop = document.body.scrollTop;
scrollPos.scrollLeft = document.body.scrollLeft;
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
scrollPos.scrollTop = document.documentElement.scrollTop;
scrollPos.scrollLeft = document.documentElement.scrollLeft;
}
return scrollPos;
};
RichMediaCore_55_04.prototype.isInFriendlyIFrame = function() {
return (this.isInMsnFriendlyIFrame() || this.isInAolFriendlyIFrame()
|| this.isInYahooFriendlyIFrame() || this.isInClientPreviewIFrame());
};
RichMediaCore_55_04.prototype.isInMsnFriendlyIFrame = function() {
return (typeof(inDapIF) != "undefined" && inDapIF);
};
RichMediaCore_55_04.prototype.isInAolFriendlyIFrame = function() {
return (typeof(inFIF) != "undefined" && inFIF);
};
RichMediaCore_55_04.prototype.isInMsnAjaxEnvironment = function() {
return (typeof(inDapMgrIf) != "undefined" && inDapMgrIf);
};
RichMediaCore_55_04.prototype.isInYahooFriendlyIFrame = function() {
return (typeof(isAJAX) != "undefined" && isAJAX);
};
RichMediaCore_55_04.prototype.isInClientPreviewIFrame = function() {
if(typeof(StudioPreviewResponse) != "undefined") {
return !(new StudioPreviewResponse()).isAdslotDetected;
} else {
return false;
}
};
RichMediaCore_55_04.prototype.isInAdSenseIFrame = function() {
return (typeof(IN_ADSENSE_IFRAME) != "undefined") && IN_ADSENSE_IFRAME;
};
RichMediaCore_55_04.prototype.checkDimension = function(dim) {
if (typeof dim == "number") {
return dim + "px";
} else {
return dim + (dim != "" && dim != "auto" && dim.indexOf("px") < 0 ? "px" : "");
}
};
RichMediaCore_55_04.prototype.setFlashVariable = function(asVersion, flashObject, variableName, value) {
if (asVersion == 1) {
flashObject.SetVariable("_root." + variableName, value);
} else {
flashObject.changeInputVariable(variableName, value);
}
};
RichMediaCore_55_04.prototype.getFlashVariable = function(asVersion, flashObject, variableName) {
if (asVersion == 1) {
return flashObject.GetVariable("_root." + variableName);
} else {
return flashObject.getFlashVariable(variableName);
}
};
RichMediaCore_55_04.prototype.getSalign = function(expandedWidth, expandedHeight, offsetTop, offsetLeft, offsetRight, offsetBottom) {
var salign = "";
if (offsetTop == 0 && offsetBottom != expandedHeight) {
salign += "T";
} else if (offsetTop != 0 && offsetBottom == expandedHeight) {
salign += "B";
}
if (offsetLeft == 0 && offsetRight != expandedWidth) {
salign += "L";
} else if (offsetLeft != 0 && offsetRight == expandedWidth) {
salign += "R";
}
if ((salign == "T" || salign == "B") && (offsetLeft != 0 || offsetRight != expandedWidth)) {
return "";
}
if ((salign == "L" || salign == "R") && (offsetTop != 0 || offsetBottom != expandedHeight)) {
return "";
}
return salign;
};
RichMediaCore_55_04.prototype.usesSalignForExpanding = function(salign, wmode) {
return ( (this.isMac() && (this.isSafari() || this.isFirefox()))
|| (this.isWindows() && this.isFirefox() && wmode.toLowerCase() == "window") ) && salign.length > 0;
};
RichMediaCore_55_04.prototype.unclipFlashObject = function(asset, width, height) {
this.clipFlashObject(asset, width, height, "auto", "auto", "auto", "auto");
};
RichMediaCore_55_04.prototype.clipFlashObject = function(asset, width, height, offsetTop, offsetRight, offsetBottom, offsetLeft) {
width = this.checkDimension(width);
height = this.checkDimension(height);
offsetTop = this.checkDimension(offsetTop);
offsetRight = this.checkDimension(offsetRight);
offsetBottom = this.checkDimension(offsetBottom);
offsetLeft = this.checkDimension(offsetLeft);
if (this.usesSalignForExpanding(asset.salign, asset.wmode)) {
var fl = document.getElementById("FLASH_"+asset.variableName);
fl.style.width = width;
fl.style.height = height;
fl.width = width;
fl.height = height;
fl.style.marginLeft = offsetLeft == "auto" ? "0px" : offsetLeft;
fl.style.marginTop = offsetTop == "auto" ? "0px" : offsetTop;
}
var exp = this.toObject("DIV_" + asset.variableName);
exp.style.clip = "rect(" + offsetTop + " " + offsetRight + " " + offsetBottom + " " + offsetLeft + ")";
};
RichMediaCore_55_04.prototype.getSitePageUrl = function(creative) {
if (creative.type == this.CREATIVE_TYPE_INPAGE_WITH_OVERLAY) {
return "";
}
if (creative.previewMode) {
return creative.livePreviewSiteUrl;
} else {
if (creative.type == this.CREATIVE_TYPE_INPAGE && creative.servingMethod == "i") {
return self.document.referrer;
} else {
return self.location.href;
}
}
};
RichMediaCore_55_04.prototype.getElementPosition = function(elementName) {
var obj = this.toObject(elementName);
var adPosition = new Object();
if(obj.getBoundingClientRect) {
adPosition.left = obj.getBoundingClientRect().left;
adPosition.top = obj.getBoundingClientRect().top;
} else {
adPosition.left = 0;
adPosition.top = 0;
if (obj.offsetParent) {
do {
adPosition.left += obj.offsetLeft;
adPosition.top += obj.offsetTop;
} while (obj = obj.offsetParent);
}
var windowScroll = this.getScrollbarPosition();
adPosition.top -= windowScroll.scrollTop;
adPosition.left -= windowScroll.scrollLeft;
}
return adPosition;
};
document.write('\n');
function IFrameBuster_55_04() {
};
IFrameBuster_55_04.prototype = new RichMediaCore_55_04;
IFrameBuster_55_04.prototype.getSiteHost = function(pageUrl) {
var siteHost = "";
if((pageUrl.length >= 7) && (pageUrl.substr(0, 7) == "http://"))
siteHost = pageUrl.substr(7);
else if((pageUrl.length >= 8) && (pageUrl.substr(0, 8) == "https://"))
siteHost = pageUrl.substr(8);
else
siteHost = pageUrl;
var index = siteHost.indexOf("/");
if(index > 0)
siteHost = siteHost.substr(0, index);
return siteHost;
};
IFrameBuster_55_04.prototype.getSiteProtocol = function(pageUrl) {
var siteProtocol = "";
if((pageUrl.length >= 5) && (pageUrl.substr(0, 5) == "http:"))
siteProtocol = "http:";
else if((pageUrl.length >= 6) && (pageUrl.substr(0, 6) == "https:"))
siteProtocol = "https:";
else
siteProtocol = "http:";
return siteProtocol;
};
IFrameBuster_55_04.prototype.canAccessParentPage = function() {
try {
self.parent.document.body;
return true;
} catch(e) {
return false;
}
};
IFrameBuster_55_04.prototype.writeIFrame = function(creative, plcrJs, globalTemplateJs) {
if(this.isInFriendlyIFrame()) {
this.processFriendlyIFrameBreakout(creative, plcrJs, globalTemplateJs);
} else {
this.processBreakoutUsingPublisherFile(creative, plcrJs, globalTemplateJs);
}
};
IFrameBuster_55_04.prototype.processFriendlyIFrameBreakout = function(creative, plcrJs, globalTemplateJs) {
var targetWindow = self.parent;
this.targetWindow = targetWindow;
var iframe = this.getThisIFrame();
if(typeof(targetWindow.richMediaIFrameCreatives) == "undefined") {
targetWindow.richMediaIFrameCreatives = {};
}
if(creative.isInterstitial && this.isInterstitialPlaying(targetWindow)) {
return;
}
this.setInterstitialPlaying(targetWindow);
targetWindow.richMediaIFrameCreatives[creative["uniqueId"]] = {
baseCreative: creative,
sourceIFrame: iframe,
plcrScript: plcrJs
};
if(this.checkAndLoadGlobalTemplate(targetWindow, creative, iframe, globalTemplateJs)) {
(new targetWindow.IFrameCreativeRenderer_55_04()).loadPlCrJs(plcrJs, iframe, targetWindow);
}
var unloadCallback = "removeCreative('" + creative.globalTemplateVersion + "','" + creative.creativeIdentifier + "'," + !this.isInYahooFriendlyIFrame() + ")";
this.registerPageUnLoadHandler(unloadCallback, this);
};
IFrameBuster_55_04.prototype.removeCreative = function(gtVersion, creativeIdentifier, deleteOnlyJSObjects) {
var iframeObj = this.getDARTIFrameObject();
iframeObj.removeCreative(creativeIdentifier, deleteOnlyJSObjects);
};
IFrameBuster_55_04.prototype.getDARTIFrameObject = function() {
return eval("(new this.targetWindow.IFrameCreativeRenderer_55_04())");
};
IFrameBuster_55_04.prototype.processBreakoutUsingPublisherFile = function(creative, plcrJs, globalTemplateJs) {
var docReferrer = self.document.referrer;
if(docReferrer == "") {
try {
docReferrer = self.parent.location.href;
if(docReferrer == "")
return;
}
catch(e) {
return;
}
}
if(creative.previewMode)
docReferrer = self.location.href;
var filePath = "";
if(filePath == "")
filePath = "/doubleclick/DARTIframe.html";
else
filePath += "DARTIframe.html";
var mediaServer = "http://s0.2mdn.net/879366";
var siteProtocol = this.getSiteProtocol(docReferrer);
var siteHost = this.getSiteHost(docReferrer);
siteHost = siteProtocol + "//" + siteHost + filePath;
var adParameters = escape(this.serialize(creative));
var getSizeLimit = 1600;
var staticParams = ">Version=" + escape(creative.globalTemplateVersion)
+ "&mediaserver=" + escape(mediaServer)
+ "&cid=" + escape(creative.creativeIdentifier) + "&plcrjs=" + escape(plcrJs)
+ "&globalTemplateJs=" + escape(globalTemplateJs);
var masterParamLength = getSizeLimit - staticParams.length - siteHost.length - "?adParams=".length;
var needSlaves = false;
if(masterParamLength >= adParameters.length)
masterParamLength = adParameters.length;
else
needSlaves = true;
var slaveParams = "";
var slaveParamLength = 0;
var numberOfSlaves = 0;
if(needSlaves) {
slaveParams = ">Version=" + escape(creative.globalTemplateVersion)
+ "&mediaserver=" + escape(mediaServer) + "&cid=" + escape(creative.creativeIdentifier);
slaveParamLength = getSizeLimit - siteHost.length - "?adParams=".length - slaveParams.length - "&index=".length;
numberOfSlaves = Math.ceil((adParameters.length - masterParamLength)/slaveParamLength);
}
var masterParams = adParameters.substring(0, masterParamLength);
document.write("");
if(needSlaves) {
adParameters = adParameters.substring(masterParamLength);
var paramLength = 0;
var slaveIndex = 0;
while(adParameters.length > 0) {
paramLength = slaveParamLength;
if(slaveParamLength >= adParameters.length)
paramLength = adParameters.length;
this.writeSlaveIFrame(siteHost, adParameters.substring(0, paramLength), slaveParams, slaveIndex++, creative.creativeIdentifier);
adParameters = adParameters.substring(paramLength);
}
}
};
IFrameBuster_55_04.prototype.writeSlaveIFrame = function(siteHost, adParams, slaveParams, index, cid) {
var iframeLocation = siteHost + "?adParams=" + adParams + slaveParams + "&index=" + index;
document.write("");
};
IFrameBuster_55_04.prototype.isInIFrame = function() {
var pageIFrameRequest = "";
var iframeReq = "";
if(this.isInAdSenseIFrame())
return false;
if(this.isInClientPreviewIFrame())
return true;
if(typeof(iframeRequest) != "undefined")
pageIFrameRequest = iframeRequest;
if(iframeReq != "")
pageIFrameRequest = iframeReq;
if(self == top)
return false;
else if(String(pageIFrameRequest).toLowerCase() == "false")
return false;
else if(self.location.href.toLowerCase().indexOf("doubleclick.net/adi") > -1)
return true;
else if(("j") == "i")
return true;
else
return this.checkWithTryCatch();
};
IFrameBuster_55_04.prototype.checkWithTryCatch = function() {
try {
if(self.parent.document) {
if(self.parent.document.getElementsByTagName("frame").length == 0) {
var frames = self.parent.frames;
for(var i = 0; i < frames.length; i++) {
if(frames[i] == self)
return true;
}
}
}
else if ((this.isSafari() || this.isChrome()) && self.parent.document == undefined) {
return true;
}
return false;
}
catch(e) {
return true;
}
};
IFrameBuster_55_04.prototype.isBreakoutSuccessful = function() {
try {
return (self.frames[0].frames.length > 0 && typeof(self.frames[0].frames['DARTMotifIFrame']) != "undefined");
}
catch(e) {
return true;
}
};
IFrameBuster_55_04.prototype.getThisIFrame = function() {
if(this.isFirefox() || this.isSafari() || this.isChrome()) {
var iframeElements = self.parent.document.getElementsByTagName("iframe");
for(var k = 0; k < iframeElements.length; k++) {
var iframeEle = iframeElements[k];
if(iframeEle.contentWindow == self) {
return iframeEle;
}
}
return null;
}
var targetWindow = self.parent;
var frames = targetWindow.frames;
for(var i = 0; i < frames.length; i++) {
if(frames[i] == self)
return targetWindow.document.getElementsByTagName("iframe")[i];
}
return null;
};
IFrameBuster_55_04.prototype.isInterstitialPlaying = function(targetWindow) {
return (typeof(targetWindow.DoNotDisplayIA) == "number");
};
IFrameBuster_55_04.prototype.setInterstitialPlaying = function(targetWindow) {
this.createJSVariable(targetWindow, "DoNotDisplayIA", 1);
};
IFrameBuster_55_04.prototype.createJSVariable = function(targetWindow, variableName, variableValue) {
targetWindow[variableName] = variableValue;
};
IFrameBuster_55_04.prototype.serialize = function(obj) {
var str = "";
for(var key in obj) {
str += escape(key) + "=";
str += escape(obj[key]) + "&";
}
return str.substr(0, str.length - 1);
};
IFrameBuster_55_04.prototype.checkAndLoadGlobalTemplate = function(targetWindow, creative, iframe, jsFile) {
var key = "";
if(creative.type == this.CREATIVE_TYPE_EXPANDING) {
key = "expandingIframe";
} else if(creative.type == this.CREATIVE_TYPE_FLOATING) {
key = "floatingIframe";
} else if(creative.type == this.CREATIVE_TYPE_INPAGE_WITH_FLOATING) {
key = "inpageFloatingIframe";
}
var shouldLoad = false;
if(!targetWindow.dartLoadedGlobalTemplates_55_04) {
targetWindow.dartLoadedGlobalTemplates_55_04 = {};
shouldLoad = true;
}
var map = targetWindow.dartLoadedGlobalTemplates_55_04;
if(!map[key]) {
map[key] = {
isLoading: false,
isLoaded: false
};
shouldLoad = true;
}
if(shouldLoad) {
var script = targetWindow.document.createElement("SCRIPT");
creative.gtStartLoadingTime = new Date().getTime();
script.src = jsFile;
var elements = targetWindow.document.getElementsByTagName("head");
if(this.isInternetExplorer() && elements.length > 0) {
elements[0].appendChild(script);
} else if(iframe.parentNode.parentNode) {
iframe.parentNode.parentNode.appendChild(script);
} else {
iframe.parentNode.insertBefore(script, iframe);
}
map[key].isLoading = true;
return false;
} else {
return map[key].isLoaded;
}
};
document.write('\n \n ');
function DARTExpandingUtil_55_04() {
this.displayImageOnBreakoutFailure = function(variableName, target, hRef, imgSrc, width, height, altText, creative) {
var callback = this.createFunction("displayImage", this, arguments);
if(this.isInternetExplorer()) {
if(self.document.readyState == "complete")
callback();
else
self.attachEvent("onload", callback);
}
else if(this.isFirefox()) {
self.addEventListener("load", callback, true);
}
else if(this.isSafari()) {
if(self.document.readyState == "complete")
callback();
else
self.addEventListener("load", callback, true);
}
}
this.displayImage = function(variableName, target, hRef, imgSrc, width, height, altText, creative) {
var iframeBuster = new IFrameBuster_55_04();
if(!iframeBuster.isBreakoutSuccessful()) {
var outerDiv = this.toObject("IMAGE_PLACEHOLDER_DIV_" + variableName);
outerDiv.innerHTML = '';
this.trackBackupImageEvent(creative.adserverUrl);
this.logThirdPartyBackupImageImpression(creative, true);
} else {
this.logThirdPartyFlashDisplayImpression(creative, true);
}
}
this.getSalign = function(expandedWidth, expandedHeight, offsetTop,offsetLeft,offsetRight,offsetBottom) {
var salign = "";
if (offsetTop == 0 && offsetBottom != expandedHeight) {
salign += "T";
} else if (offsetTop != 0 && offsetBottom == expandedHeight) {
salign += "B";
}
if (offsetLeft == 0 && offsetRight != expandedWidth) {
salign += "L";
} else if (offsetLeft != 0 && offsetRight == expandedWidth) {
salign += "R";
}
if ((salign == "T" || salign == "B") && (offsetLeft != 0 || offsetRight != expandedWidth)) {
return "";
}
if ((salign == "L" || salign == "R") && (offsetTop != 0 || offsetBottom != expandedHeight)) {
return "";
}
return salign;
}
this.getExpandingDivStyleSheet = function(cssKeyValues) {
if(cssKeyValues == "") {
return "";
}
var cssKeyValueArray = cssKeyValues.split(";");
var expandingDivCSS = "";
for (var i = 0; i < cssKeyValueArray.length; i++ ) {
var cssKeyVal = cssKeyValueArray[i].split(":");
if(cssKeyVal[0] != "display") {
if(expandingDivCSS != "")
expandingDivCSS += ";";
expandingDivCSS += cssKeyVal[0] + ":" + cssKeyVal[1];
}
}
return expandingDivCSS;
}
}
DARTExpandingUtil_55_04.prototype = new RichMediaCore_55_04;
document.write('\n \n ');
function PlcrInfo(filename, uid) {
this.filename = filename;
this.uniqueId = uid;
}
var richMediaPlcrMap = {};
richMediaPlcrMap["0"] = new PlcrInfo("plcr_1181416_0_1258396793960.js", "1258396791723");
var richMediaPlcrMap_1258396791723 = richMediaPlcrMap;
var plcrInfo_1258396791723 = richMediaPlcrMap_1258396791723["219422908"];
if (!plcrInfo_1258396791723) {
plcrInfo_1258396791723 = richMediaPlcrMap_1258396791723["0"];
}
function RichMediaCreative_1258396791723(type) {
var core = new RichMediaCore_55_04();
this.creativeIdentifier = "GlobalTemplate_" + "1258396791723" + (new Date()).getTime();
this.mtfNoFlush = "".toLowerCase();
this.globalTemplateVersion = "55_04";
this.isInterstitial = false;
this.mediaServer = "http://s0.2mdn.net";
this.adServer = "http://ad.doubleclick.net";
this.adserverUrl = "http://ad.doubleclick.net/activity;src=1833492;met=1;v=1;pid=42493704;aid=219422908;ko=0;cid=34267035;rid=34284913;rv=1;";
this.stringPostingUrl = "http://ad.doubleclick.net/activity;src=1833492;stragg=1;v=1;pid=42493704;aid=219422908;ko=0;cid=34267035;rid=34284913;rv=1;rn=7755829;";
this.swfParams = 'src=1833492&rv=1&rid=34284913';
this.renderingId = "34284913";
this.previewMode = (("%PreviewMode" == "true") ? true : false);
this.debugEventsMode = (("%DebugEventsMode" == "true") ? true : false);
this.pubHideObjects = "";
this.pubHideApplets = "";
this.mtfInline = ("".toLowerCase() == "true");
this.pubTop = core.convertUnit("");
this.pubLeft = core.convertUnit("");
this.pubDuration = "";
this.pubWMode = "";
this.isRelativeBody = ("" == "relative") ? true : false;
this.debugJSMode = ("" == "true") ? true : false;
this.logCsi = ("" == "true") ? true : false;
this.asContext = (('' != "") ? ('&keywords=' + '') : "")
+ (('' != "") ? ('&latitude=' + '') : "")
+ (('' != "") ? ('&longitude=' + '') : "");
this.clickThroughUrl = "http://ad.doubleclick.net/click%3Bh=v8/38ea/3/0/%2a/f%3B219422908%3B0-0%3B0%3B42493704%3B4307-300/250%3B34267035/34284913/1%3B%3B%7Eaopt%3D0/ff/68/ff%3B%7Efdr%3D217375568%3B0-0%3B0%3B27879349%3B4307-300/250%3B34071199/34089080/1%3B%3B%7Eaopt%3D2/1/68/0%3B%7Esscs%3D%3f";
this.clickN = "";
this.type = type;
this.uniqueId = plcrInfo_1258396791723.uniqueId;
this.thirdPartyImpUrl = "";
this.thirdPartyFlashDisplayUrl = "";
this.thirdPartyBackupImpUrl = "";
this.surveyUrl = "";
this.googleContextDiscoveryUrl = "http://pagead2.googlesyndication.com/pagead/ads?client=dclk-3pas-query&output=xml&geo=true";
this.livePreviewSiteUrl = "%LivePreviewSiteUrl";
this.servingMethod = "j";
if(this.previewMode && this.googleContextDiscoveryUrl.indexOf("adtest=on") == -1) {
this.googleContextDiscoveryUrl += "&adtest=on";
}
}
eval("RichMediaCreative_"+plcrInfo_1258396791723.uniqueId+" = RichMediaCreative_1258396791723;");
document.write('\n \n ');
function generateExpandingFlashCode() {
var core = new RichMediaCore_55_04();
var creative = new RichMediaCreative_1258396791723(core.CREATIVE_TYPE_EXPANDING);
RichMediaCreative_1258396791723.prototype.csiBaseline = new Date().getTime();
RichMediaCreative_1258396791723.prototype.csiAdRespTime =
isNaN("") ? -1 : RichMediaCreative_1258396791723.prototype.csiBaseline - parseFloat("");
core.logThirdPartyImpression(creative);
if(core.isBrowserComplient(9)) {
var mediaServer = "http://s0.2mdn.net";
var altImgTarget = "_blank";
var altImgHRef = "http://ad.doubleclick.net/activity;src%3D1833492%3Bmet%3D1%3Bv%3D1%3Bpid%3D42493704%3Baid%3D219422908%3Bko%3D0%3Bcid%3D34267035%3Brid%3D34284913%3Brv%3D1%3Bcs%3Da%3Beid1%3D213570%3Becn1%3D1%3Betm1%3D0%3B_dc_redir%3Durl%3fhttp://ad.doubleclick.net/click%3Bh=v8/38ea/3/0/%2a/f%3B219422908%3B0-0%3B0%3B42493704%3B4307-300/250%3B34267035/34284913/1%3B%3B%7Eaopt%3D0/ff/68/ff%3B%7Efdr%3D217375568%3B0-0%3B0%3B27879349%3B4307-300/250%3B34071199/34089080/1%3B%3B%7Eaopt%3D2/1/68/0%3B%7Esscs%3D%3fhttp://adiamondisforever.com";
var altImgSrc = "http://s0.2mdn.net/1833492/PID_1181416_fpo-end-state.jpg";
var altImgWidth = "300";
var altImgHeight = "250";
var altImgAltText = "";
var expandingUtil = new DARTExpandingUtil_55_04();
var iframeBuster = new IFrameBuster_55_04();
var plcrJs = "http://s0.2mdn.net/1833492/" + plcrInfo_1258396791723.filename;
if(iframeBuster.isInIFrame()) {
var iframeJs = "http://s0.2mdn.net/879366/expandingIframeGlobalTemplate_v2_55_04"
+ (creative.debugJSMode ? "_origin" : "" ) + ".js";
RichMediaCreative_1258396791723.prototype.globalTemplateJs = iframeJs;
iframeBuster.writeIFrame(creative, plcrJs, iframeJs);
if(!iframeBuster.isInFriendlyIFrame()) {
var variableName = "34284913_1_" + (new Date()).getTime();
document.write('
');
expandingUtil.displayImageOnBreakoutFailure(variableName, altImgTarget, altImgHRef, altImgSrc, altImgWidth, altImgHeight, altImgAltText, creative);
}
}
else {
RichMediaCreative_1258396791723.prototype.globalTemplateJs = "http://s0.2mdn.net/879366/expandingGlobalTemplate_v2_55_04"
+ (creative.debugJSMode ? "_origin" : "" ) + ".js";
RichMediaCore_55_04.prototype.trackCsiEvent("pb");
document.write('');
}
}
else {
document.write('');
core.trackBackupImageEvent(creative.adserverUrl);
core.logThirdPartyBackupImageImpression(creative, false);
}
core.writeSurveyURL(creative);
}
generateExpandingFlashCode();
document.write('\n \n ');
var core = new RichMediaCore_55_04();
if(core.isInMsnAjaxEnvironment()) {
window.setTimeout("document.close();", 1000);
}
document.write('\n');