function eplAMROShrinkLayer(banner_id) {
        var eAMRO = eplAMROGetBanner(banner_id);
	if (eAMRO != null) {
		var eC = eAMRO.parentDiv ? eAMRO.parentDiv : document.getElementById('exp-cont' + eAMRO.bannerId);
		var eCC = eAMRO.div ? eAMRO.div : document.getElementById('eplContainer' + eAMRO.bannerId);
		if (eC != null && eCC != null) {
		    eC.style.zIndex = 0;
		    eCC.style.height = eAMRO.minHeight+'px';
		    eCC.style.width = eAMRO.minWidth+'px';
		}
	}
}
function eplAMROExpandLayer(banner_id) {
	var eAMRO = eplAMROGetBanner(banner_id);
	if (eAMRO != null) {
		var eC = eAMRO.parentDiv ? eAMRO.parentDiv : document.getElementById('exp-cont' + eAMRO.bannerId);
		var eCC = eAMRO.div ? eAMRO.div : document.getElementById('eplContainer' + eAMRO.bannerId);
		if (eC != null && eCC != null) {
		    eC.style.zIndex = eAMRO.zIndex;
		    eCC.style.height = eAMRO.maxHeight+'px';
		    eCC.style.width = eAMRO.maxWidth+'px';
		}
	}
}
function eplAMROGetBanner(banner_id) {
	var eAMRO = null;

	if (banner_id != null) {
		eAMRO = eval('document.eplAMRO_' + banner_id);
	}

	return eAMRO;
}
function eplAMROGetBannerFromQueue() {
	var eAMRO = null;
	if (document.eplAMROBannerQueue) {
		if (document.eplAMROBannerQueue.length > 0) {
			eAMRO = document.eplAMROBannerQueue.shift();
		}
	}

	return eAMRO;
}
function eplAMROFixFV(div_id,exp){
	var x = document.getElementById(div_id+'_embed');
	if (x !=null && x.flashvars !=null) {
		var fv = x.flashvars;
		fv = fv.replace(/il%3D0/i, "il%3D1");
		if (fv.indexOf('eplExpanded')==-1) {
			fv += '&eplExpanded='+(exp?exp:0);
		} else {
			if (exp==1) fv = fv.replace(/eplExpanded%3D0/, "eplExpanded%3D1");
			if (exp==0) fv = fv.replace(/eplExpanded%3D1/, "eplExpanded%3D0");
		}
		x.flashvars = fv;
	}
}
function eplAMROLaunchBanner() {
	var eAMRO = eplAMROGetBannerFromQueue();
	if (eAMRO == null) {
		return;
	}
	var fStyle = 'position:absolute; width:' + eAMRO.maxWidth + 'px; height:' + eAMRO.maxHeight + 'px;overflow:visible;';
	fStyle += eAMRO.movingDirection==3 ? 'bottom:0px;' : 'top:0px;';
	fStyle += eAMRO.movingDirection==4 ? 'right:0px;' : 'left:0px;';
	var objTag = '<div id="'+eAMRO.bannerId+'_flash" style="'+fStyle+';overflow:visible;"><object id="' + eAMRO.bannerId + '_object" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + eAMRO.flashVersion + '" width="' + eAMRO.maxWidth + '" height="' + eAMRO.maxHeight + '" align="middle"> <param name="flashvars" value="' + eAMRO.flashVars + '"/> <param name="allowScriptAccess" value="always"> <param name="scale" value="noborder"/> <param name="salign" value="' + eAMRO.salign + '"/> <param name="movie" value="' + eAMRO.flashSrc + '"/> ' + eAMRO.wmodeObject + ' <param name="quality" value="high"/> <param name="bgcolor" value="#ffffff"/> <embed id="' + eAMRO.bannerId + '_embed" scale="noborder" salign="' + eAMRO.salign + '" flashvars="' + eAMRO.flashVars + '" src="' + eAMRO.flashSrc + '" quality="high" ' + eAMRO.wmodeEmbed + ' width="' + eAMRO.maxWidth + '" height="' + eAMRO.maxHeight + '" align="middle" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"></embed></object></div>';
	
        if (eAMRO.div != null) {
	    var ePC = eAMRO.parentDiv ? eAMRO.parentDiv : document.getElementById('exp-cont' + eAMRO.bannerId);
	    var eC = eAMRO.div ? eAMRO.div : document.getElementById('eplContainer' + eAMRO.bannerId);
	    if (ePC != null && eC != null) {
        	ePC.style.overflow = 'visible';
        	eC.style.overflow = 'hidden';
        	if (eAMRO.movingDirection==3) { eC.style.top=''; eC.style.bottom='0px'; } else { eC.style.top='0px'; }
        	if (eAMRO.movingDirection==4) { eC.style.left=''; eC.style.right='0px'; } else { eC.style.left='0px'; }
        	eC.style.width = eAMRO.minWidth+'px';
        	eC.style.height = eAMRO.minHeight+'px';
    		eC.innerHTML = objTag;
    	    }
        } else {
    	    throw "eAMRO.div not defined";
	}
	
	if (eAMRO.url_conteo) { var i = new Image(); i.src = eAMRO.url_conteo; };
	if (eAMRO.url_conteo2) { var i2 = new Image(); i2.src = eAMRO.url_conteo2; };
	if (eAMRO.url_conteo3) { var i3 = new Image(); i3.src = eAMRO.url_conteo3; };
	if (eAMRO.url_conteo_tag) { var itag = new Image(); itag.src = eAMRO.url_conteo_tag; };
}
eplAMROLaunchBanner();