//Archivo para insertar aleatoriamente banners en la página


function MakeArray(n) {
	this.length=n
	for (var j=1; j<=n; j++) {
		this[j]=0
	}
	return this
}

function fBannera() {
//Generamos la matriz  de datos
//En cada entrada se coloca el codigo html del enlace y la imagen
//Se pueden añadir tantos como se quiera variando el número siguiente (hay que contar siempre uno más por el valor 0)
var Total=3;
banner=new MakeArray(Total)
banner[0]="<img src='images/arriba/pic1.jpg' style='width:183px;height:201;border:0;'>";
banner[1]="<img src='images/arriba/pic2.jpg' style='width:183px;height:201;border:0;'>";
banner[2]="<img src='images/arriba/pic3.jpg' style='width:183px;height:201;border:0;'>";

//Obtenemos un número aleatorio y seleccionamos la imagen correspondiente
aleatorio=Math.random();
imagen=parseInt(aleatorio*Total);
document.write(banner[imagen]);
}


//Van las imagenes pequeñas
var TOTAL=6;
BANNER=new MakeArray(TOTAL)
BANNER[0]="<img src='images/abajo/foto1.jpg' style='width:102px;height:102px;border:0px;'>";
BANNER[1]="<img src='images/abajo/foto2.jpg' style='width:102px;height:102px;border:0px;'>";
BANNER[2]="<img src='images/abajo/foto3.jpg' style='width:102px;height:102px;border:0px;'>";
BANNER[3]="<img src='images/abajo/foto4.jpg' style='width:102px;height:102px;border:0px;'>";
BANNER[4]="<img src='images/abajo/foto5.jpg' style='width:102px;height:102px;border:0px;'>";
BANNER[5]="<img src='images/abajo/foto6.jpg' style='width:102px;height:102px;border:0px;'>";
var Utilizada="";

function fBannerb() {
	var aleatorio=Math.random();
	var imagen=parseInt(aleatorio*TOTAL);
	Utilizada=imagen;
	document.write(BANNER[imagen]);
}

function fBannerc() {
	var imagen=Utilizada;
	while(imagen==Utilizada) {
		var aleatorio=Math.random();
		imagen=parseInt(aleatorio*TOTAL);
	}
	document.write(BANNER[imagen]);
}

