var I_BANNER_ID = 0 ;
var I_BANNER_PRIORIDAD = 1 ;
var I_BANNER_ARCHIVO = 2 ;
var I_BANNER_WIDTH = 3 ;
var I_BANNER_HEIGHT = 4 ;
var I_BANNER_DESTINO = 5 ;
var I_BANNER_FLOTANTE_POS_RELATIVA = 6 ;
var I_BANNER_FLOTANTE_POS_X = 7 ;
var I_BANNER_FLOTANTE_POS_Y = 8 ;
var I_BANNER_FLOTANTE_TAM_RELATIVO = 9 ;
var I_BANNER_FLOTANTE_TAM_X = 10 ;
var I_BANNER_FLOTANTE_TAM_Y = 11 ;
var I_BANNER_FLOTANTE_RECUADRAR = 12 ;
var I_BANNER_FLOTANTE_SECONDS_VISIBLE = 13 ;
var I_BANNER_FLOTANTE_TIME_BETWEEN_SHOWS = 14 ;
var I_BANNER_REGIONES_GEOGRAFICAS = 15 ;

var BANNERS_PAGINA, iNumBanners ;

BANNERS_PAGINA = new Array() ;
iNumTotalBanners = 0 ;

//--------------------------------------------------------------------------------------------------------------

