//$version:  $
//<!--
// This is part of the ebay JS toolbox library
// All rights reserved.
//
// File:	 footer_ads_ns.js
// Desc:	 Code library for double click ads
// NOTE:     Include this JS only at the end of your HTML file, 
//           this is required only for NS4.x, optional for the rest of the browsers.
//
// Change Log:
// iiimmddyyn  nnnnn  Description
// ----------  -----  --------------------------------------------------------
// sp0310041          Initial creation
//

var isNS4x = false;
if (document.layers)
	isNS4x = true;

function processAdLayers()
{
	if (isNS4x)
	{
		if (typeof(_ebayAds) != "undefined")
		{
			var h = "";
			for (var i=0; i<_ebayAds.length;i++)
			{
				var lId = _ebayAds[i].layerId;
				var lW = _ebayAds[i].config.ifWidth;
				var lH = _ebayAds[i].config.ifHeight;
				h += '<LAYER SRC="' + _ebayAds[i].adUrl + '" width="' + lW + '" height="' + lH + '" visibility="hidden" ';
				h += 'onLoad="moveToAbsolute(' + lId + '.pageX,' + lId + '.pageY);clip.height=' + lH + ';clip.width='+ lW + ';';
				h += ' visibility=\'show\';"></LAYER>';
			}
//			alert(h);
			document.write(h);
		}
	}
}

//Required for NS 4.x, fixes a Netscape 4.x resize bug
function eOnResize()
{ 
	if(innerWidth!=origWidth||innerHeight!=origHeight)location.reload(); 
}

if (isNS4x)
{
	processAdLayers();
	origWidth=innerWidth;
	origHeight=innerHeight;
	onresize=eOnResize();
}
//-->
