//> 1);
}
}
else
{
// if we got here, we didn't find anything but script. Try again later.
setTimeout(checkAndSetAdContainerVisibilityRec, contentCheckTimeout);
}
}
}
function checkVisibilityAndUpdateRenderDataContextForElement(renderData)
{
if (!renderData)
{
return;
}
evaluateAdContent(renderData);
}
function evaluateAdContent(renderData)
{
var adContainer = renderData && renderData.elem;
if (!adContainer)
{
renderData.adSizeType = AdSizeType.Inconclusive;
}
var adIframeCollection = adContainer.getElementsByTagName("iframe");
var evaluationResult;
for (var adIframe, ndx = 0; (adIframe = adIframeCollection[ndx]); ++ndx)
{
// skip script-only iFrame elements
var body = ((adIframe.contentDocument || (adIframe.contentWindow || {}).document) || {}).body;
if (!body || !body.hasChildNodes())
{
continue;
}
var childNode, hasChildDiv = false;
for (var index = body.childNodes.length - 1; (childNode = body.childNodes[index]); --index)
{
if (childNode.nodeType === 1
&& childNode.nodeName !== "SCRIPT")
{
hasChildDiv = true;
renderData.adSizeType = evaluateElement(childNode, renderData);
if (renderData.adSizeType === AdSizeType.NonPointSizedAd)
{
return;
}
}
// Bug 1715559:[dl_ux][FF9.0] [Win7] - Advertisement is overlapping destination section
// For FF lower versions (FF9.0), index may be negative and hence cause js errors
// Add index value check to solve the problem
if (index discernibleAdWidthThreshold && maxHeight > discernibleAdHeightThreshold)
{
return AdSizeType.NonPointSizedAd;
}
if (maxWidth > 0 && maxHeight > 0)
{
return AdSizeType.PointSizedAd;
}
return AdSizeType.Inconclusive;
}
function evaluateElementDimension(element, isWidth, threshold)
{
var dimensionProperties = isWidth ? ["width", "offsetWidth", "scrollWidth"] : ["height", "offsetHeight", "scrollHeight"];
var pixelStyle = isWidth ? "pixelWidth" : "pixelHeight";
var dimensionStyle = isWidth ? "width" : "height";
var totalProperties = 3;
var maxDimension = 0, dimension = 0;
for (var i = 0; i < totalProperties; i++)
{
if ((dimension = element[dimensionProperties[i]]) > maxDimension)
{
maxDimension = dimension;
if (maxDimension > threshold)
{
break;
}
}
}
var elemStyle = element.style;
if (maxDimension maxDimension)
{
maxDimension = dimension;
if (maxDimension maxDimension)
{
maxDimension = dimension;
}
}
}
return maxDimension;
}
function setAdContainerDisplayState(elemId, doShow, adSizeClassname)
{
var adHtmlContainer = ((document.getElementById(elemId) || {}).parentNode || {}).parentNode;
if (!adHtmlContainer)
{
return;
}
adHtmlContainer.style.display = doShow ? "" : "none";
var className = adHtmlContainer.className;
className = addOrRemoveClassname(className, postEvaluationClassname, doShow);
className = addOrRemoveClassname(className, postEvaluationAdSmallClassname, adSizeClassname === postEvaluationAdSmallClassname);
className = addOrRemoveClassname(className, postEvaluationAdMediumClassname, adSizeClassname === postEvaluationAdMediumClassname);
className = addOrRemoveClassname(className, postEvaluationAdLargeClassname, adSizeClassname === postEvaluationAdLargeClassname);
className = addOrRemoveClassname(className, postEvaluationNoAdClassname, adSizeClassname === postEvaluationNoAdClassname);
adHtmlContainer.className = className;
}
function addOrRemoveClassname(classNameList, className, add)
{
var classIndex = classNameList.indexOf(className);
if (add)
{
if (classIndex === -1)
{
return classNameList + " " + className;
}
}
else if (classIndex >= 0)
{
return classNameList.replace(className, "");
}
return classNameList;
}
window.dap = dapResult;
})();
//]]>
dap("&AP=1390&PG=WEAARES14&PVGUID=3e7d577856e84bbf9b0c6d61a9d53be5&PROVIDERID=7HD66FC", 728, 90, "banner4_homepage_container_0b5ac270-d573-4976-b1d7-5819911cc7bc");