function drawBanners( sIDZonaPagina, iMaxPixelsH, iSepH, iMaxPixelsY, iSepY, iNumMax, sRegiones, iWidthTable)
{
	var iCont, iContPixelsH, iContPixelsY, iPrioridadActual, iDisponiblesPrioridadActual ;
	var aIndexBannersPrioridadActual, i, j, k, index, aBanners, sIDCapa, sPropiedadesCapa, sPropiedadesCapa2 ;
	var iWidth, iHeight, iX, iY, iWindowWidth, iWindowHeight, bDibujar, bRecuadrar, bBannerFlash ;
	var bHayBannersFlash, sPath, sTagFlashTransparente, sAttributeTagTransparente ;
		
	sTagFlashTransparente = " <param name='wmode' value='transparent' />\n" ;
	sAttributeTagTransparente = " wmode='transparent' " ;
	
	bHayBannersFlash = false ;
	
	iCont = 0 ;
	iContPixelsY = 0 ;
	iContPixelsH = 0 ;
	
	iPrioridadActual = "" ;
	iDisponiblesPrioridadActual = 0 ;

	aBanners = filtrarPorRegionGeografica(BANNERS_PAGINA[sIDZonaPagina], ID_REGION_GEOGRAFICA)
	
	if ((aBanners != null) && (aBanners.length) && (aBanners.length > 0))
	{	
		while ((iCont < aBanners.length) && (iCont < iNumMax) && (iContPixelsY < iMaxPixelsY))
		{	
			// SALTO ENTRE BANNERS
				
			if (iCont > 0)
				document.write("<tr><td><img src='/imagenes/espacio.gif' width='1' height='" + iSepY + "' border=0></td></tr>") ;
			
			// SI YA TERMINE CON LA PRIORIDAD ANTERIOR, BUSCO LA SIGUIENTE PRIORIDAD QUE CORRESPONDA
			
			if (iDisponiblesPrioridadActual == 0)
			{
				// BUSCA LA PRIORIDAD MAS ALTA (= NUMERO MAS BAJO) DE ENTRE LOS BANNERS QUE QUEDAN
				
				index = -1 ;
				for (i=0; i<aBanners.length ; i++)
				{
					if (aBanners[i] != null)
					{
						if (index == -1) 
							index = i ;
						else if (aBanners[i][I_BANNER_PRIORIDAD] < aBanners[index][I_BANNER_PRIORIDAD])
							index = i ;
					}
				}
				
				// YA TENGO LA PRIORIDAD MAS ALTA, CONSTRUYO UN ARRAY CON LOS INDICES DE LOS BANNERS
				//  DE ESTA PRIORIDAD
				
				aIndexBannersPrioridadActual = new Array() ;
				iDisponiblesPrioridadActual = 0 ;
				
				for (i=0; i<aBanners.length ; i++)
				{
					if (aBanners[i] != null)
					{
						if (aBanners[i][I_BANNER_PRIORIDAD] == aBanners[index][I_BANNER_PRIORIDAD])
						{
							aIndexBannersPrioridadActual[aIndexBannersPrioridadActual.length] = i ;
							iDisponiblesPrioridadActual++ ;
						}
					}
				}
			}
							
			// COJO AL AZAR UN BANNER DE ENTRE LOS DISPONIBLES DE ESTA PRIORIDAD

			do
			{
				i = Math.floor (Math.random() * aIndexBannersPrioridadActual.length) ;
			}
			while (aIndexBannersPrioridadActual[i] == null) ;
		
			index = aIndexBannersPrioridadActual[i] ;
			aIndexBannersPrioridadActual[i] = null ;
			
			//--------------------------------------------------------------------- LO PINTO
			
			bDibujar = true ;
			bRecuadrar = false ;
			zIndex = index ;
			
			if (aBanners[index][I_BANNER_FLOTANTE_POS_RELATIVA].length > 0)
			{
				//----------------------- CAPA FLOTANTE / INTERSTITIAL
						
				zIndex += 1000 ;
						
				// COMPRUEBO SI LO TENGO QUE PINTAR
			
				var dateLastShowed = getCookie("motomercado_control_banner_capa_" + aBanners[index][I_BANNER_ID]);
				if (dateLastShowed) 
				{
					bDibujar = false ;
				}
				else
				{
					var expire = new Date();
					
					if (aBanners[index][I_BANNER_FLOTANTE_TIME_BETWEEN_SHOWS].length > 0)
						expire.setTime(expire.getTime() + aBanners[index][I_BANNER_FLOTANTE_TIME_BETWEEN_SHOWS] * 60 * 1000);	// EL CONTROL EXPIRA EN x MINUTOS

					setCookie("motomercado_control_banner_capa_" + aBanners[index][I_BANNER_ID], new Date(), expire);		
			
					sIDCapa = "" + (10000+iNumTotalBanners);
					
					bRecuadrar = (aBanners[index][I_BANNER_FLOTANTE_RECUADRAR] == "S") ;
				
					// AVERIGUAMOS EL TAM DE LA VENTANA Y LA POSICION, POR SI ME HAN PEDIDO POSICION O TAMAŅO RELATIVOS
					
					if (window.innerWidth)
					{
					   iWindowWidth = window.innerWidth-15 ;
					   iWindowHeight = window.innerHeight ;
					}
					else if (document.all)
					{
					   iWindowWidth = document.body.clientWidth ;
					   iWindowHeight = document.body.clientHeight ;
					}
									
					// TAMAŅO
					
					if (aBanners[index][I_BANNER_FLOTANTE_TAM_RELATIVO] == 'S')
					{
						iWidth = Math.floor((iWindowWidth * aBanners[index][I_BANNER_FLOTANTE_TAM_X]) / 100.0) ;
						iHeight = Math.floor((iWindowHeight * aBanners[index][I_BANNER_FLOTANTE_TAM_Y]) / 100.0) ;
					}
					else
					{
						iWidth = Math.floor(aBanners[index][I_BANNER_FLOTANTE_TAM_X]) ;
						iHeight = Math.floor(aBanners[index][I_BANNER_FLOTANTE_TAM_Y]) ;
					}
					
					if ((iWidth == iWindowWidth) && (iHeight == iWindowHeight))
						bRecuadrar = false ;
					
					if (bRecuadrar)
					{
						iWidth += 5 ;
						iHeight += 23 ;
					}
				
					// POSICION
					
					if (aBanners[index][I_BANNER_FLOTANTE_POS_RELATIVA] == 'S')
					{
						iX = Math.floor(((iWindowWidth-iWidth) * aBanners[index][I_BANNER_FLOTANTE_POS_X]) / 100.0) ;
						iY = Math.floor(((iWindowHeight-iHeight) * aBanners[index][I_BANNER_FLOTANTE_POS_Y]) / 100.0) ;
					}
					else
					{
						iX = Math.floor(aBanners[index][I_BANNER_FLOTANTE_POS_X]) ;
						iY = Math.floor(aBanners[index][I_BANNER_FLOTANTE_POS_Y]) ;
					}
								
					sPropiedadesCapa = "z-index:" + (sIDCapa+1) + ";position:absolute;visibility=visible;width:" + iWidth + ";height:" + iHeight + ";left:" + iX + "px;top:" + iY + "px;" ;
					sPropiedadesCapa2 = "z-index:" + (sIDCapa) + ";position:absolute;visibility=visible;width:" + iWidth + ";height:" + (iHeight-10-13) + ";left:" + iX + "px;top:" + (iY+10) + "px;" ;
					
					document.write("<STYLE TYPE='text/css'>#capaBanner_" + sIDCapa + " {" + sPropiedadesCapa + "}</STYLE>");
					
					if (document.frames)
						;//document.write("<iframe id='capaBannerIFrame_" + sIDCapa + "' style='" + sPropiedadesCapa2 + "' border='0' frameborder='0' src='about:blank'></iframe>");
	
					document.write("<div id='capaBanner_" + sIDCapa + "' name='capaBanner_" + sIDCapa + "'>");	
					document.write("<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>");
					
					if (bRecuadrar)
					{
						j = iWidth - 157 - 74 - 4 ;
						k = iHeight - 10 - 13 ;

					   document.write(
										" <tr><td colspan='3'><table width='100%' border='0' cellspacing='0' cellpadding='0'>" +
										"    <tr>" +
										"     <td width='157'><img src='/imagenes/banners/PopUp_02.gif' width='157' height='10'></td>" +
										"     <td valign='top' width='" + j + "'><img src='/imagenes/banners/Extensible1.gif' width='" + j + "' height='10'></td>" +
										"     <td width='74'><img src='/imagenes/banners/PopUp_03.gif' width='74' height='10'></td>" +
										"     <td width='4'><img src='/imagenes/banners/PopUp_04.gif' width='4' height='10'></td>" +
										" </tr></table></td></tr>" +
										" <tr valign='top'>" +
										"  <td width='1'><img src='/imagenes/banners/PopUp_07.gif' width='1' height='" + k + "'></td>" +
										"  <td width='100%'><table border='0' align='center' cellpadding='0' cellspacing='0'>");									
					}
				}
			}

			// PINTO EL BANNER EN SI (SEA EN CAPA O EN LA PROPIA PAGINA)

			if (bDibujar)
			{
				bBannerFlash = false ;
				
				if ((iCont == 0) && (iWidthTable != null))
					document.write("<table border=0 cellspacing=0 cellpadding=0 width='" + iWidthTable + "'>");
		
				j = aBanners[index][I_BANNER_ARCHIVO].toLowerCase().indexOf(".swf");

				if (j >= 0)
					bHayBannersFlash = true ;
					
				if ((j >= 0) && (!checkFlash()))
				{
					// NO TIENE EL PLUG-IN DE FLASH. PINTO EL GIF ALTERNATIVO
					
					aBanners[index][I_BANNER_ARCHIVO] = aBanners[index][I_BANNER_ARCHIVO].substring(0,j) + ".gif" ;
				}
				
				if (aBanners[index][I_BANNER_ARCHIVO].toLowerCase().indexOf(".swf") >= 0)
				{
					// BANNER FLASH
					
					bBannerFlash = true ;
					
					sPath = aBanners[index][I_BANNER_ARCHIVO] ;
					j = sPath.lastIndexOf("/") ;
					if (j < 0) 
						sPath = "" ;
					else
						sPath = "/rcs/banners/" + sPath.substring(0,j+1) ;

					document.write("<tr><td><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' " +
										" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' " +
										sAttributeTagTransparente +
										" id='banner_" + aBanners[index][I_BANNER_ID] + "' name='banner_" + aBanners[index][I_BANNER_ID] + "' " +
										"width='" + aBanners[index][I_BANNER_WIDTH] + "' height='" + aBanners[index][I_BANNER_HEIGHT] + "'>\n" + 
										"<param name='movie' value='/scripts/banners/countPrint.asp?ID=" + aBanners[index][I_BANNER_ID] +
										"&path=" + escape(sPath) +
										"&src=" + escape(aBanners[index][I_BANNER_ARCHIVO]) +
										"&clickTag=" + escape('/scripts/banners/countClick.asp?ID=' + aBanners[index][I_BANNER_ID] +	
													"&url=" + escape(aBanners[index][I_BANNER_DESTINO]) + 
													"&rnd=" + parseInt(100000*Math.random())) +  
										"&url=" + escape(aBanners[index][I_BANNER_DESTINO]) +
										"&rnd=" + parseInt(100000*Math.random()) + "' />\n" +
										"<param name='quality' value='high' />\n" + 
										"<param name='z-index' value='" + zIndex + "' />\n" +
										"<param name='path' value='" + sPath + "' />\n" +
										sTagFlashTransparente +
										"<embed src='/scripts/banners/countPrint.asp?ID=" + aBanners[index][I_BANNER_ID] + "&src=" +
										escape(aBanners[index][I_BANNER_ARCHIVO]) + "&url=" +
										escape(aBanners[index][I_BANNER_DESTINO]) + "&clickTag=" +
										escape(aBanners[index][I_BANNER_DESTINO]) + "&rnd=" + parseInt(100000*Math.random()) + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' " +
										" type='application/x-shockwave-flash' width='" + aBanners[index][I_BANNER_WIDTH] + "' " +
										" id='banner_" + aBanners[index][I_BANNER_ID] + "' name='banner_" + aBanners[index][I_BANNER_ID] + "' " +
										" height='" + aBanners[index][I_BANNER_HEIGHT] + "' z-index='" + zIndex + "' " + sAttributeTagTransparente + "></embed></object></td></tr>") ;
				}
				else
				{
					// BANNER NORMAL
		
					document.write("<tr><td><a target='_blank' href='/scripts/banners/countClick.asp?ID=" + aBanners[index][I_BANNER_ID] + 
											"&url=" + escape(aBanners[index][I_BANNER_DESTINO]) + "'><img " +
											" src='/scripts/banners/countPrint.asp?ID=" + aBanners[index][I_BANNER_ID] + 
											"&src=" + escape(aBanners[index][I_BANNER_ARCHIVO]) + "#" + parseInt(100000*Math.random()) + "' width='" + aBanners[index][I_BANNER_WIDTH] +
											"' height='" + aBanners[index][I_BANNER_HEIGHT] + "' border='0'></a></td></tr>") ;
				}
				
				if (aBanners[index][I_BANNER_FLOTANTE_POS_RELATIVA].length > 0)
				{
					// CAPA FLOTANTE
					
					if (bRecuadrar)
					{	
						j = iWidth - 4 - 156 - 10 - 68 ;
						k = iHeight - 10 - 13 ;
																
						document.write("  </table></td>" +
										"  <td width='4'><img src='/imagenes/banners/PopUp_11.gif' width='4' height='" + k + "'></td>" +
										" </tr>" +
										" <tr>" +
										"  <td colspan='3'><table width='100%' border='0' cellspacing='0' cellpadding='0'>" +
										"    <tr valign='top'>" +
										"     <td width='4'><img src='/imagenes/banners/PopUp_13.gif' width='4' height='13'></td>" +
									   "     <td width='156'><img src='/imagenes/banners/PopUp_14.gif' width='156' height='13'></td>" +
									   "     <td width='10'><img src='/imagenes/banners/PopUp_19.gif' width='10' height='13'></td>" +
									   "     <td valign='top' width='" + j + "'><img src='/imagenes/banners/Extensible2.gif' width='" + j + "' height='13'></td>" +
									   "     <td width='68'><span onClick='hideBanner(" + sIDCapa + ");'><img src='/imagenes/banners/PopUp_20.gif' width='68' height='13' border='0' /></span></td>" +
									   "    </tr>" +
									   "  </table></td>" +
									   " </tr>");
					}
					   
					document.write("</table>");				   
					document.write("</div>");
					
					if (aBanners[index][I_BANNER_FLOTANTE_SECONDS_VISIBLE].length > 0)
						if (aBanners[index][I_BANNER_FLOTANTE_SECONDS_VISIBLE] > 0)
							setTimeout("hideBanner(" + sIDCapa + ");", 1000*aBanners[index][I_BANNER_FLOTANTE_SECONDS_VISIBLE]);
							
					if (bBannerFlash)
					{
						document.write("<scr" + "ipt language='javascript1.2'>\n" + 
											"function banner_" + aBanners[index][I_BANNER_ID] + "_DoFSCommand(command, args) \n" +
											"{	if (command == 'close') hideBanner('" + sIDCapa + "'); }\n" +
											"</sc" + "ript>");
				
						if ((navigator.appName && navigator.appName.indexOf("Microsoft") != -1) && 
							 (navigator.userAgent.indexOf("Windows") != -1) && 
							 (navigator.userAgent.indexOf("Windows 3.1") == -1))
						{
							document.write("<scr" + "ipt language='VBScript' >\n" +
													"On Error Resume Next\n" +
													"Sub banner_" + aBanners[index][I_BANNER_ID] + "_FSCommand(ByVal command, ByVal args)\n" +
													"	Call banner_" + aBanners[index][I_BANNER_ID] + "_DoFSCommand(command, args)\n" +
													"End Sub\n" +
													"</scr" + "ipt\>\n");
						}
					}
		
					setTimeout("moveBanner('" + sIDCapa + "', " + iX + ", " + iY + ");", 30);
				}
				
				iContPixelsH += parseInt(aBanners[index][I_BANNER_WIDTH]) ;
				iContPixelsY += parseInt(aBanners[index][I_BANNER_HEIGHT]) ;
			}
			
			// ACTUALIZO LOS DATOS

			iCont++ ;
			iNumTotalBanners++ ;			
			iDisponiblesPrioridadActual-- ;
			aBanners[index] = null ;
		}
		
		if ((iCont > 0) && (iWidthTable != null))
			document.write("</table>");
			
		if (bHayBannersFlash)
			setTimeout("askForFlash(60*10);", 1000);
	}
}
	
