
function Rotador(parTipo)
{
	var tipo=parTipo;
	var numero=0;
	var listaBanner1=new Array();
	var leftBotones=162;

//INICIO Solo debe modificarse agregando tipos en esta sección de código

	var anchoImagen1=399;
	if (parTipo==1)
	{
		AgregarBanner("url(/img/prd/babber-descuentos-tarjeta-estatico-399x189.jpg)","/scp/per_tar_credito_benefTarj.asp","Descuentos");
		AgregarBanner("url(/img/prd/babber-cuotifica-tarjeta-estatico-399x189.jpg)","/scp/per_tar_cuotif.asp","Cuotificaci&oacute;n");

	}


	if (parTipo==2)
	{
		AgregarBanner("url(/img/prd/babber-beneficios-tarjeta-estatico-399x189.jpg)","/scp/per_tar_credito_benef.asp","Beneficios");
		AgregarBanner("url(/img/prd/babber-descuentos-tarjeta-estatico-399x189.jpg)","/scp/per_tar_credito_benefTarj.asp","Descuentos");
		AgregarBanner("url(/img/prd/babber-cuotifica-tarjeta-estatico-399x189.jpg)","/scp/per_tar_cuotif.asp","Cuotificaci&oacute;n");
	}

	if (parTipo==3)
	{
		AgregarBanner("url(/img/banners/home/banner.jpg)","/scp/per_macropremia.asp","Macropremia");
		AgregarBanner("url(/img/banners/rapicompra.jpg)","/scp/per_pres_rapicompra.asp","RapiCompra");
		AgregarBanner("url(/img/banners/tarjetascredito.jpg)","/scp/per_tar.asp","Tarjetas");
		anchoImagen1=593;
		leftBotones=232;
	}
//FIN    Solo debe modificarse agregando tipos en esta sección de código
	var cantBotones=numero;
	var ancho=27*numero-4;
//	this.banner="<div onclick='frm1.submit();' id='ibanner' style='margin-bottom:-9px;height:189px;width:"+anchoImagen1+"px;background-image:"+listaBanner1[0].Imagen+";border:0'><div style='position:relative;left:162;top:162;'><img  src='/img/buttons/MACRO_botones_banners" +cantBotones + ".gif' align='center' border='0' frameborder='0' framespacing='0' scrolling='no'   style='border:0;width:" + ancho + "px;height:40px;' usemap='#navmap'/></div></div>";
	this.banner="<div onclick='frm1.submit();' id='ibanner' style='margin-bottom:-9px;height:189px;width:"+anchoImagen1+"px;background-image:"+listaBanner1[0].Imagen+";border:0'><div style='position:relative;left:"+ leftBotones +";top:162;'><img  src='/img/buttons/MACRO_botones_banners" +cantBotones + ".gif' align='center' border='0' frameborder='0' framespacing='0' scrolling='no'   style='border:0;width:" + ancho + "px;height:40px;' usemap='#navmap'/></div></div>";

	this.banner+="<Form id=frm1 action='" + listaBanner1[0].Url + "' name=frm1></Form>";
	
	this.banner+="<map name=navmap id=navmap >";
	var xInicio=0;
	var xFin=0;
	for (i=0;i<numero;i++)
	{
		xInicio=20*i+10;
		xFin=xInicio+15;
	this.banner+="	<area shape='rect'  coords='" + xInicio  + ",12," + xFin + ",27'   href='javascript:rotador.IrBanner(" + i + ");'   alt='" + listaBanner1[i].Descripcion  + "'>";

	}
	this.banner+="</map>";

	init();
	this.TextoBanner=FBanner;
	this.IrBanner=FijarBanner;


	function FBanner()
	{
		return this.banner;
	}


	function AgregarBanner(parImagen, parUrl, parDescripcion)
	{
		var banner1;
		banner1=new BannerActivo();
		banner1.Imagen=parImagen;
		banner1.Url=parUrl;
		banner1.Descripcion=parDescripcion;

		listaBanner1[numero]=banner1;
		numero++;
	}
	function BannerActivo()
	{
	}

	function init()
	{
		numero=0;
		makeFlash(this.banner);
		numero=1;

	}
	function MostrarBanner(parNumero)
	{

		ibanner.style.backgroundImage=listaBanner1[parNumero].Imagen;
		frm1.action=listaBanner1[parNumero].Url;
		return ;
	}

	function FijarBanner(parNumero)
	{

		ibanner.style.backgroundImage=listaBanner1[parNumero].Imagen;
		frm1.action=listaBanner1[parNumero].Url;
		numero=parNumero+1;
		if (numero==listaBanner1.length)
			numero=0;
		return ;
	}

	function SwapBanners()
	{
		MostrarBanner(numero);
		numero++;
		if (numero==listaBanner1.length)
			numero=0;
		return;
	
	}
	function makeFlash(obj)
	{
		var tiempo=5000;
		if (tipo==3)
			tiempo=4000;
		obj.flashTimer = setInterval(SwapBanners, tiempo);
	}
	function stopFlash(obj)
	{
		clearInterval(obj.flashTimer);
	}


}