//-----------------------------------------------------------------------------------------
function filtrarPorRegionGeografica(aBanners, sIDRegionGeografica)
{
	var aBannersNew, i ;
	
	if ((aBanners == null) || eval("aBanners == 'undefined'"))
		return null ;

	if (sIDRegionGeografica.length > 0)
		sIDRegionGeografica = "," + sIDRegionGeografica + "," ;
		
	aBannersNew = new Array() ;
	for (i=0 ; i<aBanners.length ; i++)
	{
		// LA REGION GEOGRAFICA CERO ES 'TODAS'
		if ((aBanners[i][I_BANNER_REGIONES_GEOGRAFICAS].length == 0) ||
			 (aBanners[i][I_BANNER_REGIONES_GEOGRAFICAS].indexOf(',0,') >= 0) ||
			 ((sIDRegionGeografica.length > 0) && (aBanners[i][I_BANNER_REGIONES_GEOGRAFICAS].indexOf(sIDRegionGeografica) >= 0)))
			aBannersNew[aBannersNew.length] = aBanners[i] ;
	}
		
	return aBannersNew ;
}

//-------------------------------------------------------------------------------------------
function getObjectStyle(sName)
{
	var obj ;
	
	if (GLOBAL_browserType == "NS6")
	{
		obj = eval("document.getElementById(sName);");
		if (obj)
			obj = obj.style ;
	}
	else if (GLOBAL_browserType == "IE")
	{
		obj = eval(sName + ".style") ;
	}
	else if (GLOBAL_browserType == "NS4")
	{
		obj = eval("this.document." + sName) ;
	}
	else
	{
		obj = null ;
	}
	
	return obj ;
}

//-------------------------------------------------------------------------------------------
function hideBanner(sID)
{
	var obj ;
	
	obj = getObjectStyle('capaBanner_' + sID);
	if (obj)
	{
		if (GLOBAL_browserType == "NS6")
			obj.visibility = "hidden";
		else if (GLOBAL_browserType == "NS")
			obj.visibility = "hide";
		else if (GLOBAL_browserType == "IE")
			obj.visibility = "hidden";
	}
	
	if (GLOBAL_browserType == "IE")
	{
		obj = document.all('capaBannerIFrame_' + sID) ;
		if (obj)
		{
			obj = obj.style;
			if (obj)
			{
				obj.visibility = "hidden";
			}
		}		
	}
}

//-----------------------------------------------------------------------------------------

function moveBanner(sID, iX, iY)
{	
	var iOffsetX, iOffsetY, obj1, obj2;
	
	if (GLOBAL_browserType == "NS6")
	{
		iOffsetX = window.pageXOffset ;
		iOffsetY = window.pageYOffset ;
		
		obj1 = document.getElementById('capaBanner_' + sID);
		if (obj1)
		{
			obj1 = obj1.style ;
			if (obj1)
			{
				obj1.top = "" + (iOffsetY+iY) + "px" ;
				obj1.left = "" + (iOffsetX+iX) + "px" ;
			}
		}
		
		obj2 = document.getElementById('capaBannerIFrame_' + sID) ;
		if (obj2)
		{
			obj2 = obj2.style ;
			if (obj2)
			{
				obj2.top = "" + (iOffsetY+iY+10) + "px" ;
				obj2.left = "" + (iOffsetX+iX) + "px" ;
			}
		}
	}
	else if (GLOBAL_browserType == "IE")
	{
		iOffsetX = document.body.scrollLeft ;
		iOffsetY = document.body.scrollTop ;

		obj1 = document.all('capaBanner_' + sID) ;
		if (obj1)
		{
			obj1 = obj1.style;
			if (obj1)
			{
				obj1.pixelTop = (iOffsetY+iY) ;
				obj1.pixelLeft = (iOffsetX+iX) ;
			}
		}
		
		obj2 = document.all('capaBannerIFrame_' + sID) ;
		if (obj2)
		{
			obj2 = obj2.style;
			if (obj2)
			{
				obj2.pixelTop = (iOffsetY+iY+10) ;
				obj2.pixelLeft = (iOffsetX+iX) ;
			}
		}
	}
	else if (GLOBAL_browserType == "NS")
	{
		iOffsetX = window.pageXOffset ;
		iOffsetY = window.pageYOffset ;

		obj1 = eval('document.capaBanner_' + sID) ;
		if (obj1)
		{
			obj1.top = (iOffsetY+iY) ;
			obj1.left = (iOffsetX+iX) ;
		}
		
		obj2 = eval('capaBannerIFrame_' + sID) ;
		if (obj2)
		{
			obj2.top = (iOffsetY+iY+10) ;
			obj2.left = (iOffsetX+iX) ;
		}
	}	
	
	if (obj1)
		setTimeout("moveBanner('" + sID + "', " + iX + ", " + iY + ");", 30);	
}

//--------------------------------------------------------------------------------------
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

//--------------------------------------------------------------------------------------
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
//--------------------------------------------------------------------------------------

if (document.getElementById&&!document.all)
	GLOBAL_browserType = "NS6" ;
else if (document.all)
	GLOBAL_browserType = "IE" ;
else if (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4")
	GLOBAL_browserType = "NS6" ;
else
	GLOBAL_browserType = "" ;

//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------

document.write('<sc'+'ript language=VBScript>\nFunction VB_checkFlash()\nmxvers = 20\nmnvers = 4\nDo\nOn Error Resume Next\nset obj = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & mxvers & \"\")\nif (isObject(obj)) Then\nVB_checkFlash=1\nExit Function\nEnd If\nmxvers = mxvers - 1\nLoop While mxvers >= mnvers\nEnd Function\n</scr'+'ipt>');

function checkFlash()
{
	var shkflg;
	
	shkflg = 0; 
	if (navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] 
			&& navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) 
	{ 
		if (navigator.plugins && navigator.plugins['Shockwave Flash'] && (navigator.appVersion.search('5.5')==-1))
			shkflg = 1; 
	}
	if (navigator.appVersion.search('Opera') == -1 && (shkflg==0))
	{
		shkflg = VB_checkFlash();
	}
	
	return shkflg ;
}

//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
	
function askForFlash(iSecondsTimeout)
{		
	return ;	// DESACTIVADO HASTA NUEVO AVISO
	var cookieFlash = getCookie("motomercado_control_pregunta_flash");
	if (!cookieFlash)
	{
		if (!checkFlash())
		{
			// DIBUJO UN FLASH CON UN PIXEL TRANSPARENTE, PARA FORZAR AL NAVEGADOR A PREGUNTAR POR EL PLUG-IN FLASH
			
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=7,0,0,0" id=flashPixelTrans width=0 height=0><PARAM name=movie value="/rcs/pixelTrans.swf"><PARAM name=quality value=high><PARAM name=scale value=exactfit>');
			document.write('<embed src="/rcs/pixelTrans.swf" swLiveConnect=FALSE width=0 height=0 quality=high scale=exactfit type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'); 
			document.write('</object>');
		}
		
		var now = new Date();
		now.setTime(now.getTime() + (iSecondsTimeout * 1000));	// EL CONTROL DE POP-UP EXPIRA EN 20 MINUTOS
		setCookie("motomercado_control_pregunta_flash", "checked", now) ;
	}
}
